A Flash Developer Resource Site

Page 2 of 3 FirstFirst 123 LastLast
Results 21 to 40 of 51

Thread: Thumbnail's got form DB?

  1. #21
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    No, AFTER it has begun to load ( as you cant change the size of a empty movieclip ). A few frames after the loading code you can put the resize code I believe or use a preloader that tells you when the image is loaded and resize it them.

    To load a random image they have to be named sequentially ( easiest way ). image1 image2 and so on.

    // Random image from 40 possible
    ran= math.round(math.random()*40+1);
    container.loadMovie("image"+ran+".jpg");

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

  2. #22
    Senior Member
    Join Date
    Feb 2002
    Location
    Geneva, CH, Europe
    Posts
    521
    Hi,
    thanks Pellepiano you are a genius.
    Well, as I don't want to make too many frames on the main timeline, I typed this code inside the PicHolder movieclip:
    firts frame of mc:
    code:

    this.loadMovie("image.jpg");
    gotoAndPlay(2);


    Second frame, this code:
    code:

    this._width = 100;
    this._width = 100;
    stop();



    The jpg loads, but of course doesn't resize. I thought you can't resize thru AS like that, so I put just the resizing thing, and it worked.. What's the problem? Is there a way to do this thru while(){} or any other loop?

    Thanks a lot,
    Manojo

  3. #23
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    I would not have guessed that would work, it seems then like a jpg dows not take over the movieclip as a swf would do.
    You can load with loops but you got to have more empty movieclips to load into then.

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

  4. #24
    Senior Member
    Join Date
    Feb 2002
    Location
    Geneva, CH, Europe
    Posts
    521
    Hi,
    well, the thing is, if I manipulate the AS thru another MC, that is have the frames' interval there, it works. The prob is that I have 4-5 "pages" and whenever I go to one of them, I would like the jpg to charge again(that's why I asked you for the random thing).
    And I would love to learn the loop thing too.
    Another solution would be to make a swf for loading jpg, and load that swf here, (???)

    Anyway thanks a lot,
    Manojo

  5. #25
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    If you want the jpg constatly visible thru all "pages" load it to _level instead. That will make it independent of your main swf's timeline.

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

  6. #26
    Senior Member
    Join Date
    Feb 2002
    Location
    Geneva, CH, Europe
    Posts
    521
    Hi,
    yeah well that's what I did.. I don't want the SAMe jpg thru all files, I want it to randomly change everytime I click something new.
    Well, its hard to explain like this, I guess it would be better if you see my fla.
    please download it here:
    http://membres.lycos.fr/manojo
    You will be taken to a really ugly looking page which gives you a link to the zip file.
    Don't bother if you're too busy though.
    Thanks a lot
    Manojo

    PS. How did you get into cantact with Mynta? I realy like Mahadevan

  7. #27
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    S why not have the random loading code on the buttons then, loading into _level1.

    I have known their leader/bass player for 25 years and done various projects like cd covers and websites with him. They have a Flash site but they dont use it.

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

  8. #28
    Senior Member
    Join Date
    Feb 2002
    Location
    Geneva, CH, Europe
    Posts
    521
    Well, I tried that too, bt as I told you, the real big bother is the SIZE. I somehow CAN'T be able to adjust the mc correctly

    Could you tell me how to do the AS looping way? Thanks a lot(any other way would be okay, too. of course, if you had time to look at my fla...)

    Thanks,
    Manojo

    PS. That's really nice

  9. #29
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    A lop is for making lot of things at once. Ex loading a lot of images into a lot of empty movieclips or.......

    for(i=1;i<21;i++){
    this["container"+i]._width=240;
    this["container"+i]._height=240;
    }


    ....will resize 20 movieclips called container1 container2 and so on.

    I would suggest you get the grips of the load movie thing outside your current fla , as incorporating it in a set environment might get confusing.

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

  10. #30
    Senior Member
    Join Date
    Feb 2002
    Location
    Geneva, CH, Europe
    Posts
    521
    Hi,
    I think that's the same conclusion I got to also

    Anyway, I was able to get something out of the loadjpg tutorial I saw yesterday.

    Apart from that, I guess when you loadMovie, the image files must be in the same folder as the fla right? What all the images were in a db, would it be possible to get the images somehow?

    Thanks a lot really,
    Manojo

  11. #31
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    Images can be located anywhere, even on other servers. But you have to give the right path to them of course. The .fla's location is only relevant when testing things in the Flash environment.

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

  12. #32
    Senior Member
    Join Date
    Feb 2002
    Location
    Geneva, CH, Europe
    Posts
    521
    Ok thanks a lot Pellepiano, for this whole thread

    Manojo

  13. #33
    Senior Member
    Join Date
    Feb 2002
    Location
    Geneva, CH, Europe
    Posts
    521
    Hi,

    I have a question, Pellepiano: how do you make that box adjust to the image's size?? And how is the scrolling button coded?

    Thanks,
    Manojo

  14. #34
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    If the empty mc you load your external files into is named container the code on the resize box movieclip would be....


    onClipEvent (enterFrame) {
    // Set dimensions an speed and more
    xpos = _parent.container._x;
    ypos = _parent.container._y;
    speed = 5;
    // Move the thing
    this._width += (_parent.container._width-this._width)/speed;
    this._height += (_parent.container._height-this._height)/speed;
    this._x += (xpos-this._x)/speed;
    this._y += (ypos-this._y)/speed;
    }



    The scrolling was quite complicated , I cant recall it at the moment.

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

  15. #35
    Senior Member
    Join Date
    Feb 2002
    Location
    Geneva, CH, Europe
    Posts
    521
    Hi,
    so you mean to say that if I say container.loadMovie("whatever.jpg)(size = 100*355); and that I put that code in the first frame of mc.. container would resize to 100*355 ??

    Cool thanks

    Manojo

  16. #36
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    The box is a separate movieclip ( just with a white square or an outline) and the code should go ON the box mc.It will automatically resice to whatever the container size would be ( and position).

    The container mc NEVER resizes i it just a container for the loaded image.

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

  17. #37
    Senior Member
    Join Date
    Feb 2002
    Location
    Geneva, CH, Europe
    Posts
    521
    Hi...
    http://membres.lycos.fr/manojo/Products.html
    why does the box change size after the image is loaded??? And when I get it to a smaller size, why does it leave so many lines behind?? (you have to click on data in the listbox to be able to view images)

    Thanks,
    Manojo

  18. #38
    Senior Member
    Join Date
    Feb 2002
    Location
    Geneva, CH, Europe
    Posts
    521
    Hi,
    thanks a lot Pellepiano.. could you suggest two-three ways of making those images appear better??
    Thanks a lot,
    Manojo

  19. #39
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    Normally you have the image fade in after the box has resized ( as I do in my gallery ). You have a preloader for the image and when its done AND the box has the same size as the image, then you fade in the image. ( its a quite complicated process all in all ).

    You have a fixed size image box too. That sort of takes a way the effect of something that resizes after the image.

    With a fast connection the image is already loaded before the resize script is done ( you can change the speed )

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

  20. #40
    Senior Member
    Join Date
    Feb 2002
    Location
    Geneva, CH, Europe
    Posts
    521
    You have a fixed size image box too. That sort of takes a way the effect of something that resizes after the image.
    What kind of box do you have??? just an absolute EMPTY mc?

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