A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [CS3] Changing frames with hit tests.

  1. #1
    Junior Member
    Join Date
    Feb 2008
    Posts
    29

    [CS3] Changing frames with hit tests.

    How what is the AS2 code I need to do this?

    I've tried the following:

    onClipEvent(enterFrame){
    if(this.hitTest(_root.otherObject)){
    gotoAndStop(2); //Yes I know using the frame numbers is bad.
    }
    }

  2. #2
    Has Returned
    Join Date
    Mar 2001
    Posts
    269
    PHP Code:
    onClipEvent (enterFrame) {
        if (
    this.hitTest(_root.otherObject)) {
            
    _root.gotoAndStop(2);//Yes I know using the frame numbers is bad.
        
    }
        
    this.onPress = function(){
            
    this.startDrag()
        }
            
    this.onRelease = function(){
            
    stopDrag()
        }

    you forgot to use _root.gotoAndStop(2). The code is trying to go to frame 2 within the movieclip.

  3. #3
    Junior Member
    Join Date
    Feb 2008
    Posts
    29
    Ok, thanks.

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