A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Create a sliding viewer

  1. #1
    Member
    Join Date
    Jul 2007
    Posts
    91

    Create a sliding viewer

    Hi,

    Here:
    http://www.flash-creations.com/notes...dingviewer.php
    I found good tutorial about create a sliding vievier, but i have some problem with this part of code:

    Code:
    // constants
    var MAXPIXELS:Number = 12;          // max number of pixels to move slider per frame
    
    // function to move thumbnail slider ("this" = thumbs_mc)
    
    function sliderControl() {
       var w:Number = this._width/2;
       var hw:Number = mask_mc._width/2;
       var npixels:Number;
       // only do when mouse over slider mask
       if (_ymouse > mask_mc._y && _ymouse < mask_mc._y + mask_mc._height) {
          // mouse over left half of slider:
          if (_xmouse > mask_mc._x && _xmouse < mask_mc._x + hw) {
             npixels = (hw - _xmouse) / hw * MAXPIXELS;
             this._x += npixels;
             if (this._x >= 0) this._x = this._x - w;
          // mouse over right half of slider:
          } else if (_xmouse > mask_mc._x + hw && _xmouse < mask_mc._x + mask_mc._width) {
             npixels = (_xmouse - hw) / hw * MAXPIXELS;
             this._x -= npixels;
             if (this._x <= -w) this._x = this._x + w;
          }
       }
    }
    How i can create a sliding viewer on 3dfa? Maybe someone know how to fix it?

  2. #2
    Senior Member kusco's Avatar
    Join Date
    Nov 2001
    Posts
    681
    Some users have created sliding viewers using layers, masks, and scrolling clones.

    However, 3DFA is now primarily an Actionscript 3 tool.

    Although it can run some AS2 samples, you really need to find a sliding viewer sample written in AS3 - for export to Flash 9.
    Cheers,
    kusco
    (3DFA Support Team)

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