ActionScript 2.0 :: Controlling Dynamic Created MC's
Aug 27, 2006
The menu items are created dynamic out of empty movieclips and have the name movie + x. Now I'm trying to create a method that resets al the other movieclips to their original size and colour when one is pressed. The first problem is to adress the other ones. Even if I try to put the following in the script: movie[x]._alpha = 0; nothing happens..
for (x=1; x<=11; x++) {
eval("movie" + x).onRelease = function() {
var my_strNr:String = this._name
[Code].....
View 1 Replies
Similar Posts:
Nov 15, 2011
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."
View 9 Replies
Jun 19, 2006
how to make a grid of squares with loops? also, how do i controle the clips that were dynamically created with the loop. like clip25 only?
Code:
total = 5;
i = 1;
while(i<total){
[Code].....
View 10 Replies
Apr 20, 2011
i was wondering how to make a grid of squares with loops? also, how do i controle the clips that were dynamically created with the loop. like clip25 only?
Code:
total = 5;
i = 1;
[code].....
View 2 Replies
Apr 4, 2011
Is there a standard set of JavaScript controls for controlling a flash video created with swfobject?
I'm using Akamai Multi Player and I'm trying to find a JS control to seek the video when it loads.
View 2 Replies
Jun 17, 2010
dynamically loading in a swf into another flash file, and I'm wanting the user to be able to either advance to the next frame(of the dynamic swf) with the right arrow key, or go to the previous frame with the left arrow key. If I have to I can create a couple of arrows as a generic interface but I am not sure now to code those either.
View 3 Replies
May 16, 2010
I'm pretty new to AS3 but have a project with a very tight turnaround here, having been lumbered with it after a guy from work got taken ill. The basic idea is a visualisation of an XML feed, using the data pulled in to control the behaviour of movieclips. So far I have this;
[Code]...
View 0 Replies
May 15, 2007
I have this code:
Code:
for (i =0; i < txB_NumberOf; i++){
var TextNames:Array = new Array;
TextNames[i] = "text_txt" + i
_root.createTextField(TextNames[i], i, 0, 0, 300, 100);
text_txt1.text = "test text;
;
The code creates a number of text fields based on the number in the variable "txB_NumberOf" each text box gets named text_txt0, text_txt1, text_txt2, text_txt3 etc by storing the names in an array called TextNames and using it as the name field in the createTextField part.
The bit in bold I want to be the name of the newly created Textfield each time through the loop. So instead of just one text box having "test text" in it each textbox gets it.I read somewhere that ... this[TextNames[i]].text = "test text" would work but it doesn't. I've tried everything else I could think of without any luck.
View 3 Replies
Feb 11, 2010
Is it possible to stretch the font of dynamic text or make it more bold using actionscript2?
View 12 Replies
Sep 25, 2009
I need to dynamically attach a movieclip from a library and then make it move across the screen.This is quite easy for one movieclip instance, but what I need is to have movieclips spawn at regular intervals then move accross the screen.[code]My question is, how do I continuously attach movieclips without making so many variables? Is my method of attaching even alright for this purpose?
View 2 Replies
Aug 12, 2008
I have a main.swf which plays, then stops, loads a dynamic .swf... And what I want is, from either the dynamic .swf or the main one, when the dynamic .swf is finished, the main .swf will continue/play.
View 1 Replies
May 15, 2010
I'm pretty new to AS3 but have a project with a very tight turnaround here, having been lumbered with it after a guy from work got taken ill. The basic idea is a visualisation of an XML feed, using the data pulled in to control the behaviour of movieclips. So far I have this;
[Code]...
it isnt too hard to see what I'm trying to do. The above code plops 5 movieclips on the stage, their size dictated by the 'tlength' value, and the next step is to get them moving. Ultimately I'd like these MCs to shift out from the centre of the screen and vary in size and distance depending on the data that is applied to them, but running the current code throws this error; TypeError: Error #2007: Parameter listener must be non-null.
View 4 Replies
Aug 26, 2009
Basically when loading dynamic text... the .txt will have a simple yes or no inside of it... nothing more nothing less.I've been trying all morning to get a movie clip to begin playing if the value is "yes", and to NOT play if the value is "no"
Basically i have a movie clip on the main time line named WHM. and im loading a dynamic text file into a dynamic text field named player1whm.
I want to be able to change the text file to yes or no on a whim, and if the value is equal to yes... i want the movie clip to begin playing as soon as it loads that value into the box. If it says no then i want that movie clip to continue doing nothing.I have already been successful at getting yes or no to load into the dynamic text box... i just cant seem to get it to control the movie clip.
View 7 Replies
Jan 26, 2009
I'm just starting to program in AS3 and use it in frames on the main timeline vs OOP. Can you point me at some reference that would cover:-
1) If it is possible to scale a dynamically constructed object over a few frames in the time-line. I draw an object/shape on frame 10 and scale it up from frame 10 to frame 20, for example.
2) If I can control the depth of the dynamically constructed object. I draw an object on frame 10 and on frames 11 through 20 I have some line already drawn on another layer that I want to appear above or below the dynamically drawn shape. I can easily do both of these in AS1 but don't seem to see similar constructs in AS3?
View 3 Replies
Jul 26, 2010
i have an flvplayback component within a dynamically-created accordion pane. when the user hovers over a new accordion tab and opens a new pane in the accordion, i want to stop the video in the first pane. how can i reference the video player?
here's the code on the root timeline:
function _open(ev:AccordingEvent):void {
MovieClip(root.instance7.flvPlayback).stop();
[code]....
View 2 Replies
Jan 29, 2009
I have a movieclip called pointer.mc and this movieclip has only two frames, on the first one the arrow points up and I have a stop(); action on this so it does not jump to the next frame which has the arrow pointing down and this frame also has a stop(); action on it.Then I have a dynamic text field with an instance name of tiderise which is calling a variable from a seperate .txt file called tiderise.txt and the variable is &rise= . Now I have programmed the .txt file to only supply two variables either "up" or "down" and these change periodically during the day. (I am actually making an animated tide chart if you haven't guessed already)
What I want is to get some coding that will control the movieclip pointer.mc between frame 1 and frame 2 depending on the value in the dynamic text field with an instance name of "tiderise" that can only return the value's of "up" or "down".I have spent already about 2 hours trying to figure this out with no luck, I only seem to be able to control other dynamic text fields with values from another dynamic text field, but cannot seem to get this to work on a movieclip.
View 5 Replies
Dec 31, 2009
I can't seem to control my letter spacing (kerning) in my dynamic text field. I gave the field an instance name of about_txt and I loaded the text from a text document. The text shows up fine but it is all bunched together. Here is my code:
Code:
var about_req:URLRequest = new URLRequest("about_txt.txt");
var about_1dr:URLLoader = new URLLoader(about_req);
about_1dr.addEventListener(Event.COMPLETE, onComplete);
function
onComplete(event:Event):void{
about_txt.text = event.target.data;
}var fmt:TextFormat = new TextFormat();
fmt.letterSpacing = 10
about_txt.setTextFormat(fmt);
No matter what value I put in for letterSpacing nothing seems to happen.
View 3 Replies
Jan 7, 2010
I have dynamically loaded buttons (thumb) and images (galImage) going to container_mc and full_mc containers respectively. I can't get the buttons to stay down when pressed using MOUSE_DOWN and MOUSE_UP. When I use CLICK instead, they all stay pressed. [code]...
View 7 Replies
Oct 20, 2006
I dynamicly create MCs and give them names and URL's through the XML i load, but how can I scroll them? I can display 10per page, but I want a scroller so I can view the rest for instance.
Code:
//start generate filelist
GenerateMenu = function() {
[code].....
View 1 Replies
Jul 20, 2007
I create a mc on the root level from the library by attachMovie (box1).box1 creates a second mc from the library by attachMovie (box2).On the root level I have a button who change the color of both mcs by new Color / setRGB.But box2 will have the same color than box1, regardless which color I set to box2.Button-AS (FLA is attached):
Code:
this.onPress = function () {
// set box1 to green
[code]....
View 2 Replies
Oct 3, 2011
i created an MC that is made of dynamic mc clips that include a textfield named combo_txt, it is the same clip that i put on stage with add child and i dont knowhow to refer to them i, think i gave them different named but still cant reach them:
[Code]...
when i click on each of them i get the name i gave it but i want each clip to have a different text. this doesnt work:
[Code]...
View 4 Replies
Oct 23, 2004
The following code, when attached to the MC panTracker_mc works as desired, passing the value of the dynamic text field with a VARIABLE name of s1Pan to s1 sound object, thus controlling the pan.
[Code]...
View 14 Replies
Aug 19, 2004
If I have a dynamic text box with hyperlinks in it, how do I control movie objects through them? I mean is it some kinda code that I'll have to add in the <a></a> tags or some other cool s h i t?
View 1 Replies
Sep 20, 2006
I've created a XML-dynamic news box which uses a external .CSS Since my hosting is slow, when I load my movie of the news box, some of the times CSS doesn't seem to do its work -- All I see is the html code that I created in the XML file.
I was wondering how I preload the css and xml before executing/using it.
[Code]...
View 3 Replies
May 21, 2008
I was wondering if there was a way of drawing different shapes dyamically, and then somehow "join" them so that the resulting shape has only one outline, and not an outline for each shape.For examples making a random cloud with circles, and only have the outline on the cloud, and not each circle.
View 4 Replies
Feb 23, 2004
What I want is the following. Based on an XML file and one empty movie clip, I create about 80 different items (menu items). By drag and dropping these menu items you can create a scene with objects. These objects are copies of the menu items.But I want to use the attachMovie command to have control over the path of the objects. But by creating the menu items dynamically, I cannot say in the library, export for actionscript.So my question is, how can I use the attachMovie command on items that are dynamically created.
View 6 Replies
Nov 4, 2006
Below is the code for dynamic image gallery from XML.
We have an alpha effect to the image animation when the image is loading. The affect is working fine (fade in).
But, when the next image is loading, we want fade out alpha affect to the current image before the next image loads.
delay = 6000;
//-----------------------
function loadXML(loaded) {
if (loaded) {
[Code].....
View 1 Replies
Nov 10, 2010
How do you set up a hit test for a dynamic movieclip that hasn't yet been created?I have a movieclip on the stage, and I want it to change colour when a yet to be created dynamic clip touches it.
View 1 Replies
Nov 30, 2009
I'm building an Xml-driven application. I create new states in a separate actionscript-class.These states all contain a DataGrid. I can switch the states in the Main.mxml.
But now I would like to access certain children of the DataGrid. In this case I would like to toggle the visibility of GridItems, from a Button in the Main.mxml.
How do I have access and apply this to the already created states ? I tried to create RemoveChilds and override/push it to the state.All I archieved was to remove an entire GridRow at the very last state, but it should be just one GridItem at every state.
View 2 Replies
Mar 15, 2011
I try to get acces a property by click on a dynamic created Moviclip.
function finishLoading(evt : Event):void {
// Handle XML Settings
XML.ignoreComments=true;
[code]....
View 1 Replies