FORUMS: list search recent posts

MC, drag, and change frame. (AS 2.0)

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Jenn Sager
MC, drag, and change frame. (AS 2.0)
on Jan 13, 2010 at 10:14:17 pm

I'm trying to create an arcade game stick that, when has a certain width, changes a nestled movie clip frame.

Here is what I have (NOTE, the movie clip "stick" is being dragged on a rotation)

stop ();

var dragging:Boolean = false;

stick.onEnterFrame = function() {
if (dragging) {
var dw:Number = _xmouse - stick._width;
var dh:Number = _xmouse - stick._height;
var dx:Number = _xmouse - stick._x;
var dy:Number = _ymouse - stick._y;
var angle:Number = Math.atan2(dy, dx) * 180;
stick._rotation = (angle / Math.PI) + 90;
if (stick._width = 170.5){
this.destiation_all.one.gotoAndPlay(2);}
trace(this._width);
}
}


stick.onRelease = function() {
if (dragging) dragging = false;
else dragging = true;
}


the "this.destiation_all.one" is the nestled MC that I want to change frames when the width of the "stick" movie clip reaches 170.5

Thanks!


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]