Ask a Question related to Macromedia Flash Actionscript, Design and Development.
-
jony_calavera webforumsuser@macromedia.com #1
filling a components array with createClassObject self destructive?
i´m having a hard time creating an array of Loaders. what i have so far is:
import mx.controls.Loader;
var i;
at = new Array();
for (i=0;i<10;i++){
at = new Object();
at = createClassObject(Loader,"p"+i,1,{autoLoad:true,sc aleContent:true});
with (at){
load("pix/crcl_mgr_" + String(i+1) + ".jpg");
_x = i*120;
_y = 0;
_width =100;
_height = 75;
}
}
the thing is that it succsessfully creates ONE object instead of 10. it seems to me it destroys the last created object every time it creates a new one. why?
any help would be gratly apreciated.
jony_calavera webforumsuser@macromedia.com Guest
-
Nested NonVisual Components in an array oracollection???
I have been wasting almost an entire 2 days trying to answer my flex2 as3 questions myself through experimentation... I am brand new, and here is... -
Please help! Problem with createClassObject
The createClassObject function seems always replace the previouly created objects. I have a function to create a labels in a canvas: function... -
Destructive type conversion (to_i!, to_f!)
Hi, There have been a few times in which I have wanted to destructively change the type of a variable, yet as fas I can determine there are only... -
Efficiently & safely (re)filling array from $_POST
I'm using a single script to generate a table with <input>s in each row. I fill the array with initial values, then write it out to the table and... -
filling an array
Anthony J Segelhorst wrote: Maybe try: /^EXCEL/ and @fields = split for `$lcf_tools/pslist EXCEL`; Also, take a look at Proc::ProcessTable... -
rashadrivera webforumsuser@macromedia.com #2
Re:filling a components array with createClassObject self destructive?
you are not using the array as it was intended. I change the code so it will work...
import mx.controls.Loader;
var i;
at = new Array();
for (i=0;i<10;i++) {
at = new Object(); // you need to address the object in the array
// not over write you aray into a new Object
// basically, you destroyed the array you just created
// this is not how to initiate the new object, but would work
//at = createClassObject(Loader,"p"+i,1,{autoLoad:true,sc aleContent:true});
// try this...
at = new Object(createClassObject(Loader,"p"+i,1,{autoLoad: true,scaleContent:true}));
with (at) {
load("pix/crcl_mgr_" + String(i+1) + ".jpg");
_x = i*120;
_y = 0;
_width =100;
_height = 75;
}
}
Please understand that I am new to Flash, but not to JavaScript, which is what ActiveScript seems to be derived off of. If this is not accurate, please, someone let me know. But if ActiveScript is just like JS w/ additions, then there is no doubt in my mind that this will work (given that you function calls where write from the start).
- rashad: [email]rashadriveraSPAM_IS_BAD@FIGHT_THE_SPAM.hotmail.com[/email]
- rashad
[email]rashadriveraIN_VALID@NO_SPAM_HERE_.hotmail.com[/email]
rashadrivera webforumsuser@macromedia.com Guest
-
jony_calavera webforumsuser@macromedia.com #3
Re:filling a components array with createClassObject self destructive?
i got the same result. :(
jony_calavera webforumsuser@macromedia.com Guest
-
jony_calavera webforumsuser@macromedia.com #4
Re:filling a components array with createClassObject self destructive?
i made a few changes this seems to work but fails to set some properties:
var i;
for(i=0;i<=2;i++) {
_root.strip.createClassObject(mx.controls.Loader,' pic'+i,i+1,{autoLoad:true,scaleContent:true,conten tPath:"pix/crcl_mgr_"+String(i+1)+".jpg"});
with (_root.strip['pic'+i]){
_x=i*120;
_y=0;
_width=100; //fails to set this width
_height=75; //also this height
}
}
what could be the problem??
any help would be greatly apreciated.
jony_calavera webforumsuser@macromedia.com Guest



Reply With Quote

