Groups | Blog | Home
all groups > flash actionscript > october 2007 >

flash actionscript : Dynamic Gallery - Automatic Resize To Window



PhenixDesigns
10/13/2007 10:10:29 PM
Hopefully this will be the last question about the dynamic Flash gallery I've
been putting together. So far, the finished product can be found here:
http://www.phenixdesigns.net/testing/art_index.html

First of all, thanks so much to everyone on the boards for their help with
this.

And now, I've got one more question. It's not a necessity, really, as I've got
the gallery working as I'd like it to. It's just a little added something that
I think would be nice.

The only comparable example (that I've been able to find) to what I want to do
is found at http://www.suicidegirls.com. Be warned before clicking that it is
an adult website with nudity.

When viewing pictures in their gallery, the full-size images resize when you
change the window size. They also resize if you change your screen's
resolution. I'm assuming that they have the full-size images in a high
resolution on the site and that there is some code, be it XML or AS, that tells
Flash to resize the image based on screen resolution/window size.

I've searched through the forums and on Google and I haven't found anything
that really fits what I'm looking for. I did find some posts about dynamic
image resizing, but as I said, they didn't seem (to me, at least) to really fit
into what I'm looking to do. If I overlooked someone's post, please point me in
that direction.

Otherwise, can anyone help me with this? I do have all of the images for the
gallery I'm building in high-resolution, so it would be no problem to use those
instead and just have the script scale them depending on screen
resolution/window size.

Again, thanks so much for the help! Couldn't have done it without you folks.
kglad
10/14/2007 1:18:15 AM
PhenixDesigns
10/14/2007 5:59:32 AM
I'll look into that, but I'm not trying to resize the SWF at all. I want the
size of the external/dynamic JPEGS to change with window/resolution size.

Is that what this should do?

As I said, I'm looking it up right now to check it out, but I thought I'd
cover my bases here at the same time.

Thanks!
kglad
10/14/2007 2:14:55 PM
PhenixDesigns
10/14/2007 5:18:38 PM
Alright, cool.

kglad
10/14/2007 6:14:17 PM
PhenixDesigns
10/14/2007 7:46:55 PM
kglad
10/14/2007 7:50:57 PM
:



Stage.scaleMode = "noScale"
lo= new Object();
lo.onResize = function () {
// do whatever, the stage has changed
}
PhenixDesigns
10/14/2007 8:07:05 PM
Okay... I'm still sort of lost here. I'm not sure what to do with this code,
or what to put in the space where you've put "do whatever, the stage has
changed."

I put it in as it is, and it just made the SWF huge and unusable. Apologies
if I'm coming off as dopey or anything, I'm just new to this type of thing, so
any help is greatly appreciated.

Thanks!
kglad
10/14/2007 8:42:03 PM
that code wouldn't make your swf ".. huge and unusable". it's just listening
for a stage resize and does nothing beyond that.

you want your external images (that have been loaded into target movieclips)
to change size when the stage resizes, correct? if so, change their sizes in
that onResize method.

p.s. publish your swf to 100% width and height.
PhenixDesigns
10/14/2007 8:47:42 PM
It did, in fact, make it huge and unusable. When I opened it in my browser, it
was absolutely huge and my navigation was off of the screen. Definitely
unusable.

I've got my SWF published to 100%.

The images are all external, loaded into Flash through an XML file. They load
into a movieclip called "loader" when their thumbnail is clicked.

As I said, I'm new to getting involved in the AS and XML stuff, so as much
help as you can give is appreciated. I'm not sure what to put in the
"onResize" code you gave me to resize my "loader" movieclip/the images that
load into it.
stevenL
10/15/2007 3:47:55 PM
This is a familiar technique in AS2, although I have not seen an AS3
version anywhere. How would one create the full browser technique in
AS3? Would the code be placed in the Document Class?



[quoted text, click to view]

AddThis Social Bookmark Button