dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Scripting help with Images...

  1. #1
    Senior Member MSMDesignZ's Avatar
    Join Date
    Aug 2001
    Location
    NY
    Posts
    219

    Scripting help with Images...

    Can someone direct me on how I can duplicate a similar effect with the background images moving when a menu button is pressed?

    Please view this url for the example...thanks alot!

    http://www.studio4nineteen.com/

  2. #2
    Senior Member MSMDesignZ's Avatar
    Join Date
    Aug 2001
    Location
    NY
    Posts
    219
    anyone?

  3. #3
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    Its fairly easy.
    Make a movieclip with all your images. Put this code ON it.

    onClipEvent (enterFrame) {
    // MOVING SCIPT PART
    var speed = 7;
    var viscosity = 1.5;
    xpos=_root.xpos;
    //X Pos
    difference = xpos-this._x;
    xvelocity = (xvelocity+(difference)/speed)/viscosity;
    this._x += xvelocity;
    }

    Then on your buttons you just set different positions where the moviclip will scroll to (xpos).

    on(release){
    xpos=350;
    }

    ....for instance.

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

  4. #4
    Senior Member MSMDesignZ's Avatar
    Join Date
    Aug 2001
    Location
    NY
    Posts
    219
    thanks alot! I will try that this weekend...I'm sure I'll have another question!

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