Copy link to clipboard
Copied
In actionscript 2 if you wanted items on the stage to not appear to the user you would just use the onclipevent(load) and then move them, alpha them and so on. In as 3 I cannot figure out how to get the items off of the stage before the stage renders them. There's always a flash of the stage items and then they disappear. What should I use? I don't like the addChild method because it's impossible to design a site that way. I like all my items on the stage and then go from there...
Thanks!
Copy link to clipboard
Copied
i'm not sure what the problem is with addChild() but you can use the render event to detect when a displayobject is about to be rendered. (use stage.invalidate() to force flash to dispatch the render event.)
Copy link to clipboard
Copied
I can't use add child because I can never figure out to work to movieclips and from movieclips to the main timeline while using addchild. I'm a self taught as 2.0 guy and no one can ever explain to me how to get my movie clip at page_1/video_clip to interact with functions I have on the main timeline. I use the MovieClip(root) and everything in AS 3 is making sense.
I don't know what to do with stage.invalidate()? Where does it go? What event listeners do I use as a result? Then what do I do?
Copy link to clipboard
Copied
do whatever you want before they're rendered. from you original message it looks like you want to remove them.
so you would use something like:
stage.invalidate();
do1.addEventListner(Event.RENDER,removeF);
function removeF(e:Event){
DisplayObjectContainer(DisplayObject(e.currentTarget).parent).removeChild(DisplayObject(e.currentTarget));
}
though, with knowledge of your particular situation you probably don't need to do all that casting.
Copy link to clipboard
Copied
Do you see it flash on the stage if you use something like this:
myMC.visible = false;
var i =new Loader();
i.load(new URLRequest("http://news.google.com/images/news.gif"));
myMC.addChild(i)
Copy link to clipboard
Copied
no. (oops, sorry - that question wasn't directed to me.)
Copy link to clipboard
Copied
of course not, but as I mentioned I haven't had much luck with addChild yet. I'm giving it another try with this document, I'll post an update later...
Copy link to clipboard
Copied
C-Rock,
Never heard back. Did you get this figured out?
Find more inspiration, events, and resources on the new Adobe Community
Explore Now