Solved

chain of events AS3

Posted on 2009-07-09
1
228 Views
Last Modified: 2013-11-11
I have a transparent box which slides along the navigation bar to indicate where you are. When the Contact button is pressed I want the box to slide to it, which works. However the contact button also telling a movieClip to load an external swf. The navigation slider works on its own but as soon as I tell it to load the external swf the box gets stuck half way.  

How do I get the box to finish moving to the x co-ordinate and THEN load the swf?
import fl.transitions.Tween;

import fl.transitions.easing.*;

 

var boxMovieHome:Point = new Point(); 

var myTween:Boolean = false;

muttonheadContact.addEventListener(MouseEvent.CLICK, slidetoContact);

function slidetoContact(mevt:MouseEvent):void

	

{

	var myTween:Tween = new Tween(box, "x", Strong.easeOut, box.x, 379.9, .2, true );

	

	loader.gotoAndStop("contact");
 

}

Open in new window

0
Comment
Question by:melanie22
1 Comment
 
LVL 22

Accepted Solution

by:
rascalpants earned 50 total points
Comment Utility

use this...

myTween.addEventListener( TweenEvent.MOTION_FINISH, handleReset);
 
function handleReset(e:TweenEvent):void {
      loader.gotoAndStop("contact");
}

but make sure to use the right import for the TweenEvent.

import fl.transitions.TweenEvent;

rp
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

772 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now