A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: I want this code made in cs2 to cs3

  1. #1
    Junior Member
    Join Date
    Jan 2010
    Posts
    17

    Smile I want this code made in cs2 to cs3

    Hello

    this code works fine in cs2, over an symbol movieclip, in ac2 I type:

    Code:
    onClipEvent(enterFrame){
    this._rotation++;
    }
    and the symbol rotates well.

    I'll try in as3, I type next code, compile fine, but it doesn't rotate

    Code:
    // this code doesn't do anything
    
    addEventListener(Event.ENTER_FRAME, myHour);
    
    function myHour(e:Event):void {
    	this._rotation++;
    }

  2. #2
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    _rotation needs to be rotation (no underscore).

    Where are you putting that code? If it's in the main timeline, then it is attempting to rotate the whole swf, which of course will not work. If that's the case, the easiest way is probably to simply specify the item you're trying to rotate in the function.

    Code:
    someClip.addEventListener(Event.ENTER_FRAME, myHour);
    function myHour(e:Event):void{
      someClip.rotation++;
    }

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