PDA

View Full Version : New to AS3.0 - Quick question



midnit
May 14th, 2008, 02:08 PM
I know this is probably very basic, but I haven't had much luck with google searching and figured I'd ask here.

Why can't I reference _root anymore?

All I want to do is at the end of a tween within a movieclip, use the following code:



_root.gotoAndPlay(2);


Basically, once I'm done doing some simple animation stuff inside the movieclip on Frame1 of the MainTimeline, I just want it to go to the next frame. This was so simple with AS2.0 yet seems near impossible now. :crying:

Thanks for any help!

ahmednuaman
May 14th, 2008, 02:25 PM
It's now 'stage': http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Stage.html

Felixz
May 14th, 2008, 03:38 PM
no stage, just root, but compiler gives sometimes problems such: "Access of possible undefined..."
so u can use dunamic typecasting
Object(root).gotoAndPlay(2);
stage is a container for root which is also main timeline and DocumentClass

midnit
May 14th, 2008, 04:51 PM
no stage, just root, but compiler gives sometimes problems such: "Access of possible undefined..."

so u can use dunamic typecastingActionScript Code:

Object(root).gotoAndPlay(2);



stage is a container for root which is also main timeline and DocumentClass

You are the man, this works for me! Thank you so very much!

Why did they decide to drop _root as the simple way to get back to your MainTimeline and instead make you reference it from an object on the stage?

Felixz
May 14th, 2008, 05:01 PM
From TipOfTheDay:
http://www.kirupa.com/forum/showthread.php?p=2110830#post2110830
http://www.kirupa.com/forum/showthread.php?p=2129548#post2129548
Especially that:
http://www.kirupa.com/forum/showthread.php?p=2167721#post2167721

midnit
May 14th, 2008, 05:05 PM
From TipOfTheDay:
http://www.kirupa.com/forum/showthread.php?p=2110830#post2110830
http://www.kirupa.com/forum/showthread.php?p=2129548#post2129548
Especially that:
http://www.kirupa.com/forum/showthread.php?p=2167721#post2167721

Thank you once again for being extremely helpful! I got CS3 at my work a month or so ago, but just now starting to use AS3.0 because I'm sick of using Save As and saving as Flash8 Documents. I figured its time to stop holding on to AS2 and learn AS3, haha.

You've been very helpful getting me started with AS3, thank you very much! :party: Is there a rep system on these boards? +1 to you Felixz.:thumb2:

Felixz
May 14th, 2008, 05:21 PM
My first adventure with Flash was pitfull:
Flash5 - only little animations,
Flash8 - looking at decompiled sites and stealing parts of code,
FlashCS3 - after 1 year of AS2 I have finally decided to stop learning AS2 and fall completly in AS3
I didn't know anything, but when I needed to do something I looked into Flash's help and jumped on links when I found what I needed (or what I could use in future).
Now I should learn and finish my last school exams but I love to write my still unfinished homepage :P
Now project involves 186 Files and 30 Folders total and months of time wasted.

midnit
May 14th, 2008, 05:41 PM
My first adventure with Flash was pitfull:
Flash5 - only little animations,
Flash8 - looking at decompiled sites and stealing parts of code,
FlashCS3 - after 1 year of AS2 I have finally decided to stop learning AS2 and fall completly in AS3
I didn't know anything, but when I needed to do something I looked into Flash's help and jumped on links when I found what I needed (or what I could use in future).
Now I should learn and finish my last school exams but I love to write my still unfinished homepage :P
Now project involves 186 Files and 30 Folders total and months of time wasted.

I only toyed around with little crap w/ Flash5 and Flash MX as well, then I got a job as a graphics designer and I use flash everynow and then on projects, so I started learning Flash8 (I'd say intermediate level at best) and we just upgraded to CS3 here at my work last month.

...With AS 3.0 I feel like a complete newb in Flash again, it really sucks, but I've got a desire to learn it (and be able to help others on my team with their questions), so it's only a matter of time and helpful people like you. =)