?
Solved

Flash AS2 Thumbnail Grid resize rows and cols

Posted on 2009-05-11
1
Medium Priority
?
772 Views
Last Modified: 2013-11-11
Hey everyone,

I'm trying to create a XML thumbnail gallery that will re size with the stage. I want to have a XML file load the thumbnail but I want the thumbs to distribute based on how wide the movie clip that they are contained with is set to. For example if it's 500 wide they may be 5 thumbnails in the first row but if the stage is re sized and the container movie clip is squat to 300 there may only be 3 thumbnails on the first row....

Although it's a little hard to explain what I'm attempting I found another person asking the same question with an animated example.

Can you guys have a look at: http://board.flashkit.com/board/showthread.php?t=782139 and if anyone has any idea on how this could be accomplished in AS2, your help would be greatly appreciated.

Thanks!
0
Comment
Question by:markm5i
1 Comment
 
LVL 39

Accepted Solution

by:
blue-genie earned 2000 total points
ID: 24396176
Hi there.
you say you want the thumbnails to distribute based on how wide the movieclip is. but you want the movieclip to resize according to the stage?

you need to do some maths to get the size of the movieclip. you're not going to resize the thumbnails right you're just going to reduce the number of items per column/row.
off the top of my head this might be rather intensive in terms of processing as you'll need to reload everything each time.

have a look at this example to get the size of the stage.
this.createTextField("stageSize_txt", this.getNextHighestDepth(), 10, 10, 100, 22);
var stageListener:Object = new Object();
stageListener.onResize = function() {
    stageSize_txt.text = "w:"+Stage.width+", h:"+Stage.height;
};
Stage.scaleMode = "noScale";
Stage.addListener(stageListener);


so each time the stage is resized you need to resize the movieclip. then I'm assuming your'e creating movieclips dynamically to load the thumbnails, so you'll need to call the function again.

if you want to make it easier you could hardcode the items.

so use a switch statement for example and say if the stage width is between 100 and 200 do this, if it's between 200-300 do that etc.

0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
Suggested Courses
Course of the Month14 days, 22 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question