ActionScript 2.0 :: Targetting ALL Dynamic MC's?
Feb 4, 2004
Not sure if the subject title really describes what i want, but its the best i could think of. Anyways, the problem is that I have a code similar to this (its been shortened so the problem is easier to understand):
[AS]
for (index=0; index<12; index++) {
frameHolder = this.createEmptyMovieClip("frameHolder"+i, i);[code]....
So basically what i want is to have the frameHolder function target ALL the dynamically created MC's - frameHolder1, frameHolder2 ...frameHolder12. But when you trace the function, frameHolder only equals "frameHolder12", so therefore the function only works for the 12th MC.
View 1 Replies
Similar Posts:
Feb 4, 2004
I have a code similar to this (its been shortened so the problem is easier to understand):[code]So basically what i want is to have the frameHolder function target ALL the dynamically created MC's - frameHolder1, frameHolder2...frameHolder12..But when you trace the function, frameHolder only equals "frameHolder12", so therefore the function only works for the 12th MC.
View 1 Replies
May 13, 2005
Beneath it I have a div called "container". I would like to hit a button in the flash file and have the contents of the container div change. I've done a similar thing with frames or iframes in the past, but I'm thinking there is a way to tell flash what div I am argetting. I would love to see the answer in AS3 since I'm trying to get myself away from many years of using AS2
View 11 Replies
Feb 26, 2007
I would like to duplicate a movieClip that exists in a SWF that has been loaded into the main movie and place this duplicate into a different SWF that is loaded intop the main movie. I am not sure if this is possible and can't get this to work.I have made a simple movie with 2 movieclips and the code inside of one of the boxes tries to duplicate the other movieclip using this code:
[AS]
duplicateMovieClip(_root.my_mc, "my2_mc", 2);
my2_mc._x += 100;
[/AS]
As I say I'm not sure I can target MCs in that are not on the same level as the function is called from.
View 1 Replies
Jul 18, 2003
MovieCLips inside another container MovieClip won't respond to a DOUBLE_CLICK event.I've added EventListeners for MOUSE_DOWN and MOUSE_UP and the contained MovieClips respond well to those, but not the DOUBLE_CLICK (Argh). Why? Doesn't DOUBLE_CLICK propugate to the children inside the container? I've tried doubleClickEnabled = true, but that don't work.The code:
thumb_group.addEventListener(MouseEvent.MOUSE_DOWN , onArtDown);
thumb_group.addEventListener(MouseEvent.MOUSE_UP, onArtUp);
thumb_group.addEventListener(MouseEvent.DOUBLE_CLI CK, onArtDoubleClick);
[code]....
View 3 Replies
Sep 27, 2011
i have created a couple of buttons at run time in flex. when i click on one button using event.currentTarget property i can change its properties like x,y,label etc , also i can get its index. Now i can found the next child index too but how can i change the properties of next child using its indexCurrently i am using getElementIndex(Button(event.currentTarget)).x for changing its x coordinates. Need to change the coordinates of the button next to it.
View 1 Replies
Oct 14, 2007
I did a search on the forums and found 2 threads that were relevant but didn't quite get what i wanted out of them.I've loaded a movieclip using attachMovie(); and ive put it into an empty movie clip (as you would with external MC's)My question is how i will go about targetting the loaded movieclip and having it play a certain frame.[code]
View 4 Replies
May 2, 2009
i have movie clip named serviceMenu which is instance of menuAll in Scene 1
scene 1 have 8 labels:
serv1 - serv2 - serv3 - serv4 - serv5 - serv6 - serv7 - serv8
inside serviceMenu i have 8 buttons
when i doubleclick serviceMenu it take me inside
menuAll which have 3 layers
1- 1 keyframe actions
2-1 keyframe for the button
here is the code for one of the buttons
servSix_btn.addEventListener(MouseEvent.CLICK, goServ6);
function goServ6(event:MouseEvent):void
{
serviceMenu.gotoAndStop("serv6", "Scene 1");
trace("button Clicked")
}
and here is the error: "1120: Access of undefined property serviceMenu."
am trying to target scene 1 labels
View 3 Replies
Nov 24, 2005
I am targeting a a movie clip. The problem is that all the syntax I have found for targetting clips looks like this: _root.sample_mc.sample2.mc. etc. The problem is, my target clip is in an swf that I've loaded into a container clip from my main timeline. So, essentially, I have a home.swf that loads menu.swf into a container called 'location'. In menu.swf, I have an MC called center, which contains the MC I am targetting called 'target'.
View 2 Replies
Oct 1, 2003
I have a movie. In it are some buttons and a dynamic text field. When I press the buttons is should load text from a database into the dynamic text field. If I run the movie by itself (ie. not by LoadMovie()-ing it into a different movie) the dynamic text field gets filled with text and all is well and good. However, when I use LoadMovie() to load this very same movie into my main movie, the buttons no longer work; the text field stays empty.
[Code]...
View 9 Replies
Sep 28, 2010
I have 2 input textfields on the stage and 1 dynamic textfield.
-input1 is for quantity
-input2 is for page count
When a user enters a number into the page count it makes a calculation and places the outcome into the dynamic textfield. This textfield is for the individual price.All of this so far works. What I want to do now is create another dynamic textfield for the total. So the individual price is multiplied by the quantity and this result is put in the new dynamic text field. I have the code for that working but here is where it gets tricky (for me anyway).The total price is to start off invisible. When I roll over the individual price the total price is to appear (For a test lets just say when I roll over an area the total price appears).To stop cursor flickering this should be done inside a movieclip. So... I have create a movieclip and placed a dynamic textfield inside it. They all have instance names BUT how do I reference it in script?I need to tell the resulting calculation to be placed inside the textfield which is inside the movieclip. If it isn't inside a movie clip I can do it. But how to I reference it when inside one?
View 1 Replies
Jan 23, 2010
I've made a flash movie which will load four movie clips at runtime. Actually, the number of movie clips will depend upon number of "NODE" in XML file. Keeping XML file thing aside, I've tried hardcoded values; 4. Let me describe you the structure very well:
There is a main empty movie clip, instance name "mc_scroll" which will be only item on stage. In this movie clip, another movie clip whose identifier name is "blueMovie" will be loaded dynamically. Inside this "blueMovie" MC, there is a button instance name is "blueButton" and inside this button there is a "Dynamic Text" field instance name is "btn_text".
Phewww.. so long chain... inshort:
mc_scroll->blueMovie->blueButton->btn_text
Now, I can load 4 or any number of "blueMovie" inside "mc_scroll". But I also want to set the button text for each button inside each MC!! I'm sure you guys are getting what I want to do. But its not working. Below is the code:
Code:
//INSIDE THE MAIN TIME LINE
for(i=0; i<4; i++)
{
[code]....
how to assign the text dynamically which is inside a button and this button inside a MC which is created dynamically inside a main MC!
View 3 Replies
Jul 18, 2011
i have a question while reading Flex 4 Cookbook i came across the method to dynamically adding control to the container controls but nowhere i came across with how to provide them with the dynamic properties and events like they have created a button dynamically inside a group control but what good a button be if i cannot give it an event dynamically. in the same way i want to add a tree view inside a vbox but what good that be if cannot provide a data provider to it dynamically.actually i am creating an web application where i add the tree view to a vbox and i want to the data provider should also be dynamic depending upon the option i have selected in the combo box.
View 1 Replies
Oct 14, 2009
i have a problem with my flash menu. It's simple menu that contains one MC at start that works as button, u can edit size of the menu from external .txt file by changing the value of menu length. All that works fine , my problem is that every new duplicated mc contains dynamic text area as a label. Labels are also loaded from that .txt file , but that works only for the 1st mc because the newly created text areas in mc's dont have Instance Name set. How can i assign them from as?
View 2 Replies
Aug 22, 2005
can't figure out why the dynamic text boxes in my dynamic clip arent picking up the variable when I loop through this recordset!the trace (you'll see here right after I try two ways to assign the variable) traces the correct info back..
[code]...
View 1 Replies
Jan 3, 2006
I am tryng to create a dynamic datagrid that receives dynamic columns:
PHP Code:
for (i=0; i<DadosModelos.total_produto_modelo_recebe; i++) {
var coluna:DataGridColumn = new DataGridColumn();
coluna.width = 75;
[Code].....
Now i want to add a row that receives a value for each column that i add dynamic above, i tried all but nothing..
View 13 Replies
Jun 7, 2006
I can't get the code to "know" which of the dynamic thumbnails has been clicked (by "know", I mean return an index value, say 0 through 7 if there are 8 projects, that I can use to access that particular project in the array of 8 projects in the rest of the code)... So if the third movieclip thumbnail were clicked, I'd like "2" to come up somehow... I've tried this code, which is kind of lame, I know, based off of the idea of each of the thumbnail movieclips' names ending in their index number:
Code:
//"this" is the button that was pressed; would return a string ending in
//thumberMC_<number of whichever movieclip thumb was clicked>
var: testString:String = this;
[code]....
Lastly, there's a dynamic textfield I'm trying to create that never shows up for some reason. Again, you could see in the FLA (in the "createDrawer" function around line 424).
View 9 Replies
Jun 15, 2007
im trying to do a dinamic link for my dinamic thumbs gallery. But i dont know how to propagate it. here is my function for my show next button PHP Code:
[Code]...
View 1 Replies
Jul 17, 2010
I'm trying to input a dynamic text field into many dynamic movies. I use a for loop to successfully create 18 movies. I can't seem to get the text to be input dynamically however. The dynamic text field in the dynamic movies is named eventText. This code in the for loop successfully creates 18 movies:
[Code]....
View 1 Replies
Aug 2, 2010
I'm trying to make this game and in trying to make it look more realistic, I'm trying to get the balloon to curve upwards before coming down and hitting the target. Is that even possible? Also, the target are dynamically created with random x and y points, so is it possible to make the end points the x and y point of that target?
View 1 Replies
Mar 21, 2009
I am using buttons with a dynamic textfield and a function to set the label for various different buttons:
public function setLabel(thisLabel:String) {
visibleLabel.text = thisLabel;
}
I set a label for each button:
btn_mc.button1.setLabel("2 | Al Sabkha Bus Station - Al Qusais Police Housing");
I have a dynamic textfield ... myText ... which I would like to use as a page title ... so once the button has been clicked, the dynamic textfield should update with the label of the button clicked.
View 1 Replies
Jun 18, 2009
Im trying to create same MCs and create a textField inside each MC created, then I am trying to apply onRollOver event into those MCs created and change the textField.textColor.
From my code Im resulting and trace with "undefined" how can I manipulate the dynamic created Textfield inside the dynamic created MC
Here is my code:
for (var i = 101; i < 103; i++)
{
if ( i != 115 and i != 116 or i != 126 or i != 127 or i != 134)
{
[Code].....
View 3 Replies
Aug 11, 2009
I'm creating a playlist for a music player, and I've got the song names displaying correctly in my songTitle holder MC, but there's limited space for the song names to be shown in, and I'm going to eventually have it inside a scrolling movieclip. Problem is, the text inside the textfields disappear when I try to add a mask to the movieclip they're being loaded into. I've tried adding all combos of embedFonts, antialias, and blendModes I ran into, to no avail.how to mask dynamically created textfields with a non-dynamic (Flash IDE-made) mask.
Code:
for (var i:int = 1; i <= _size; i++) {
var pl_artist:TextField = new TextField;
//all embedFont = true and antiAlias commands no workie
}
View 4 Replies
Feb 19, 2010
I have a movie clip and in that movie clip there is a dynamic text box. I want that text box to display a dynamic variable name something like:
Quote:
_root.var_[this._name]
so the variable will be _root._var plus what ever the instance name of the movie clip it's in is, how can i do this?
View 1 Replies
Sep 30, 2009
I am using a regular Flash object as a simple data container, and I want to remove a particular property of that object. Then that object gets passed on to a for..in loop. But even after using delete to remove the property, the key still shows up in the loop.
For example:
var obj:Object = { a: "a", b: "b", c: "c" }
delete obj['b'];
for ( var prop:String in obj ) {
[Code].....
So deleting the property seems to be the same as assigning its value to null.
Is there any way to immediately remove the property from the object altogether so that it is no longer looped over in a for..in loop?
It is not sufficient to check the property for a null value since a property with a null value is not the same as not having the property in the first place, and represents a different state. I don't want to set the property to null, I want to remove the property.
View 2 Replies
Jun 22, 2010
Ok, Background. I have two objects both of which im spawining in though code. We will call them bullets and wolves. They have their own .AS files which tells them everything they need to know about themselves. I figured i would do most of the hit testing on the bullet.AS file, hit testing against the wolves as there were going to be a set number of wolves but not a set number of bullets.o, I named them by running a loop and putting the linenewWolf.name = i.toString();Yes, new wolf is a declared variable, and i is the name of the variable that makes the loop run. I also have a test in it, and it works fine.
However, The hit testing is where i come into an issue. Remember, its on a seperate .AS file. The wolf maker and namer is on the main flash page.The hit testing function isif(this.hitTestObject(a)){i changed up my variable name to run a second loop. first variable name is "i" and the second variable name is "a"And for some reason i get a type error 1034, which from what i understand is an error that you get when two instance names are the same. Also, If possible, i would like to add letters to the name of the object, but im not sure if flash will let me as i belive the code would look something like this
View 1 Replies
Jan 14, 2010
picture: [URL].. I am making a boardgame in flash Action Script 3 each position on the board is a buttons like this: button_1_1, button_1_2 etc. Whenever a character is selected you want to move it so the script has to add event listeners for positions around the selected unit
[Code]...
In the rest of the code I have:
function userClickedPosition(position_x:int, position_y:int) it selects or deselect a unit function selectUnit(position_x:int, position_y:int):it uses the listentoButton(1) function to add 8 listeners (the positions around the clicked unit)function deselectUnit(position_x:int, position_y:int): it uses the listentoButton(0) function to delete 8 listeners (the positions around the clicked unit)
My question: adding eventlisteners is no problem but removing them dont seem to work? What did I do wrong?
View 1 Replies
Nov 8, 2011
first I had:
maskedImg = getChildByName("current") as MovieClip;
maskedImg.mask = mymask;
and everything worked properly. Then I removed the movieclip from the scene, exported it to Actionscript, and changed the code to
maskedImg = new mymovieclip();
addChild(maskedImg);
maskedImg.mask = mymask;
and now I don't see anything on the scene. If I comment out the line assigning the mask I can see the movieclip although. The mask is created dynamically in both cases.
View 1 Replies
Dec 16, 2005
Im using this xml "data.xml":
HTML Code:
<XML>
<salesreps>[code]...
I want to generate a mc for each rep with 6 text fields containg the 6 values for eash rep.So for this xml there would be 3 mc's with 6 text fields in each. This is one of my first times really diving in to xml parsing in Flash.
View 3 Replies
May 25, 2010
I'm getting crazy with this error and found no solution until now. Well, the issue consist in create dynamic movieclips and external jpgs into a for loop through xml nodes and add the respective image into that movieclip.
[Code]...
View 1 Replies