Solved

chain of events AS3

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
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…
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 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.

730 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