AS3.0 simple question
- Started
- Last post
- 9 Responses
- Elfangio
I know, another stupid question from a art director that should give the coding work to the coders :) , help the poor guy please...
I want to do a simple thing that I was doing all the time in AS 2.0 that is talking with my main timeline from a loaded movie
_parent.movieClip._visible = false; for example
how can I do something similar in AS 3.0?
thanks
- Punkedbr0
try the same code without the underscore
parent.movieClip.visible = false;
- CyBrain0
However, a lot of things that should work in AS3 don't always. My biggest problem with the language is that it's so difficult to target things that should be movie clips only to have a compiler error tell me it's only a display object. There are many techniques/workarounds like containers, arrays and casting, but none are rock solid.
- CyBrain0
I feel your pain. Why don't you post your code on pastebin.com? That way we can see your code and give you a better answer. If you post code here it becomes truncated.
- skelly_b0
You don't need to type cast this because visible is a property of DisplayObject. My guess is your target the Loader object, not the MC you're trying to affect.
maybe parent.parent.mc.visible?
- joyride0
could be a couple things, most likely it's pathing to what you're trying to control. Before trying to change it, i.e. visibility, just try to get to it using trace();
Trace getting to the Loaded swf, when you know that name, then try tracing the mc inside. Once you have that, you should be good.
You might be trying to do something before it's on the stage, hence the undefined method... Good luck
- ornj0
Half assing OOP will lead to that compiler error. Do it right and save yourself some time.
- And don't write AS3 like you are writing AS3 or you are fucked from the get go.ornj
- *AS2 like you are writing AS3... but you knew what i meant.ornj
- I was wondering when the typical QBN responded would kick in...ArmandoEstrada
- dijitaq0
you need to refer to the class of the parent movieclip you are calling. i think, that's how it's suppose to be...
i think it's something like var mc:MovieClip = getMovieClipByName(parent.name); // assuming it's directly its child
mc.visible = false;