A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: picture gallary

  1. #1
    Member
    Join Date
    Aug 2003
    Posts
    32

    picture gallary

    I did do a search on the question i am about to ask, and looks through several pages of posts, but could not find a simplified version of what i am looking for.

    I want to be able to click and hold a button so that a movie clip in the same frame moves to the left until released, and right when the right button is clicked.

  2. #2
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    To release you have to press, which is the same as being clicked. But heres some code to play with, using two buttons, to move right or left.

    //On movieclip

    onClipEvent(enterFrame){
    if(_parent.move==1){
    this._x+=3;
    }
    if(_parent.move==2){
    this._x-=3;
    }

    ..................................

    // On Right button
    on(press){
    move=1;
    }
    on(release){
    move=0;
    }

    // On Left button
    on(press){
    move=2;
    }
    on(release){
    move=0;
    }

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  3. #3
    Member
    Join Date
    Aug 2003
    Posts
    32
    Hmmm, I inserted the code, but its not doing anything so far, when clicked nothing happens.

  4. #4
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    One of those things, there was a } missing. Should be...

    //On movieclip
    onClipEvent (enterFrame) {
    if (_parent.move == 1) {
    this._x += 3;
    }
    if (_parent.move == 2) {
    this._x -= 3;
    }
    }

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

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