Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

chain of events AS3

Posted on 2009-07-09
1
Medium Priority
?
243 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 200 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
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 how to record live broadcast.
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

824 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