Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

tween hierarchy as3

Posted on 2009-07-02
3
Medium Priority
?
450 Views
Last Modified: 2013-11-11
I am using MOTION STOP  listener on a tweened movieclip, well sprite actually,

when I call it from the first function, it fires fine, then when I call it from that function I get an error - I was wondering if there is a hierarchy, or stack of tweens that will stop the next one working??

Please not the as3 tweening issue again - I'm using Tweenlite in a different part of the program but can't use it here??

Don't ask!

Nick
function play_tg_btnClick(e:MouseEvent):void{
						var sceneAlpha:Tween = new Tween(start_bgg, "alpha", Strong.easeIn, 1, 0, 50, false);
						var tg_Alpha:Tween = new Tween(play_tg_btn, "alpha", Strong.easeOut, 1, 0, 250, false);
						var txt_Alpha:Tween = new Tween(play_text_btn, "alpha", Strong.easeOut, 1, 0, 250, false);
							tg_Alpha.addEventListener(TweenEvent.MOTION_FINISH, initDirection);
						}
		
		}
		//DIRECTION////////////////////////////////////
		private function initDirection(TweenEvent:Event):void {
			addChild(sc_2_mc);
			
					sc_2_mc.addChild(newDir);
					newDir.x = 138;
					newDir.y = 138;
							switch(myloadXml.my_direction){
										case "e":
										direction_x = 215;
										direction_y = 174;
										break;
										case "ne":
										direction_x = 205;
										direction_y = 154;
										break;
										case "se":
										direction_x = 215;
										direction_y = 184;
										break;
										//DO THIS B4 PUBLISH////////////////////////////////////////////////////////////////////////
									}
										dirText.embedFonts = true;
										dirText.x = direction_x;
										dirText.y = direction_y;
										
										var myFormat = new TextFormat();
											myFormat.size=32;
											myFormat.font = dirFont.fontName;
											myFormat.color=0xFFFFFF;
									dirText.text = myloadXml.my_direction;
									dirText.setTextFormat(myFormat);
									sc_2_mc.addChild(dirText);
									var sc_2_Tween:Tween = new Tween(sc_2_mc, "alpha", Strong.easeOut, 0, 1, 150, false);
										sc_2_Tween.addEventListener(TweenEvent.MOTION_FINISH, directionFade);
										function directionFade(TweenEvent:Event):void{
										trace('@');
										}
									    
		}

Open in new window

0
Comment
Question by:nimuse
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 1

Author Comment

by:nimuse
ID: 24764909
well,

here I am answering my own question!

I solved it by not having a 'chain' of tweenEvent handlers - always having one function with no events passed calling the function with the tween - maybe its good practice to do this????????

working Ok now - I think I really want to get into tweenLite properly though - that looks much better!!
0
 
LVL 22

Accepted Solution

by:
rascalpants earned 2000 total points
ID: 24789111
yes, I would highly recommend TweenMax or TweenLite...

the technology uses much better memory leak prevention than the normal Tween class in AS 3.

rp
0
 
LVL 22

Assisted Solution

by:rascalpants
rascalpants earned 2000 total points
ID: 24818252
bump
0

Featured Post

Looking for a new Web Host?

Lunarpages' assortment of hosting products and solutions ensure a perfect fit for anyone looking to get their vision or products to market. Our award winning customer support and 30-day money back guarantee show the pride we take in being the industry's premier MSP.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question