Can Images Be Stored In Some Sort Of Array And Then Called To The Stage Randomly
Oct 17, 2011Can images be stored in some sort of array and then called to the stage randomly?
View 3 RepliesCan images be stored in some sort of array and then called to the stage randomly?
View 3 RepliesIs there a way using flash you can display images but each one selected randomly from say an array of different images?
View 4 RepliesI'm trying to build a simple slideshow in AS3, what I have so far is I load all my images into an array and place them on the stage in order at index 0 so the first image in the array comes out on top, in terms of stacking. As the slideshow plays it takes the top image off the stack and sends it to the back. This works fine. Where I'm having problem is if the user uses the thumbnail interface to skip ahead or backwards in by multiple images, how to tell my 'stack' of images the new order and sort them the right way.
View 1 Replieshave my images positioned randomly on the stage.
View 1 RepliesI am trying, with this code, to first, shuffle the order of the images in the array so their loading sequence is never the same when the page is reloaded.Then, im trying to have the shuffled array open one at a time, image by image, at a set interval.
Code:
Array.prototype.shuffle = function() {
for (i=0; i<this.length; i++) {
[code].....
I have an array that is structured like so.
[Code]....
Normally, I'd just like to sort the array alphabetically using the name field, which is easy enough using the following code. However, I'd like to create a radio button called 'loadedRadioButton' and when it's click on, I'd like to sort the array on the loaded value first(any items with loaded=true should be at the top, sorted alphabetically), then afterwards, any other items with loaded=false, sorted alphabetically should follow afterwards, how can I do it?
I have two arrays. One contains numbers and the other contains strings. I want to do a sortOn(DECENDING) for the number array and then have the string array sort to match. if my string array is
[Code]....
I have stored images in an array but how do I add the images to the stage one by one according to the array.
View 5 Replieslets say i have dynamically duplicated movieClips ID's stored in array list. i want to add a onPress event to them. how do i do it?
[Code]...
I have 2 arrays: [6,1,4] ["apple","pear","orange"]
how to sort the fruit array base on the first? If the first array was sorted as ascending order:- [1,4,6] the second array follows the first:- ["pear","orange","apple"]
if it was sorted as descending order:- [6,4,1] the second one follows the first array order ["apple","orange","pear"]
I have a flash piece that just chages the image displayed on the screen. The images are stored extrenally so I can easily change them out from time to time. Is it possible to navigate to a web page if you click on an image? If so, how is that coded or can you direct me to where I can find out how to do this?
View 3 RepliesI'm using the following array to storing multiple variables for similar movieclips: public var ballPlaced:Array = new Array(false, false, false); ....however, its not storing the boolean value properly in the array? I'm using the following code in the ZoneFill and ZoneEmpty to assign it a value of true or false, e.g;
[Code]....
I have a snippet of XMLList that I would like to keep the x and y attributes stored in the array:
ActionScript Code:
<mx:XMLList id="random">
<point x="-179.8" y="148.5" /><point x="108.0" y="144.1" />
[code].....
For various reasons, I would prefer to store binary data like images and videos as BLOBs within a MySQL database and have Flash retrieve that content directly from the database as opposed to getting it from a URL on a fileserver. So, I have written a PHP script that Flash calls which does a database query and returns the bitmap data from the BLOB. I have verified that the image data is being sent from the database through the PHP, but Flash either doesn't display the image or gives me an error saying that it is an unknown type.
[Code]....
Is there a way to get Loader() to accept bitmap image data that is retrieved from a BLOB in a database? Should I try to get PHP to mimic the response from an HTTP server or is there another way to load bitmap data stored as a BLOB into a display object?
I am currently developing an application with a Flashlite frontend which communicates with a C# server. The C# server access a database to retrieve images (stored as byte[]) and feed them to the frontend. The thing is, im using XMLSockets so I tried to convert the byte array into a string which left me with something like "23659256239786107089710981890776178910976". I then send it over to the Flash lite, but how to turn this into an image. I am currently using Flash Lite 3.0 /AS 2.1
View 0 RepliesSo I have an array with six values stored in them. The values will either be 1 or 0. I need to sum them up so that I get a number ranging from 0-6.
View 2 RepliesI have a "back button" scheme that includes using an array to store references to functions.However, when i have to troubleshoot something like this, one of the things i'd like to be able to trace is the names of the functions that are in the array. If i trace a for loop through the array i just get [type Function] for each function. I would like to look at it's name.Right now, im using a workaround that places objects with a func property and a funcName property, which is a string that needs to be indicated manually.
View 4 RepliesI was wondering... i thought this might be a dumb question to ask but ive been wondering if it is possible to remove all the data that was inserted into an array?
i.e.
ActionScript Code:
var loadAllThumbnails:Array = new Array("poop1", "poop2", "poop3", "poop4", "poop5");
someBtn.onRelease = function(){
//clears/emptys the array when released
}
I've got this code -
Code:
var enemyArrayOneA:Array = new Array();
for (var i = 1; i <= 84; i++) {
/*
[code]...
I try to use race("mc.main1.a_0" + i + ".x = " + enemyArrayOne[i].x); and it doesn't work...I'm trying to find out if I can store instance names of movie clips inside an array and retrieve the movie clip's x and y positions.
I'm a designer working in tandem with a PHP programmer on a project where we will display a random image via flash from a selection of images stored on a database. Accompanying this image is a tagline and a path for a button and these variables are sent via a php script. The actionscript then picks up these vars via loadVars and displays them on screen - well, almost.
The tagline is displaying in the dynamic text box with no problems, but I'm struggling with how to display the image in the empty MC I've created (called 'pic') and also to attach the path to the button I've created (called 'projectURL_btn'). I'm fairly sure it's something fairly simple but I just can't crack it.
[Code]...
How would one go about calling a function of an object that is stored within a multidimensional array? I keep getting TypeError: Error #1006.
Code calling the function:
ActionScript Code:
_board[i][j].drawPiece(xPos, yPos);
Code of the function:
ActionScript Code:
public function drawPiece(xPos:Number, yPos:Number):void{
_piece_mc.graphics.lineStyle(1,0x000000);
[Code]....
The object is there. When tracing out the array for specific index it provides:
[object Piece].
Or would it just be best to use a single dimensional array? End goal is to have a board class to be able to use for checkers and then potentially chess.
I have a movieclip that i want to move to 4 predetermined spots with a click of a button. I've been trying to put it together all morning. Is this a job or a loop?[code]...
View 3 RepliesI need to create an Array of movieclips so that I'm able to read / modify / add its properties. I thought the best solution was to create an Array of strings with each movieclip's name and then using this to convert the string to an expression, but I don't really know what to do when I want to access one of its properties. Here's my code:
ActionScript Code:
var room:Object = new Object
room.objects = ["mcObj1", "mcObj2", "mcObj3"]
mcObj1.Description = "It's a ball and it bounces"
[Code]....
I need to store my array in a flash cookie file and call it in different swf files.
View 2 RepliesAnyway, I am having problems with storing movie clip objects in an array because when I try to access them, it kinda loses its properties as a movie clip. Say, i have mc_1 stored in the array,and in the course of the flash movie, a button is triggered to change its visibility to "false".. what i do is, arr[0]._visibility = false.So here's what I'm really trying to do with my school project: I have 24 movieclips, i named them field1, field2, ..., field24. I stored them in an array. Initially, they're invisible. Then, a button is clicked to show one field. If the button is clicked again, the second field is displayed, and so
View 3 RepliesI want to write a function that will load all of my external sounds stored in an array which are just strings of their filenames ie:
var soundList:Array = new Array();
soundList = ["sound1.wav", "sound2.wav", etc];
And create a new array with sound Objects that will have the sounds loaded in them (for later execution). After loading all of the sounds in the soundList array, the function should return or just set a _root value to 'true' ie:
[Code]...
I'm trying to draw a line between circles stored in an array. I have a button on the stage which adds another circle to the stage. My issue is I cannot draw a line between the most recent circle added to the array and the one that will be added next.
It is a bit complicated and I'm not an experienced programmer by any stretch of the imagination.
Anyway, here's my code:
[Code]...
Im a bit stumped on this. I have a movie clip named mcMain that the player controls, and i want him to have it detect collisions at certain points of the screen (like at a certain X and Y co-ordinates). I have an array that contains those values, which is shown below:
Code:
//Array that holds x position of points
var xPoint:Array = new Array(150,400,200,300,100);
[code].....
When I rotate images that have been imported to the library or loaded via loader and try to rotate or scale them using the interface or actionscript they become sort of pixelated and blocky. Has anyone else experienced this? If so, does anyone know why it happens or how to compensate for it?
View 3 RepliesTrying to create an isometric game but unable to get my images to sort dyanmically, as those tricky little movie clips wander about the screen. The theory behind it is to order myArray by the .y value (so smallest number is called first), and then remove and then add the clips again according to that.[code]
View 9 Replies