|
-
Custom Flash Gallery Button Checks
Hi, I'm trying to get a custom flash gallery going by using the loadMovie command with Jpeg's. I must use this method as it's what is required by our project. I am trying to figure out some way to make an array to keep all of my image names and then detect which button is being pressed and have it call the corresponding number within the array.
Currently I have some code that is working quite well but not fully
Code:
stop();
var thumbArray:Array = ["i1", "i2", "i3", "i4", "i5"];
i1 = "MedievalCrossbowDiffuse.jpg";
i2 = "InGameScreenShot9.jpg";
//Button Objects
Button.prototype.onPress = function() { //function to detect the instance name of the button
var clickedNumber:String = this._name; //when traced returns i1 or i2 depending on which button is clicked.
imgContainer.loadMovie(clickedNumber); //trying to load i2 but just comes up as undefined.
}
I have two buttons currently instanced named i1 and i2. The trace is working and calling "i1" but for some reason even though i set i1 = "thejpeg.jpg" it isn't calling the jpeg. All help appreciated! I can upload my file if necessary.
Also i'm going to need to be able to unload the opened jpeg by clicking anywhere off of the jpeg's area, help with that too would be highly appreciated, i know how to unload a jpeg but I don't know how to detect when you click any surrounding area of it.
Last edited by shinji246; 08-26-2010 at 10:26 PM.
-
replace:
i1 = "MedievalCrossbowDiffuse.jpg";
by
thumbArray[0] = "MedievalCrossbowDiffuse.jpg";
gparis
-
Hey Gparis, tried and it didn't work, any other suggestions? Am getting the same exact traces, it is searching for an item named "i1" or "i2" (the instance names of the buttons) for the file name of the Jpeg. I would gladly name the buttons "ThisJpeg.jpg" to match the file names but it won't let me name that as the instance name. Thanks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|