A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [MX04] scrolling thumbnail panel

  1. #1
    Junior Member
    Join Date
    Feb 2007
    Posts
    6

    [MX04] scrolling thumbnail panel

    I'm designing a flash app, which will enable the user to place items of clothing on a model, the items of clothing are movie clips, I have contained these movie clips in a scrolling thumbnail panel, I have used the exact same scrolling panel as in the tutorial on this site gotoandlearn . I would just like to know what scripting would I use to get my clothing items (movie clips) within the scrolling panel when clicked on to be placed on my model, and how would I reset that action once done? so the items of clothing can be taken off. Here is the scripting I have used for the scrolling thumbnail panel.

    panel.onRollOver = panelOver;

    function panelOver() {
    this.onEnterFrame = scrollPanel;
    delete this.onRollOver;
    }

    var b = stroke.getBounds(_root);

    function scrollPanel() {
    if(_xmouse<b.xMin || _xmouse>b.xMax || _ymouse<b.yMin || _ymouse>b.yMax) {
    this.onRollOver = panelOver;
    delete this.onEnterFrame;
    }

    if(panel._x >= 89) {
    panel._x = 89;
    }

    if(panel._x <= -751) {
    panel._x = -751;
    }

    var xdist = _xmouse - 250;

    panel._x += Math.round(-xdist / 7);
    }

  2. #2
    Senior Member
    Join Date
    Oct 2003
    Location
    NYC
    Posts
    107
    There's a couple of ways off the top of my head that you can do this, assuming your model mc stays the same.

    One way is to attach a linkage to each clothing item mc in the library, when you need to put the clothing item onto the model, set the clothing item in your scrolling panel to _visibility = false, and then use attachMovie to attach the same clothing item from the library onto the model. To undo the action just set the clothing item in your scrolling panel to _visibility = true and use removeMovieClip() to take off the clothing item. Of course, you will need to know the x and y of where the clothing items need to go on the model.

    The other way is to store the x and y coordinates of where the clothing items are in your scrolling panel as origx and origy then store them into an array; then the x and y of where they go on the model into a second array. So when you need to put the clothing item onto the model, just get the x and y to coordinates where your clothing item should go from the second array. To take it off just set the x and y back to origx and origy.

    Let me know if this is too confusing.

  3. #3
    Junior Member
    Join Date
    Feb 2007
    Posts
    6
    Hi Finksmart, i'm pretty new to actionscript so I find this all abit mind boggling at the moment!, is it possible I could email you the fla file of the scrolling panel? I have contained a leather jacket in it which will be placed on the model, I just need to know the scripting so I could get the jacket anywhere on the stage I wanted too when I click on its thumbnail.

    Also I would like to be able to reset its action, so the user can take it back of the model.

    my email is: fjwarnock@yahoo.co.uk

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