after it is done i would have access only to the last imageLoader instance. How to get access to the rest of images, which were added to the Display List with the same name "imageLoader".I tried to call it with the imageLoader.name property,but surely i do something wrong, as only errors appear in the output panel.
I need to be able to make a large amount of concentric circles, using only the action script. I need to be able to alter each of these concentric circles independently from each other. Currently My code is as follows:
ActionScript Code: var circ1:MovieClip = new MovieClip(); addChild(circ1);
I have a script that randomly pops out circles all over the stage. However, I want them to disappear once I roll my mouse over them (and only the ones I roll over, not all the instances).So if I have code like this in a function:[code]And then I have a mouse_over function in the same class, how do I tell it to removeChild? Since the stars are instances of the object, they are giving instance names like instance67, which makes them hard to remove.
Do I need to create all objects which i will possible use with itemRenderer in createChildren function, even if the current item must not show some of them ?
So, you have a sprite, you draw some graphics, you set cacheasbitmap=true... I can't seem to access the newly created bitmap data, to access the dispose() method.
Basically, I have data organized by date in an XML file. I'm trying to make a website application that will allow the user to click on a date (in a text field) to see another textfield populate with all the data under that particular date. So far, all the information loads into the textboxes at the same time. How can I get it to only load information under a particular date when somebody clicks on that date?
Before I started this project, I was convinced I could do this by manipulating the [j] (see code below) in the myFunc2 function. Currently, it's set up to increment blank_mc._y by whatever value is returned by [j]. But for some reason this doesn't work. I feel that if I could atleas get this part to work - I could probably do the rest.
AS code:
Code: function loadXML(loaded) { if (loaded) { var nodes = this.firstChild;
I am doing is learning flash, so what I have done is followed some tutorials and created some different images with a mask, now I trying to make them loop and I can't seem to figure out how to do it. it seems at the end of the tutorial it says I must put in a stop or the last layers do not come in to view. So I am curious as to how to get passed this problem I am having. am I doing this completely wrong?
- loop through the Grid array and place each tile on the stage
- assign RedBall a random Grid coordinate and places it on the stage at that coordinate
I want to be able to click RedBall, which will create a border around the tile beneath RedBall, and create borders around the tiles above, below, to the left and to the right. BUT, I don't want to reference the tiles by their distance in pixels from RedBall or from each other; I want to reference the tiles by their coordinates in the Grid array. So I want to:
- get the coordinates of RedBall
- use those same coodinates to reference the tile at the same coordinates in the Grid array
- use the tile's coordinates to reference the tiles above/below/left/right
- apply a border to all these tiles
What's the best way to reference an instance of a tile? Should I apply a name to each instance as it's created in the loop? like myTile.name = "tile"+i+"_"+j; ? If so, how do you reference that instance later? Just tile1_3 ? Do you have to prepend it with root, or stage, or the class it was originally created in? Do you have to use getChildByName? OR, can you still reference it later without having given it a name?
I have a simple gallery site with thumbs 'gridBtns' that show and hide content pages 'projectPages'
I have a loop that duplicates an MC (projectPageHolder) (that already exists on the stage) 20 times, simple enough. I run a trace that confirms they all exist.
In the same loop I give a different set of 20 MCs (gridBtn) an onRelease function that attempts to show and hide the projectPage MCs using _alpha, again simple enough.
For some reason the first 4 MCs disappear...they do not trace or become visible, but the rest are fine.
I am creating a loop which loadsimages to newly created loaders.After each loader completes, I'd like to pass it through another function.[code]It seems like if the above function was my complete_handler but in the place of loader_names[k] would be the completed loader.
I am creating a loop which loadsimages to newly created loaders. After each loader completes, I'd like to pass it through another function Here's my loop of loaders where loader_names is an array of my loader names and overlay_files is an array of my file URLs
for (var j:int = 0; j < loader_names.length; j++) { loader_names[j] = new Loader(); loader_names[j].contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler); loader_names[j].load(new URLRequest(overlay_files[j])); }
Once each image loads I want to overlay the image on a map here's a loop which does just that, only I do not know how to pass loaders into this function as they finish
function create_overlays(e:Event):void { for (var k:int = 0; k < loader_names.length; k++) { overlay_names[k] = new GroundOverlay(loader_names[k], new LatLngBounds(new LatLng(46.669, -115.035), new LatLng(48.995,-112.079))); } }
I have a horizontal scroll bar that I need to appear to loop around continuously. I've managed to get it moving on its own since the last time I posted, however the loop is proving more difficult.
The move function is here:
Code: public function movemouse() { lst.onEnterFrame = function () { var speed:Number = -1; this._x += speed;
- loop through the Grid array and place each tile on the stage - assign RedBall a random Grid coordinate and places it on the stage at that coordinate
I want to be able to click RedBall, which will create a border around the tile beneath RedBall, and create borders around the tiles above, below, to the left and to the right. BUT, I don't want to reference the tiles by their distance in pixels from RedBall or from each other; I want to reference the tiles by their coordinates in the Grid array.So I want to:
- get the coordinates of RedBall - use those same coodinates to reference the tile at the same coordinates in the Grid array - use the tile's coordinates to reference the tiles above/below/left/right - apply a border to all these tiles
What's the best way to reference an instance of a tile? Should I apply a name to each instance as it's created in the loop? like myTile.name = "tile"+i+"_"+j; ? If so, how do you reference that instance later? Just tile1_3 ? Do you have to prepend it with root, or stage, or the class it was originally created in? Do you have to use getChildByName? OR, can you still reference it later without having given it a name?
I'v been toying with this for a few weeks now and I'm trying to find the best way to animate several instances of an object created by a for loop thru an ENTER_FRAME function.When the function runs only 1 of the 3 instances that were created animates.
var balloonArray:Array = new Array();var balloon: hotAirBalloon;var xVel: Number = -3;var yVel: Number = -4; addEventListener(Event.ENTER_FRAME, startBalloons)
I'm creating buttons like so: for (k=0; k<5; k++) { myLink = new LinkClass(); myLink.name = "link" + k; box.boxMC.linksMC.addChild(myLink); }
This creates 4 movieClips with the names "link0", "link1", etc. How do I remove them? I try this: box.boxMC.linksMC.removeChild(myLink); But it just removes the last one made (link3). How do I have all of them removed?
So I'm working on a Flash version of the old "Robots!" game. In case you're not familiar: the game lays out a number of robots on a grid (number varies by level), and drops the player in the middle. As the player moves around the grid, the robots all move towards the player one grid space per player move. The object is to destroy all the robots by making them run into each other (or the rubble left from previous collisions) without letting a robot run into you.
Anyway, my robot hordes are being created on the stage through a "for" loop, and each icon is a child of variable "evilBot" which references a library item with the class name "enemy."
ActionScript Code: function placeBots():void{ for (var c = 0; c < numBots; c++){ evilBot = new enemy;
[Code]....
I've run a trace on "evilBot.name" and verified that the children are being given instance names of "evilBot0, evilBot1 ..." and so on. But no matter what I try, I can't issue instructions (regarding movement, orientation, etc) to individual children.
Using a for loop and "this["evilBot" + x]" returns a "term is undefined" error.
If I store the instance names in an array (named "botName") and use "evilBot.name[botName[x]]", I get the error "Property evilBot0 not found on String and there is no default value."
As the title suggests, I cant get function at end of the code to attach to each MovieClip I create dynamically within a loop.Only the last image will follow the mouse. What am I doing wrong? Im really not sure.
Code: //now do something with the xml data PopulateLists = function(final_array)
I create some movieclips dynamically through a loop and store them into an array. I add an event listener to all those movieclips. In the function to which I direct the listener I want to be able to get the loop variable value associated with each movieclip. For example if you click the movieclip that was created the first time the loop ran then you would get the value 0.
Hope I have explained myself well enough. Is it necessary to create a custom event class for this?
I have an for each loop that creates a new textField for each item and I need to know how you can give each textField a unique name so it can be targeted later on.Here is the relevent code:
Code: var i:int = 1; for each (var titleElement:XML in titleList) {
I've been staring at the screen too long and I'm sure the answer is simple but this has been bugging me for a bit now. I've created a grid with over 200 movie clips dynamically using a for loop. I was wondering if there was a way to assign rollovers and such to each new clip using the same loop.
I've been poking around with it a bit but can't seem to get it working and sure don't want to write over 200 rollover functions so any help would be great.
I thought this would be simple but for some reason I'm having all kinds of problems. Why won't the for loop create a new c instance each time the loop increments, like it does for sHolder and s? ...And, assuming it is possible to make it do this, how can each instance be given an identifier that can be accessed dynamically, like sHolder and s in the traceSomething function?