A Flash Developer Resource Site

Results 1 to 13 of 13

Thread: resizing frame

  1. #1
    endless possibilities MadDog 555's Avatar
    Join Date
    Aug 2004
    Location
    planet earth
    Posts
    347

    resizing frame

    how do i get this effect?

    http://www.evb.com/archive/

    i want to do something similar to this on my photography website. I wanted to have a slideshow with the frame resizing for each pic. i also wanted to know how they change the color inside the frame. how do i do this?

    any help would be great!

    thanks!
    austin

    endless possibilities

  2. #2
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    here's a sample, it could be better, but i just threw it together about 2 minutes ago. just hit enter while testing movie to advance the frames
    Last edited by EQFlash; 11-15-2005 at 01:31 AM.
    If you don't think you're going to like the answer, then don't ask the question.

  3. #3
    endless possibilities MadDog 555's Avatar
    Join Date
    Aug 2004
    Location
    planet earth
    Posts
    347
    well the problem with that is that i have a frame about 10 px thick and when you resize its unproportional. can you have the inside strech and the outside stay the same no matter what size it is?

    i want is so that the border is 10 px (for example) thick no matter what size it is.

    thanks!
    austin
    Last edited by MadDog 555; 11-15-2005 at 07:13 PM.

    endless possibilities

  4. #4
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    try this one, i normally have to border set like this anyway, not the way it is in the first 1 i sent
    If you don't think you're going to like the answer, then don't ask the question.

  5. #5
    Can't Re-Member madzigian's Avatar
    Join Date
    Apr 2004
    Location
    Boston MA
    Posts
    2,662
    ok.. EQ... but now how do you resize it dynamically?.. say you're loading external swf files into the frame (which would essentially mean into a container clip)..., AND... you don't them to appear until the frame resizes to the right _width & _height for the new swf?? any ideas?...
    Please DO NOT PM me simply for individual help. Post in the public forums...that's what they are for, and they allow others to benefit as well. - Thx
    OS X 10.3.9 || Flash MX04 Pro
    | del.icio.us || furl || Helpful Source Files || Free Pixel Fonts |

  6. #6
    endless possibilities MadDog 555's Avatar
    Join Date
    Aug 2004
    Location
    planet earth
    Posts
    347
    ok i have a mc on the stage. theres a border around the inside square 10 px thick. the inside square is 300x300. i want to resize only the inside square and the outside border doesnt change. i want it so that when you click a button, it resizes.

    do you understand?

    endless possibilities

  7. #7
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    madzigian
    you could use a condition,
    where pk1 = container of the ext swf.
    Code:
    stop();
    px1 = pk1._width+10;
    py1 = pk1._height+10;
    n = 0;
    onEnterFrame = function () {
    	n++ ;
    	frm._width += (px1-frm._width)/10;
    	frm._height += (py1-frm._height)/10;
    	if (frm._width>=pk1._width && n >= 25) {
    		pk1.loadMovie("external.swf")
    	}
    };
    MadDog, i'll create another for you, where the frame and the border are 2 movieclips.
    Last edited by EQFlash; 11-16-2005 at 01:21 AM.
    If you don't think you're going to like the answer, then don't ask the question.

  8. #8
    endless possibilities MadDog 555's Avatar
    Join Date
    Aug 2004
    Location
    planet earth
    Posts
    347
    well...im using flash 8, so i could use 'scale9grid' but i dont know how to use it. ive heard about it and i know how it works though.

    i have a mc with the border included in it ad well as the inside box so if i only stretched the inside and not the border that would work. this way you wouldnt have to create multiple mc's.


    austin

    endless possibilities

  9. #9
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    if you use flash 8 why are you posting in flash mx?
    If you don't think you're going to like the answer, then don't ask the question.

  10. #10
    Can't Re-Member madzigian's Avatar
    Join Date
    Apr 2004
    Location
    Boston MA
    Posts
    2,662
    EQ.... tried the code you suggested, and nope... that doesn't work... any other ideas?....

    thanks again
    Please DO NOT PM me simply for individual help. Post in the public forums...that's what they are for, and they allow others to benefit as well. - Thx
    OS X 10.3.9 || Flash MX04 Pro
    | del.icio.us || furl || Helpful Source Files || Free Pixel Fonts |

  11. #11
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    i have a different code now since I posted this. I am tweaking it now
    If you don't think you're going to like the answer, then don't ask the question.

  12. #12
    Can't Re-Member madzigian's Avatar
    Join Date
    Apr 2004
    Location
    Boston MA
    Posts
    2,662
    i had a thought... because i ran into this problem while trying to use setMask on movies loaded into a container. Because you can't apply setMask until AFTER the movie is completely loaded, i would assume you would have to do the same thing in this case. after it's loaded you can get the width and height, and resize accordingly. I'll try it and let you know if i get it to work...
    Please DO NOT PM me simply for individual help. Post in the public forums...that's what they are for, and they allow others to benefit as well. - Thx
    OS X 10.3.9 || Flash MX04 Pro
    | del.icio.us || furl || Helpful Source Files || Free Pixel Fonts |

  13. #13
    endless possibilities MadDog 555's Avatar
    Join Date
    Aug 2004
    Location
    planet earth
    Posts
    347
    i go it. heres the code i used:

    code:

    Stage.align = "TL";
    Stage.scaleMode = "noScale";
    import flash.geom.Rectangle;
    MovieClip.prototype.changeSize = function(w,h){
    var T = this;
    T.tw.removeMovieClip();
    var tw = T.createEmptyMovieClip("tw",13579);
    var w_amount = 0;
    var h_amount = 0;
    var w_actu = T._width;
    var h_actu = T._height;
    tw.onEnterFrame = function(){
    var w_delta = w - w_actu;
    w_amount = ((w_delta/5)+w_amount)/2;
    var h_delta = h - h_actu;
    h_amount = ((h_delta/5)+h_amount)/2;
    h_actu += h_amount;
    w_actu += w_amount;
    T._width = w_actu;
    T._height = h_actu;
    if(Math.abs(w_delta)<.5 && Math.abs(h_delta)<.5 && Math.abs(w_amount)<.5 && Math.abs(h_amount)<.5){
    T._width = w;
    T._height = h;
    this.removeMovieClip();
    }
    }
    }

    var rec = new Rectangle(-150,-150,150,150);
    box.scale9Grid = rec;

    onEnterFrame = function(){
    var min = 40;
    var w = 750;
    var h = 450;
    var w_targ = Math.round(Math.max(w,min));
    var h_targ = Math.round(Math.max(h,min));
    box.changeSize(w_targ,h_targ);
    }



    thanks for your help!
    austin

    endless possibilities

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