?
Solved

ActionScript Newbie

Posted on 2005-03-30
3
Medium Priority
?
329 Views
Last Modified: 2009-07-29
I am trying to move a movie clip
from:centre of the stage at 20% scale and alpha=0
to: the top of the stage at 100%scale and alpha = 100

simple enough but my actionscript isn't doing what I want.

My question is: How do I stop the clip once it has reached the top of the stage and has reached 100% scale size?

Here is my script:
onClipEvent (load){
      scaleAmt = 20;
      scaleAmt <=100;
      this._alpha = 0
      x = 69; //starting point x
      y = 206;//starting point y
}
onClipEvent (enterFrame){
      scaleAmt ++;
      this._alpha +=20;
      this._x = 69; // x value must not change as clip must move upwards in a straight line
      this._y -= 5;
      this._xscale = scaleAmt;
      this._yscale = scaleAmt;
}
      
0
Comment
Question by:KevPerkins
[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
  • 2
3 Comments
 
LVL 18

Accepted Solution

by:
Billystyx earned 1000 total points
ID: 13666543
onClipEvent (enterFrame){
if(scaleAmt<100){  
scaleAmt ++;
this._xscale = scaleAmt;
     this._yscale = scaleAmt;
}
if(this._alpha<100){ this._alpha +=20;}
     this._x = 69; // x value must not change as clip must move upwards in a straight line
if(this._y>0){     this._y -= 5;}
     
}

Billystyx
0
 

Author Comment

by:KevPerkins
ID: 13669088
Thanks. That works.
Played aound last night and actually fixed it but took many more lines of code than this .... so thanks - newbie nightmares I guess.
0
 
LVL 18

Expert Comment

by:Billystyx
ID: 13669108
no worries - glad to help:)
0

Featured Post

Technology Partners: 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

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
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 use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

771 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