Animation using Actionscript

  • damonlee
  • Born
  • Born
  • damonlee
  • Posts: 2

Post 3+ Months Ago

Hello,

For some time now, I've been wanting most if not all my animations to be controlled via a script. I have a code in frame one of my movie that calls the new mx transition class.

I can only get the code to execute when i drag the frame that contains the code to the same frame that the movie clip is on (even then it doesn't execute properly). The code and the movie clip are on seperate layers.

here is my code:

function portSeg1Anim(){

new mx.transitions.Tween(_root.portSeg1, "_y", mx.transitions.easing.Strong.easeOut, 200, 174, 1, true);

}

_root.portSeg1.onEnterFrame = function() {
portSeg1Anim();
trace("entered frame")
}

Again, I would like the code in frame 1. Any help would be appreicated
Thanks -D
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

dieam, that's nasty.
why u use onEnterFrame if you use a transition class which already has implemented an onEnterFrame?
remove the onEnterFrame and just call the animation one time.
  • damonlee
  • Born
  • Born
  • damonlee
  • Posts: 2

Post 3+ Months Ago

i've tried just placing the function call in frame one, but when the movie gets to frame 27, the mc just appears and doesnt move.

the "onEnterFrame" was just an experiement, yes calling the function will work, but like I said, it only works when its called in the same frame as the mc.

I've tried using something like

if (_root._currentframe==27){
portSeg1Anim();
}

The key is to get the function to trigger on frame 27 while keeping all the script in frame 1
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

i don't know what u really trying to do. You can't use a movieclip from the stage in frames that it doesn't exists. If you want to use an mc in any frame, then either attachMovie, or createEmptyMovieClip.

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 8 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.