A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Script exported for flash 6 doesnt work if exported to 8

Threaded View

  1. #5
    :
    Join Date
    Dec 2002
    Posts
    3,518
    The reason they still remain is that the swapDepths function makes the depths a positive number. So they need to be removed with the 'removeMovieClip' function.
    Code:
    onClipEvent (load) {
    	hx = 390 / 2;
    	hy = 325 / 2;
    	r = 100;
    	a = 30;
    	r2 = 50;
    	p = 0;
    	speedX = 0;
    	function speed(num) {
    		speedX = -(_root._xmouse - hx) / num;
    		return speedX;
    	}
    	function trans() {
    		p += speed(100);
    		range = ((p + 180) * Math.PI) / 180;
    		re1 = ((Math.sin(range)) * r);
    		re2 = ((Math.cos(range)) * a);
    		re3 = ((Math.cos(range)) * r2);
    	}
    	function props() {
    		trans();
    		_x = hx + re1;
    		_y = hy + re3;
    		_xscale = _yscale = _alpha = re2 + 70;
    		this.swapDepths(_alpha);
    	}
    	this.onPress = function() {
    		trace(this)
    		this._parent.gotoAndStop(5);
    		//replace 'instance1', 'instance2' etc with actual instance names of clips
    		this._parent.instance1.removeMovieClip();
    		this._parent.instance3.removeMovieClip();
    		this._parent.instance4.removeMovieClip();
    		this.removeMovieClip();
    	};
    }
    onClipEvent (enterFrame) {
    	props();
    }
    Last edited by dawsonk; 10-01-2008 at 01:52 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center