dcsimg
A Flash Developer Resource Site

Results 1 to 12 of 12

Thread: Dynamic JPEG in movie clip, can't adjust position!

Hybrid View

  1. #1
    Junior Member
    Join Date
    Sep 2002
    Posts
    6
    Hey Folks!

    I've been up all night trying to figure out what I think is a very simple problem. I have a scrolling portfolio (made up of multiple thumbnail buttons #1-42) with each picture loading a dynamic .jpg using a movie clip called pix. This is the code I have for each button:

    on (release) {
    _root.pix.loadMovie("portfolio/1.jpg", "get");
    }

    Everything works beautifully, FINALLY, BUT, now, the problem is, each photograph is a different width and the movie clip position is the same for each, leaving most of them off-center(there are 3 different sizes). I tried making multiple movie clips, one for each size on different layers of the timeline, but then the photos stack on top of each other. I would like to be able to adjust the coordinates of the movie pix, so that I can attach these independently to each button and customize the _x & _y axis for perfect centering.

    True, I know little actionscripting, but in 10 hours, you'd think I would have found something that worked. Is this just so simple I am overlooking it?

    Thanks!

    Jen

  2. #2
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    I could help you better is I had the fla. can you post it?

  3. #3
    Junior Member
    Join Date
    Sep 2002
    Posts
    6
    Originally posted by EQFlash
    I could help you better is I had the fla. can you post it?
    here ya go:

    http://www.musters.com/portfolio.fla
    http://www.musters.com/portfolio.swf

    Thanks much...

    -Jen

  4. #4
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    where would you like the pix to be located when you click on one of them?

  5. #5
    Junior Member
    Join Date
    Sep 2002
    Posts
    6
    Originally posted by EQFlash
    where would you like the pix to be located when you click on one of them?
    Well, I would like the pix to be centered. As you can see, they are all 0,0 in reference to where I placed the movie clip. The wider pics would need to be nudged over.

  6. #6
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    how about under the pix scroll, so that you can see the thumbs as you select. Would it be okay if I redesigned the mechanics of it so as not to change the way it looks, but the way it functions, thus giving you a new fla?
    if not, I'll try to work with what I have.

  7. #7
    Junior Member
    Join Date
    Sep 2002
    Posts
    6
    Originally posted by EQFlash
    how about under the pix scroll, so that you can see the thumbs as you select. Would it be okay if I redesigned the mechanics of it so as not to change the way it looks, but the way it functions, thus giving you a new fla?
    if not, I'll try to work with what I have.
    I'd be horribly offended (just kidding). I would be thrilled just to have the darn thing work. Strangely enough, it works entirely different here on test than the link I sent you. The picture pops up in the center, where I want it, right above portfolio...BUT, it's not always centered.

    -J

  8. #8
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    don't be offended. I meant the fla can be done simplier than it is. The idea in designing in flash is to give flash as easy a task as possible. You could also cut down on filesize if the pix were dynamically loaded. I didn't mean to offend you, and I apologize if I did.
    I did a site a while back with a pix scroll like yours.
    http://1jazzylady.shadowsounddesign.com
    click on pictures when it loads, and tell me if you something like that.

  9. #9
    Junior Member
    Join Date
    Sep 2001
    Posts
    5
    jen,
    I am not sure if this solution will be what you want to hear, nor am I sure that it is the most efficient way to do it, but this was my approach to the same problem:

    -my thumbnails call SWFs into target MCs and play there (they do now, thanks to oldnewbie who helped me fix it)

    -my SWFs are different sizes, which is a problem

    -I found that putting a simple rectangle the same size as the incoming file into the target MC allows me to scale and position the MC instance so that when the SWF (jpg for you) comes in, it takes the Transform/Position properties of the target (the incoming file also takes the place of the rectangle, removing it)

    -that rectangle must have its registration point at the top left corner and be set to x=0, y=0 in the MC

    -I made a separate, labelled frame for each instance of the target MC

    -when the viewer cicks the thumb, the main timeline jumps to the corresponding frame

    -there, the instance of the target MC is specially named just for that thumb's jpg and can be scaled appropriately

    -this only scales properly if each incoming jpg has the same aspect ratio (h:w=1:1.33 or whatever)

    -if your jpgs have different aspect ratios, then you can make a specialized target MC for each size (320x240, 110x220, etc) in the library (empty target MCs don't add much file size) and drag them out onstage as needed

    -I can think of some ways this could be made more modular, but at some point you have to balance the benefits of a fully modular method that will take a long time to perfect with the benefits of a less efficient way that just gets the job done

  10. #10
    Junior Member
    Join Date
    Sep 2002
    Posts
    6
    Originally posted by EQFlash
    don't be offended. I meant the fla can be done simplier than it is. The idea in designing in flash is to give flash as easy a task as possible. You could also cut down on filesize if the pix were dynamically loaded. I didn't mean to offend you, and I apologize if I did.
    I did a site a while back with a pix scroll like yours.
    http://1jazzylady.shadowsounddesign.com
    click on pictures when it loads, and tell me if you something like that.
    I wasn't offended at all. That is similar to what I want to happen, but I don't want the pic to zoom in. I DO have the pics dynamically loading now. Just can't get them to size right.

    -J

  11. #11
    Junior Member
    Join Date
    Sep 2002
    Posts
    6
    Originally posted by ikedabarry
    jen,
    I am not sure if this solution will be what you want to hear, nor am I sure that it is the most efficient way to do it, but this was my approach to the same problem:

    -my thumbnails call SWFs into target MCs and play there (they do now, thanks to oldnewbie who helped me fix it)

    -my SWFs are different sizes, which is a problem

    -I found that putting a simple rectangle the same size as the incoming file into the target MC allows me to scale and position the MC instance so that when the SWF (jpg for you) comes in, it takes the Transform/Position properties of the target (the incoming file also takes the place of the rectangle, removing it)

    -that rectangle must have its registration point at the top left corner and be set to x=0, y=0 in the MC

    -I made a separate, labelled frame for each instance of the target MC

    -when the viewer cicks the thumb, the main timeline jumps to the corresponding frame

    -there, the instance of the target MC is specially named just for that thumb's jpg and can be scaled appropriately

    -this only scales properly if each incoming jpg has the same aspect ratio (h:w=1:1.33 or whatever)

    -if your jpgs have different aspect ratios, then you can make a specialized target MC for each size (320x240, 110x220, etc) in the library (empty target MCs don't add much file size) and drag them out onstage as needed

    -I can think of some ways this could be made more modular, but at some point you have to balance the benefits of a fully modular method that will take a long time to perfect with the benefits of a less efficient way that just gets the job done
    My jpgs do have different aspect ratios and I did make specialized target MCs, but when I load them on the stage, the MCs pile ontop of each other. Do I have to unload them first?

    -J

  12. #12
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    did you go my site i gave and clicked on pictures?
    I'm working on a duplicate fla. I'll have it ready and posted when done.
    [Edited by EQFlash on 09-16-2002 at 06:29 PM]

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