Solved

chain of events AS3

Posted on 2009-07-09
1
231 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
ID: 24817699

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.
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.

809 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