How can I use a variable in the path? (I know this is not called the path but I can't think of what it's called). For instance: instead of: this.symbol1.symbol2._height = 800; I want var my_var = "this.symbol1.symbol2"; my_var._height = 800;
var my_var:MovieClip = this.symbol1.symbol2;
What if I need to define a variable in the path also? Such as: var my_var:MovieClip = "this.symbol1.symbol2" + my_other_var;
var my_var:MovieClip = this.symbol1.symbol2[my_other_var]
Yes I am trying to create a dynamic path to multiple movieclips. I have 120 ..swf files that are dynamicly loaded and I need to be able to print the one that is currently on the screen. I have a variable that keeps track of what clip is visible for other functions in the movie. This variable coresponds to the number used in the instance name. For instance when clip 7 is visible the variable is equal to 07 and the instance name for the clip is "s07". I want one button that will always print the top clip. I have all the code in place, the only thing that I'm hung up on is setting with size of the clip to be printed. I know the error is in var pageL:MovieClip = (_level0.pages.p1.page.pf.ph.pic.s)+nextpage; on (release) { var pageL:MovieClip = (_level0.pages.p1.page.pf.ph.pic.s)+nextpage; var mag:PrintJob = new PrintJob(); var success = mag.start(); if (success) { pageL._height = mag.pageHeight; pageL._width = mag.pageWidth; mag.addPage(pageL, {xMin:0, xMax:mag.pageWidth, yMin:0, yMax:mag.pageHeight}); mag.send(); } }
<blockquote>quote:<br><hr><i>Originally posted by: <b><b>NSurveyor</b></b></i> var my_var:MovieClip = this.symbol1.symbol2[my_other_var] my_var._height=800<hr></blockquote> When I do this and trace my_var I get undefined.
var pageL:MovieClip = (_level0.pages.p1.page.pf.ph.pic[s+"nextpage"]);
We used to use the "eval()" function in good old times, nowadays we are encurage to use the "Array Access Operator" (scary isn't it ?): var myClipName:String = "superClip_mc"; _level0[myClipName]._height = superHigh; ;-)
Don't see what you're looking for? Try a search.
|