Flash help
- Started
- Last post
- 17 Responses
- OBBTKN
Hi guys... is there a Flash guru over there?
I´m madly trying to call a object using _root.roll , in AS2, tried all the combinations... but i´m doing something wrong
If anybody can help me on this, i can send him the fla file
ta.
- mightyj0
use _parent to path up each mc. If roll is two level up from wher you are calling it then use _parent._parent.roll.gotoAndPlay... or what have you. Also make sure "roll" has an instance name on every keyframe of the timeline it's on.
- OBBTKN0
thanks... but not helped, there is something weird still
- OBBTKN0
i was going to paste the code here... but i think it´s not going to be shown properly
- fyoucher10
This is not recommended but you can just use _global. Just make a reference to that movieclip with it first. Put this action on whatever timeline roll is on (assuming roll is a movieclip with an instance name of "roll"): _global.roll_mc = roll;
Then whenever you need to target roll just use _global.roll_mc.goToAnd... Whatever...
Again it's bad practice but it'll work
- fugged0
_rick.roll
- OBBTKN0
I will explain it better, the thing is a accordion menu system and you´re able to call anyone of the panels used on it to structure the content... into the MC using something like this _root.roll = panel1; But, i´m trying to call this panels from other buttons and using code in the stage, and it´s not working.
Here is the link to the original file on ActiveDen i´m customizing:
http://activeden.net/item/accord…And here the code used in the panels:
http://pastebin.com/qRsi7G6j
- funkage0
May I know what kind of error are you experiencing?
- OBBTKN0
i´m trying to call to an especific panel, using "_root.roll = panel1;" (i´m using this code coz i did´nt know another way to do) and it loads a panel, but not the panel i called
- funkage0
Just mail me the FLA. I'll do what I can.
- fyoucher10
It's b/c your function is looking for a String parameter. The condition in the function is asking if _root.roll is equal to object._name which is a string. Instead of _root.roll = panel1 use a string instead, _root.roll = "panel1" ...or "panel2" whatever. Just make sure you use quotes. Or better yet take out _name in the conditional and just reference the movie clip without the quotes...
- fyoucher10
Also FYI there are two conditionals in that function that ask for _name. I'd take _name out and just reference the movie clip...
- fyoucher10
And this is why you should datatype the function parameter and return value!
function menuScript ( object:Movieclip ):Void { ...