Solved

Flash AS2 Thumbnail Grid resize rows and cols

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Stop Ads in Browser Google Chrome 3 525
Array is not working ( AS2 ) 4 141
You Tube Videos not playing 9 105
Flash ActionScript 6 21
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 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 set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now