Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Dynamic Object Labels



I have the bad feeling I'm really gonna get get nailed as newb for this one but I've been searching for hours and still am not sure how to do what I would like to do.

I am updating an old 2.0 file where I named objects such as movie clips in loops or functions using brackets... ex.


Code:
_root.["movieclip" + i]
can I do this in AS 3.0?

so that say in my class I can create multiple objects based on a for each loop each with a unique instance name that I can reference later?



ActionScript.org Forums > ActionScript Forums Group > ActionScript 3.0
Posted on: 01-24-2008, 11:59 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Dynamic Labels
I'm trying to create a dynamic timeline without using labels.

Right now I have a series of labels counting up the timeline (next1, next2, next3, and so on).

I have a button with a "keypress" function following up the timeline referencing those label.

on (keyPress "<Space>") {
gotoAndPlay("next"+forward);
_root.square = 0;
if (forward<70) {
forward++;
}

Is there a way to make a dynamic label system that will creat it's own numbers and order? It's killing me to have to relabel those numbers in order to have my button follow along.

Dynamic Labels?
I'm trying to create a dynamic timeline without using labels.

Right now I have a series of labels counting up the timeline (next1, next2, next3, and so on).

I have a button with a "keypress" function following up the timeline referencing those label.

on (keyPress "<Space>") {
gotoAndPlay("next"+forward);
_root.square = 0;
if (forward<70) {
forward++;
}

Is there a way to make a dynamic label system that will creat it's own numbers and order? It's killing me to have to relabel those numbers in order to have my button follow along.

Dynamic Labels On Buttons
I want to create a button symbol, create many instances of that symbol, and label them dynamically. These labels will change throughout the movie. How can I do this?

Dynamic Frame Labels
Any way to set a frame's label from ActionScript?

Something like _currentframe.framelabel = "text"

Dynamic Labels On Buttons
How to label a button with a dynamic textfield? I've tried it, but the rollover doesn't work into the textarea. I've tried to group the backgroud an the text area also, and it doesn't work either.
Somebody can help me?
Thanks,
Karel

Dynamic Timeline Without Using Labels
I'm trying to create a dynamic timeline without using labels.

Right now I have a series of labels counting up the timeline (next1, next2, next3, and so on).

I have a button with a "keypress" function following up the timeline referencing those label.

on (keyPress "<Space>") {
gotoAndPlay("next"+forward);
_root.square = 0;
if (forward<70) {
forward++;
}

Is there a way to make a dynamic label system that will creat it's own numbers and order? It's killing me to have to relabeled those numbers in order to have my button follow along.

Buttons With Dynamic Text Labels...
I think its fairly self explanitory, but Im looking for a tutorial or a simple script to reuse a movieclip, with a dynamic text field inside. I have the script to place all of the clips but I can't get the labels to be places. I have the actionscript on the timeline frame one. Would it look something like this:

navButton1.nav_text= "home";

Am I way off...

Buttons With Dynamic Text Labels...
I think its fairly self explanitory, but Im looking for a tutorial or a simple script to reuse a movieclip, with a dynamic text field inside. I have the script to place all of the clips but I can't get the labels to be places. I have the actionscript on the timeline frame one. Would it look something like this:

navButton1.nav_text= "home";

Am I way off...

Create Text Labels To Dynamic Created Buttons
How to add some dynamic text labels (using createTextField?) to buttons created using createEmptyMovieClip method?

Tried createTextField, just can't get it work.

thanks.

- mark

Dynamic Object
Hey, im calling a function with an argument and i want the argument to be the instance name of an object on stage. The function looks like this so far:

function cellMove(object_name){
_root.object_name._x = <new x value>;
_root.object_name._y = <new y value>;
}

This way in particular doesnt seem to work. Any help would be appreciated. Thanks in advance.

-cipha

Dynamic Object Tag?
We need to be able to load multiple swf files based on user screen resolution.

Using JavaScript it is easy to get the users rez of their monitor using screen.width.
Here is a snipped of my code:

Code:
<script language="JavaScript" type="text/JavaScript">
if (screen.width < 1280) {
swftoload="GMAT_Video_Course_CH1_large.swf";
width=1024;
height=768;
}else{
swftoload="GMAT_Video_Course_CH1_small.swf";
width=770;
height=600;
}
</script>
How do I get the swftoload name into the movie param as well as the width and height?


Code:
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="770" height="600" align="top">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="GMAT_Video_Course_CH1_small.swf" />
<param name="menu" value="false" />
<param name="quality" value="best" />
<param name="scale" value="noscale" />
<param name="salign" value="t" />
<param name="wmode" value="opaque" />
<param name="bgcolor" value="#29557c" />
<embed src="GMAT_Video_Course_CH1_small.swf" menu="false" quality="best" scale="noscale" salign="t" wmode="opaque" bgcolor="#29557c" width="770" height="600" align="top" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
Thanks

Dynamic Object Name
Hi,
I have been having a problem get a dynamic object name

i am trying to build a simple sample where i press a BTN it passes the name of the object but then i cant seem to use it.

[CODE]
Action Frame 1


showHide();
function showHide(myName) {
trace(myName); // This returns ball1
this.ball1._visible = false; // Hides object
this.ball2._visible = false;// Hides object
this.ball3._visible = false;// Hides object
this.ball4._visible = false;// Hides object



trace(this.myName._visible) // This does nothing
this.myName._visible = true; // does not work



}



stop()
[/CODE]


[CODE]
my Buttons

on (press) {
_root.showHide("ball1");
}
[/CODE]

Dynamic Object
Hi,

i am trying to define a dynamic object name.. here my code, but i guess it is wrong. any ideas?


PHP Code:



i = 0 
var knobListen = "knob"+i;
var knobListen:Object = new Object();
};
//add the event listener to the knob
myKnob_mc.addEventListener("onRotate", knobListen) 

Dynamic Object
hi!

im trying to dynamically create objects, getting their name from an array and depth from a for loop.. i realize i probably need to use a function, but i just dont see how i can do it...
thats what i have so far..

ffunction create(name, depth) {

return (createEmptyMovieClip (name, depth));
};


this.create (uname, num);


now, uname is a name of an object (if i trace it, it gives me the right name) , and num = i+2(also traces fine).

can someone please help me with this?

Dynamic Object Creation
Does anyone know how I would get the folowing code to work: Say I have my own object and its class name is stored in var myClass. How would I get this to evaluate?

var newObj = new myClass(this);

remember myClass is a variable containing the name of a class. I am trying to call this and pass a reference to the object that is making the call.

Any help is appreciated. If this was javascript then eval would work fine Im sure.

Do Dynamic Function From An Object
hello,

I have an object "myObject" with the function "run()"
-> myObject.run()
the function should be generated out of a string
-> do = "run()"
now I want to compose myObject with the string to do the
function of the object?
-> myObject + do

but difficult how?
thanks for help

pepe

Dynamic Object Names
Hi,

I am creating some textfields on the fly and I'm curious as to how I can make the object name dynamically named.

Example:


Code:
Var pcount=101;

_root.createTextField("pl"+pcount,0,30,120,150,50);
"p"+pcount.autoSize = true;
"p"+pcount.text = this["firstname"+i]+" "+this["lastname+"+i];


The createtextfield() option is fine as this is supposed to be in quote marks, but the autosize and text fail because of these. What I am hoping to do is make a loop to create a set of textfields with the names p101, p102, p103 etc.

Can anyone please help?

Dynamic Object Naming
A quick question for a guru...

Is it possible to dynamically name objects when instantiating them? If so (which I assume it must be) how do you do it?

...thanks for the help.

Dynamic Naming Of Object
in Actionscript 2 i have to distribute some xml to three different arrays. Now i would like to instantiate the array object in a dynamic way (because there can be any number of them). Like so:

for (x=0;x<3;x++){
"xmlArray"+x= new array(xml goes here);
}

This of course does not work - but how do i go about creating arrays in a dynamic way?

Dynamic Object Tint
Hi!

I've never really worked much with actionscript and the color object but I've read some posts and I'm still having a little trouble.

I have a button on the screen and I want to dynamically tint it to:

#B5C9E7 or 181, 201, 231 at 60%


I've tried this

on (rollOver) {
myColor = new Color(contact);
myColorTransform = new Object();
myColorTransform = {ra:'100', rb:'-24', ga:'100', gb:'-14', ba:'100', bb:'-5', aa:'100', ab:'-10'};
myColor.setTransform(myColorTransform);
}


It's not exact but It get's me close enough.

My two questions are is this the proper way to try and adjust the tint and is there a way to fade it to the new color rather then it happening instantaniously?

Thanks in advance for any help.

Dynamic Creation Of An Object's Name?
I've tried a few things to dynamincally create the name but have had no luck so far.

Basically, I'm trying to do this:



name = "object" + "number";

_root["frame"].name.goToAndStop(3);



How do I make the above work so I can have a dynamic name for where the above variable of 'name' is?

Dynamic Object Pathing
As in dynamically determining the best route fo an object to travel from its current position to wherever the mouse is clicked and go around obstacles.
I can get it to do a collision test when it reaches a wall, but is there an api out there that can determine a correct path prior to moving? Otherwise, I need to figure out how to tell the object to change its path when it reaches a wall and choose the correct direction to move.

Dynamic Object Declaration
Hello all you gurus out there,

I was wondering if it is possible to set the name of an object dynamically.
- much like you would with any other variable (i.e. this["varname"+i])
I've tried it when assigning a glow filter object but with no luck.

var gf:GlowFilter = new GlowFilter(0xFFE1FF, 20, 0, 0, 0, 3, false, false);

works but

var this["gf"+t]:GlowFilter = new GlowFilter(0xFFE1FF, 20, 0, 0, 0, 3, false, false);

does not.

any ideas?

cheers!

Creating Dynamic Object
I need to create an actionscript object dynamically where the name of the object is created based on user input. I have the following code which works but it requires I name the object in actionscript.

var ObjLabel:String = "Rice";
var ObjData:String = "$1.23";
var myObject:Object = new Object();
myObject[ObjLabel] = ObjData;

This works. If I enter:

trace(myObject.Rice);

it produces - $1.23

But I need to create the name of the object dynamically. Instead of using an object name such as "myObject" I would dynamically link (somehow) to the name entered by the client.

Dynamic Name For Sound() Object?
hey guys,

I am trying to get this mp3 player working, and Im getting an error that says I cannot use the same Sound() Object to play music in more than once, after using other Sound objects.

Can you help explain how I would create a dynamic name each time the following was called, where mySound1 would be unique each time?

Thanks!


ActionScript Code:
var mySound1:Sound = new Sound();
var myRequest:URLRequest=new URLRequest ("test.mp3");
mySound1.load(myRequest);
soundControl = mySound1.play();

Dynamic Object Names
i have an array of arrays that i want to turn into a series of objects.
the parent array is a list of items (shops) containing the items description (id, name, slug) as the child array

i want to be able to access this information something like item6.pid, item6.pslug, etc.

i'm going through the parent array and trying to create objects named "item1", "item2"


Code:
var outerArraylength = storesArray.length;
for (var i=0; i < outerArraylength; i++) {
var objjname = "item"+i;// create name for each object
this[objjname] = new Object;
this[objjname].pid = storesArray[i][0];
this[objjname].slug = storesArray[i][1];

trace(storesArray[i][1]);
}

trace (item6.slug);
the trace inside the for loop correctly spits out the slug,
but tracing item6.slug gives me, "Access of undefined property item6"

any help is appreciated

Dynamic Object Paths
Hi, I have a query;

myvar1 = "jim";
myvar2 = "bob";

_root.dosomething = function(var)
{
eval("_root."+var) = "dan";
}

The function is supposed to set the var based on the one passed in.

...So

_root.dosomething(myvar1); should set _root.jim to dan.

unfortunately the eval statement doesn't like to have assignment on the right hand side. How SHOULD I be doing this?

Dynamic History Object
Hello!!!

Have lost of swf to load and i wont to make a return button and forward.

It is possible to do that?

thanks

Dynamic Object Reference
I am the webmaster at http://eric.steveneaton.com/. I am workign on a game called Marco's Polo's. I'll spare the extreme details here, but I was bulding an inventory class (Inv). I want to have some way to take a string like "slot0" in a variable and use it to access an object called slot0. A book I read used something similiar, "_root[name]._x = whatever" to loop though any number n of movie clips in the storyline. Is there syntax that translates to classes?

AddListener For Dynamic Object
I'm creating a menu bar for a flash website with XML (code below). I've created a simple loop to build the movie clip objects and add the text to the text field in it. However, I can't figure out how to add a Listener to the movie clips for Click. If I add this in the loop:

box_mc.addEventListener(MouseEvent.CLICK, playMovie);

then every button runs the same event handler. How can I make each new button run a different event handler? Thanks for any help.
-----------------------------







Attach Code

function showXML(e:Event):void {

XML.ignoreWhitespace = true;
var website:XML = new XML(e.target.data);

numTitle = website.menu.title.length();
numTitleStartX = stage.stageWidth/2 - numTitle/2 * 100;

for (var i:Number = 0; i < numTitle; i++) {

menuTitle.push(website.menu.title[i].text());

var box_mc:box = new box();

box_mc.x = numTitleStartX + 100 * i;
box_mc.box_txt.text = menuTitle[i];

stage.addChild(box_mc);
}

Dynamic Shadow Of An Object
I doubt this is possible, but I guess I'll go ahead and ask. Is it possible to create a blurred shadow for a custom shape (it's not a square.) I have shapes that I want to have a shadow underneath. Is there a way to do this in MX 2004? Or do I have to result to importing a .png of the shadow?

Dynamic Scaling An Object
i played with dynamic scaling script, but i cant do it

how is possible to create action - e.g. on roll over scale from 100% to 150%

i want use it for my map thank you

Dynamic Object Animation
Hi,
I want to create an animation in which dynamic images are loading. there could be any number of images. And on mouse rollover there should be some effect like image size should increase.
there are two buttons left and right according to which user can view other images.
main problem is that i am not able to scroll the images properly as there could be any number of images and also size of images is different. Is there any way to keep track of this.
i want this urgently
Thanks in advance

Dynamic Object & 3D Rotation
I'm creating a sprite dynamically and want to rotate it (using rotationY[3D]) around the center of the object.

I know you cant change the registration point of an object dynamically so is this even possible? Maybe using Matrix3D?

Dynamic Shadow Of An Object
I doubt this is possible, but I guess I'll go ahead and ask. Is it possible to create a blurred shadow for a custom shape (it's not a square.) I have shapes that I want to have a shadow underneath. Is there a way to do this in MX 2004? Or do I have to result to importing a .png of the shadow?

Dynamic Scaling An Object
i played with dynamic scaling script, but i cant do it

how is possible to create action - e.g. on roll over scale from 100% to 150%

i want use it for my map thank you

[as][object]dynamic Naming
for some reason I always have problems with dynamic naming and once again I have come unstuck.

I cannot seem to be able to create a object dynamically, here is what I've got already

ActionScript Code:
gdad.BulArr.counter++;
       
        theString = gdad.BulArr.counter.toString();
        ["bullet"+theString] = new bullet()


and it keeps flailing up " Scene=Scene 1, Layer=Layer 1, Frame=1: Line 107: Left side of assignment operator must be variable or property." and its blimming bugging me c'mon peeps how can I make a dynamic name for an object

Zen

Dynamic Object Names
I saw dynamic variable naming addressed in an older post, but I was curious (more like, I need to!) to see if I could create a dynamic object name.

For example. I need to create a unique LocalConnection to other flash movies on my page.


Code:
//SET CONNECTION NAME
var conName:String;
conName = "button" + _root.ID;
//UNIQUE RECIEVER CONNECTON
this[conName]:LocalConnection = new LocalConnection();
conName.methodToExecute = function() {
_root.button.gotoAndStop(1);
};
I'm just not 100% sure how to handle the syntax between the colon and the object type.


Thanks!

Robert

Dynamic Object Referencing
Hi everyone,

i've built a accordeon like movie clip to present search form results for a web site. The results are "fed" into flash by .NET webservices and the "accordeon" itself is dynamic.

My question is i want to add a button to show further detail on each line of results, but i don't seem to be getting the button to be clickable inside the individual lines.

this is the code i use to build the "accordeon" display:


ActionScript Code:
// _y position
var y = 0;
// _depth
var d = 0;
 
for (i = 0; i < 13; i++) {
linesArray[i] = i;
d = d + 1;
y = y + 20;
// check for empty (undefined) results and stop adding lines
if (theResults.Collection[i].Referencia == undefined) {
i = numRegistos;
return;
} else {
attachMovie("acordeonLine", "line" + i, d);
// fill the line text boxes
txtRef = myresults.ref;
txtName = myresults.name;
}
// use the line it self as a button to slide open and show photos
this["line"+i].onRelease = function{
trace("HEY! YOU CLICKED ME!");
}
}


inside the each "accordeonLine" mc there's a button called btDetails i'm trying to use by adding this (or similar) code inside the for loop that adds line to the accordeon:


ActionScript Code:
this["line"+i].btDetails.onRelease = function{
trace("HEY! YOU CLICKED ME!");
}


the path this["line"+i].btDetails evaluates as undefined. its like its not even there.

i've tried other "tricks" but i simply can't get the click to work.

Any ideas?

Dynamic Object Problem?
Hiya gang...here's the scoop. I am creating a coupon application, driven by XML.

I am loading in a XML file and iterating through it, creating a new movieClip instance for each "coupon" that exists.

The only problem thus far is this:: I cannot seem to attach a unique url to EACH coupon, so that I can pop it up in its own browser window(for printing purposes).

Here is the complete code, which is placed on frame one of my movie::

Code:
stop();
init = function (myXML) {
// do xml stuff
this.coupon_xml = new XML();
this.coupon_xml.ignoreWhite = true;
// when loaded - do couponLoaded
this.coupon_xml.onLoad = this.couponLoaded;
// move a level down
this.coupon_xml.parent = this;
this.coupon_xml.load(myXML);
};
couponLoaded = function (success) {
if (success) {
// if loaded - ready the couponNodes
// makes them easier to access
// do initCoupon
this.parent.couponNode = this.firstChild;
initCoupon();
} else {
trace("loading failed");
}
};
//var ID= 4683;
var Xspacing = 0;
var Yspacing = 0;
var level = 1;
var counter = 1;
var ID;
initCoupon = function () {
for (var i = 0; i<this.couponNode.childNodes.length; i++) {
if (counter == 1) {
trace("# of Coupons = "+this.couponNode.childNodes.length+newline);
}
var iterate = i;
trace("Iteration Count = "+iterate);
// var to shorten xml paths
var subNode = this.couponNode.childNodes[iterate];
// vars for initObj to follow
this.dealerName = subNode.childNodes[0].firstChild.nodeValue;
this.topText = subNode.childNodes[1].firstChild.nodeValue;
this.midText = subNode.childNodes[2].firstChild.nodeValue;
this.bottomText = subNode.childNodes[3].firstChild.nodeValue;
this.expText = subNode.childNodes[4].firstChild.nodeValue;
this.address = subNode.childNodes[5].firstChild.nodeValue;
this.cUrl = subNode.childNodes[6].firstChild.nodeValue;
// build and position Coupons
trace("URL= "+cUrl);
trace("Counter = "+counter);
var modC = counter%2;
trace("modC = "+modC);
if (modC == 0) {
Xspacing = 165;
} else {
Xspacing = 0;
}
if (counter != 1) {
if (modC != 0) {
Yspacing += 165;
}
}
counter++;
// ------initObj for attachMovie
var initObj = {cUrl:this.cUrl, dealerName:this.dealerName, address:this.address, topText:this.topText, midText:this.midText, bottomText:this.bottomText, expText:this.expText};
var name = "couponHolder_mc"+iterate;
y = Yspacing;
x = Xspacing;
trace("X cord = "+x);
trace("Y cord = "+y);
trace("------------------------------"+(counter-1)+newline);
newCoupon = this.couponHolder_mc.attachMovie("coupon_mc", name, counter, initObj);
level++;
// -----Position and Scale the coupons accordingly
newCoupon._y = y;
newCoupon._x = x;
newCoupon._xscale = 50;
newCoupon._yscale = 50;
// --------Define onPress logic
newCoupon.onPress = function() {
trace("onPress Called! "+cUrl);
getURL("javascript:window.open('"+cUrl+"','yourPopup','width=410,height=400');void(0)");
};
}
};
trace("URL= "+cUrl);
init("http://www.mysite.com/assets/sitecoupons/xml/xmlmultiple.asp?ID=4683");




It reads in the url just fine, but it attaches the last coupons url to all of the coupons?????

And I forgot to mention that it opens up "2" windows onPress for some reason??? One is the actual window, while the other seems to just contain the javascript in the url??



Thanks guys!?

Create New Object With Dynamic Path Name
I am trying to parse a xml doct which is an unknown number of levels deep, to create an Object.

As I recursively parse each element, if it hasChildNodes, I add the element to an array, named 'elementStack'. As I create each sub-object, I need to put it in the correct place, something like:

_root.course[elementStack.join(".")] = new Section(id, title, rolloverHintText, durationMinutes);

Sadly, however, this does not work. Neither does

elementStack.join("][")

The result I'm after is either:

_root.course["m1"]["m1s2"] = new Section...
or
_root.course.m1.m1s2 = new Section...

Urm, do I need 'eval' - tried that too, to no avail.

Please help... many thanks in advance

Nik

Assign Dynamic Code To An Object?
I'm not going to go into detail about what I'm making cause it's too complicated to explain right now, but basically the effect I want to achieve is to have "templates" set in my library (exported thru linkage, obviously), so they can be called at any point by the movie.

The CATCH tho, is that I want to be able to assign code to the newly attached instances after they've been attached.

A little more detail in this being:

I have an exit button in my library (it's inside an MC exported as "exit").. I want to be able to:

_root.attachmovie("exit","exit",3);

and then assign the code to it, telling it to exit the movie.

But I ALSO want to be able to

_root.menu.attachMovie("exit","back",17);

and assign code to THAT instance, telling it only to go BACK a menu.

I hope I'm making myself clear.

IS THIS POSSIBLE?

Dynamic Tween To Reshape An Object?
hey all. im interested in understanding how to create an effect similar to the one used at this site: http://www.svizra.com/

in other words, the white rectangular backround re-sizes itself from link to link, as though it were based on some kind of dynamic tween. is this very difficult to create? any ideas on where to begin?

thanks so much.
j

Centering Dynamic Text With Object
Since the text sometimes contains 2 lines of text, how can I setup the mc containing the dynamic text to align to the center of another mc? I tried setting a variable to _y of the 1st clip and then setting _y of the dynamic text clip to equal the variable, but nothing happens.

clip1:

onClipEvent (enterFrame) {
ycenter = _y;
}

dynamic text clip:

onClipEvent (enterFrame) {
setProperty ("", _y, ../:ycenter);
}

Thanks!

Dynamic Sound Object Creation?
hello all,

I'm trying to get around a problem I've been having with the sound object. I'd like to loop through a while statment and in that loop make a new sound object with a unique name. The problem is that it is not possible to use a variable when defining an object. For example, I wanted to do the following:

i = 0;
while (i < 10){

mySound = "_root.movieClip" + i;
eval(mySound) = new Sound("locationHere");
i++;

}

This doesn't work because of the eval() statment while creating the sound object. So, how can I make a list of sound objects without hardcoding them all?

marcus

Dynamic Load Object Properties
heres what i want to do

i have an xml document of things and thing info

< thing id="1" name="thingName" >
___< thing_info name="place" value="here" / >
___< thing_info name="origin" value="there" / >
< / thing >

in flash, i have a thing object

function thing()
{
___this.id = "";
___this.name="";
___this.place="";
___this.origin="";
}

and i am trying to recurse through the xml and loading my objects properties dynamically

something like

eval("thing." + nodeName) = nodeValue;

so if i add a info thing, i add the property, but the loading is done without changing my script

what do you think?

Dynamic Object List Creator
My sample code:

carrsList = [ carr1, carr2, carr3, carr4]

function updateCarrs(){
for (x=0; x<carrsList.length; x++) {
who = carrsList[x];
who._x += 10;
}

The carrsList is a list of names of instances of movieclips. I need to create a list of about 50 of them (carr1 thru carr50). How can I create them without having to type all fifty of them. I know how to use a for-next-loop to generate a list of strings ("carr1" thru "carr50"). But I can't call the object in my updateCarrs function? Any ideas?

Dynamic Layer/object Order?
Hey all,

I did a quick search through the archives and didn't find what I was looking for, so...

I'm using Flash MX Pro 2004 (the one with no "normal mode" in the actions editor - ugh!)

I've got 7 buttons. On mouseover, each button needs to expand to cover up the other 6 buttons. This requires the buttons to change their layer order (if they are on layers) or change their order on the single layer all the buttons are on. I can do it either way.

I'm not a programmer, and I can fake this, but it will take a while to put together. I'm wondering if anyone knows some simple code, or can point me towards a tutorial that can show me how to do this.

Here's the file I'm working on: http://www.prochef.com/test/test_1.swf
Click on "recipes" and then mouse over the chocolate cake with raspberries in the bottom right corner. When it expands, I need it to cover the other buttons.

Thanks!

Dynamic Object Instance Names?
how would i go about creating dynamic instance names for objects?

here is a function i'm trying to use:

Code:
function create_myMc(my_mc_content:String, this_mc:String, this_depth:Number) {
this.createEmptyMovieClip(this_mc, this_depth);
var myLoader:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();
myLoader.addListener(myListener);
myListener.onLoadInit = function(target:MovieClip, bytesLoaded:Number, bytesTotal:Number):Void {
// add mc to array
};
myListener.onLoadProgress = function(target:MovieClip, bytesLoaded:Number, bytesTotal:Number):Void {
// update bytes loaded in array
};
myListener.onLoadComplete = function(target_mc:MovieClip, httpStatus:Number):Void {
// remove mc from array
};
myLoader.loadClip (my_mc_content, eval(this_mc));
}
only problem is i need to make myLoader and myListener into unique names for each time the function is called.
ie myLoader_1, myListener_1 and myLoader_2, myListener_2 etc etc..

any ideas?

thanks in advance

Copyright © 2005-08 www.BigResource.com, All rights reserved