Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Tween to another frame?

New Here ,
Jun 18, 2013 Jun 18, 2013

Ok, I ran into a problem with tweening from one frame to another. It is hard to explain, but I'm gonna try . I have a class Main.as. In it I put my stuff on the Stage via addChild() method. Now I want to have another empty Stage at frame 25 where I can put different things on it. And I would like to tween from frame 1 to 25. Is that possible? I have read the class definition for Tween and it always needs an object to tween. Do I have to wrap everything on frame 1 into a sprite and on fram 25 into another sprite?

I hope someone understands my explanation

Thanks

TOPICS
ActionScript
825
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jun 18, 2013 Jun 18, 2013

add a parent movieclip to the stage in Main and add everything else to that parent (using addChild, for example).  then when you're ready to display the next page, you can fade-out that parent.  at the end of the fade remove the parent and null it (if it's never needed again).

you create another parent for your page 2 display, assign its alpha to zero, add the page 2 assets to that parent and fade it in while the page 1 parent is fading out.  that will give you a cross fade.

Translate
Community Expert ,
Jun 18, 2013 Jun 18, 2013

you should rethink your setup.

if you want to tween objects created in Main into something else either add objects that have a timeline tween or tween the objects with actionscript.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 18, 2013 Jun 18, 2013

Ok, so does meaning tween with actionscript, that I have to tween every object I have created in frame 1? The objects I did add to the Stage are MovieClip Symbols. Ok, some further explanation, maybe it helps to understand . Imagine the SWF is a book, frame 1 = page 1 and so on, so on each frame/page is different content, and all I want to do is to have a smooth transition from frame/page 1 to frame/page 2 or frame/page 4. If that is possible, then my next question is, do I still have access to the content on other frames/pages from within the Main.as and how do I add content to for example frame/page2, I thought there is only one Stage object or is the Stage object from frame 1 another than from fram 2?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 18, 2013 Jun 18, 2013

what do you envision as a "smooth transition from page 1 to page 2?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 18, 2013 Jun 18, 2013

Something like a fade-out and fade-in or a cross-fade . I dont know, if I get performance issues if I add 4 Sprites as containers for the pages to the stage and then add my objects to the Sprites and then tween the Sprites depending on what I want to display on the Stage.

Something what is also in my mind is, there is Actions-Frame and there is Class definition, what is the difference between those? Because I can only have one class assigned, but I can have for each frame different actions? In Objective-C I used a class to either create instances of that class or to have a reference to it.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 18, 2013 Jun 18, 2013

add a parent movieclip to the stage in Main and add everything else to that parent (using addChild, for example).  then when you're ready to display the next page, you can fade-out that parent.  at the end of the fade remove the parent and null it (if it's never needed again).

you create another parent for your page 2 display, assign its alpha to zero, add the page 2 assets to that parent and fade it in while the page 1 parent is fading out.  that will give you a cross fade.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 19, 2013 Jun 19, 2013

Yes, thats what I was thinking about, use some containers to hold my objects, thanks for your help

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 19, 2013 Jun 19, 2013
LATEST

you're welcome.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines