A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: Script Possible?

  1. #1
    Member
    Join Date
    Nov 2001
    Posts
    61
    I actually think it is possible but i'm just wondering how to do it. Basically what i'm looking at is a page of pictures on the net, and instead of making thumbnails, i want to make it so when you roll your mouse over the pics, they enlarge to the full size, overlapping everything else on the page, and then reduce to normal size when you roll your mouse off the picture. Help would be appreciated, thanks in advance.

    Jason

  2. #2
    Junior Member
    Join Date
    Aug 2002
    Posts
    11
    load the pictures to a movieclip and then call a function on roll over event. create the function on the main timeline to resize the movieclip

  3. #3
    Member
    Join Date
    Nov 2001
    Posts
    61

    great!

    Thanks man, think you could explain the function script, i'm new to flash MX and havn't flashed in about 6 months, would help to clear some stuff up for me like everything lol

    thanks

    jason

  4. #4
    Junior Member
    Join Date
    Aug 2002
    Posts
    11
    imagemovieclipname.useHandCursor=true;
    imagemovieclipname.onRollOver=function(){
    this._xscale=200;
    this._yscale=200;
    };

  5. #5
    Member
    Join Date
    Nov 2001
    Posts
    61

    Thanks

    you tha man

  6. #6
    Member
    Join Date
    Nov 2001
    Posts
    61

    Troubles with the script

    Couple things that i want to happen that isn't happening. When the picture is enlarged, is it possible to gradually get bigger? And also, i want the picture being enlarged to overlap any other pictures in it's vicinity. At the moment only the picture on the top layer is overlapping and the others are being enlarged behind them. One last question, what's the function script to make them return to normal size? :S

    Thanks again

    Jason

  7. #7
    The Insane bfly03's Avatar
    Join Date
    May 2001
    Posts
    692
    create a motion tween to enlarge the picture. save it as its own swf and when rollover call that swf.

  8. #8
    Member
    Join Date
    Nov 2001
    Posts
    61

    Wanted to avoid that

    That's what i was trying to avoid, i know there is an actionscript code for it but i can't remember what it was.

    Thanks

    Jason

  9. #9
    DigitalTart nurden's Avatar
    Join Date
    Apr 2001
    Posts
    159
    //size of picture
    size = 225;

    //function which will swap to highest depth level and scale the image
    function p1(){

    currentx = this._x;
    currenty = this._y;
    this.swapDepths(1,p1);
    this._xscale += size;
    this._yscale += size;
    this._x = 250;
    this._y = 250;
    this.onRollOut = reset;
    };
    //this function will reset to the positon of picture& size before mouseover
    function reset () {
    this._yscale -= size;
    this._xscale -= size;
    this._x = currentx;
    this._y = currenty;
    };

    pic1.onRollOver = p1;
    pic2.onRollOver = p1;
    pic3.onRollOver = p1;
    pic4.onRollOver = p1;


    add this to frame 1 and put you pictures on any layer, make sure the picture instance name corresponds to one of the rollovers add as many as you like!!

    theres probably some more effective code but this only took about 5 mins!!

  10. #10
    Member
    Join Date
    Nov 2001
    Posts
    61

    This is great, i'll test it right away

    Hmm i tried it and a couple questions, just to clear up where i insert the instance names, i created a test .fla with 3 movie clips, red green and blue, they are rectangles placed close together and hopefully will overlap if the code works properly. Where do i insert the instance name for, persay the one named "red". Would i replace "this" with red, or "pic1" with red? thanks again.

    Jason
    [Edited by jason_mosberian on 08-29-2002 at 05:45 PM]

  11. #11
    DigitalTart nurden's Avatar
    Join Date
    Apr 2001
    Posts
    159
    hi,

    click the movieclip and in the properties toolbar you will see a box that says instance name... give this the name you need it to be

    as per my example my pictures were called
    pic1
    pic2
    pic3

    hope it helps,

    oh yeh and put the actions in there own layer

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