Solved

chain of events AS3

Posted on 2009-07-09
1
230 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

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,…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
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.

831 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