[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Flash AS2 Thumbnail Grid resize rows and cols

Posted on 2009-05-11
1
Medium Priority
?
770 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
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 how to record live broadcast.

656 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