A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Action script help.

  1. #1
    Member
    Join Date
    Aug 2005
    Location
    Canada, Ontario.
    Posts
    42

    Action script help.

    Oops i figured out my problem lol.
    final code:

    Code:
    onClipEvent (press) {
       this.gotoandplay(3){
         }
          this.startdrag(false, 0, 0, stage.width, stage.height);
    }
    onClipEvent (releaseoutside) {
       this.stopdrag();
    }
    onClipEvent (release) {
       this.stopdrag();
    }
       onClipEvent (release) {
       this.gotoandstop(1)
       }
    }
    Last edited by -Mystikal; 09-17-2005 at 10:09 PM.
    There are 10 types of people in this world.
    People who understand binary, and those
    who dont.

    ---------------------------------------------
    Give a noob a fish, feed him for a day.
    Teach a noob to fish, he starves to death.

  2. #2
    Always needs help marinebro0306's Avatar
    Join Date
    Jul 2005
    Location
    Philadelphia
    Posts
    166
    For startDrag, you don't have to do false, 0, 0, and all that stuff. All you need is
    code:

    on(press){
    this.startDrag()}
    on(release){
    this.stopDrag()}


    I don't remember if you need the () though.

  3. #3
    Always needs help marinebro0306's Avatar
    Join Date
    Jul 2005
    Location
    Philadelphia
    Posts
    166
    Also, here's an easier version of the code. Remember, get into the habit of using correct syntax.
    code:

    on(press){
    //Give the frame a name
    this.gotoAndPlay(frame3);
    this.startDrag();
    }
    on(releaseOutside) {
    this.stopDrag();
    }
    on(release) {
    this.stopDrag();
    }
    on(release) {
    this.gotoAndStop(frame1)
    }


  4. #4
    Some dude, says hi Ultra Pulse's Avatar
    Join Date
    Jun 2005
    Posts
    262
    Quote Originally Posted by marinebro0306
    For startDrag, you don't have to do false, 0, 0, and all that stuff. All you need is
    code:

    on(press){
    this.startDrag()}
    on(release){
    this.stopDrag()}


    I don't remember if you need the () though.
    You have to, I spent 30 minutes once with that code trying to see what's wrong, and that was the problem....

  5. #5

  6. #6
    Some dude, says hi Ultra Pulse's Avatar
    Join Date
    Jun 2005
    Posts
    262
    Quote Originally Posted by marinebro0306
    works fine for me
    must have stated that wrong, Your code is fine, When I did the code by myself, i forgot the (); and it didn't work...........................

  7. #7

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