Macromedia Flash Professional 8 UNLEASHED [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Macromedia Flash Professional 8 UNLEASHED [Electronic resources] - نسخه متنی

David Vogeleer, Eddie Wilson, Lou Barber

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید






Changing Elements in Arrays


Now that you know how to add and remove elements, let's discuss how to change them. We will create an array, trace it to see the original, change the first element to something else by using the index, and then trace it again to see the difference as shown in the following code:


var my_array:Array = new Array("fName","lName");
trace(my_array);
my_array [0] = "age";
trace(my_array);
//output: fName, lName
// age, lName

That was pretty simple. We just renamed the first element, just like renaming a variable. What's more, changing named array elements is just as easy, as shown here:


var my_array:Array = new Array();
my_array.age = 24;
trace(my_array.age);
my_array.age = 25;
trace(my_array.age);
//output: 24
// 25

The next section covers in greater detail nested arrays and how they can be used and manipulated.


/ 318