Solved

Flash AS2 Thumbnail Grid resize rows and cols

Posted on 2009-05-11
1
762 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 500 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
IE 11 Flash Player issue 7 243
Youtube video error 30 807
Adobe flash player memory exhaustion 6 96
IE11 stops playing video on a certain website 10 83
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
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…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.

839 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