Can't Set Different Names For Buttons
Nov 20, 2011
When I add two or more the same buttons and changing the name of one, the name of the others also changes. How to set different names to each button? I tried creating buttons by copying, duplicating and nothing...
View 6 Replies
Similar Posts:
Nov 12, 2009
[URL]
how to change the names and the hyperlinks of the buttons given in this file...
View 1 Replies
Aug 8, 2009
I have an XML-file.I want to base an menu on my website om this information.Let us say that I have info in the XML-file with the names "About Me", "Articles" and "Video".Then I want three buttons with the text above on them. This is successfully done.The problem is, that I don't know what button I am pressing. To go to the nest page I need to know what button I am pressing.
I've tryed the following:
Code: Select allprivate function buildMenu():void
{
for (var i:int = 0; i < menuArray.length; i++)
{
[code]....
The result is that all the buttons get the name of the last entry in the XML-file. In the case above all the buttons would get the name "Video".
View 4 Replies
Mar 25, 2011
I am amateur in flex, and started my final year project in flex to learn it, I am stuck in place where I have to create rows of drop down lists when the user pressed add more, E.g.: like the ones in mail attachments. I think I have found a way to generate rows, I am not even sure whether it is a correct way, how I generate the rows:
<mx:states>
<mx:State name="newRow">
<mx:AddChild relativeTo="{cityDropdown}">
<s:DropDownList id="newbutton" creationComplete="hotelDropdown_creationCompleteHandler(event)" labelField="Name">
<s:AsyncListView list="{getAllHotelResult.lastResult}"/>
</s:DropDownList>
</mx:AddChild>
</mx:State>
</mx:states>
Now when I generate more rows the dropdownlist ids will conflict, so I want to know a way to generate ids, I think I cant even call a function in there.
View 2 Replies
May 11, 2010
How to dynamically create buttons and assign them names to use later on in the code.? For example:
ActionScript Code:
If(a==3) {
create three buttons:
[Code]...
And then assign some functions for these buttons - like:
ActionScript Code:
but1.addEventListener.....
View 9 Replies
Jun 5, 2011
I am working on a project where I have on the stage 8 movie clips, and when hovered, they are to shake. I have made this into a class, and placed the code as an external .as file.
Each movie clip is named shaker_mc - shaker_mc7
I have also gone in and changed all of the button movie clips base classes to ShakeButton.
Right now I am getting a couple of errors, and I believe all i need to do is pass the buttons names to the class in the external .as file, but I am not sure how to do that? I had everything working without the external script, but I did not want to have to create the effect for each button.
The erros are:
1120: Access of undefined property shaker_mc.
Here is my code for the ShakeButton.as file
ActionScript Code:
package{
import flash.display.Sprite;
import flash.events.MouseEvent;
[Code]......
View 3 Replies
Jul 12, 2011
I was wondering if I had say 10 buttons and I wanted to add them to one event listener, is there a way to set up an array and attach them all to one event listener to cut down on code?
View 1 Replies
Oct 23, 2008
I have a mc with simple btns inside. the mc is on every frame except one,in which I swapped a similar mc (different colors).I have tried leaving the instance name for the mc the same and also changing the instance name to something else but anytime I navigate to that frame, the buttons quit working.I have tried changing both the buttons and mc instance names to no avail.This is on my main timeline:
CrclMnTp_mc.CAbout_btn.addEventListener(MouseEvent.CLICK,
AboutNav, false,0,true);
CrclMnTp_mc.CSamples_btn.addEventListener(MouseEvent.CLICK,[code].....
View 3 Replies
Aug 26, 2010
We've got an Illustrator file with something over 1,000 layers. We're trying to import this into Flash and keep the layer names intact, such that they become the names of the movie clips that are imported for each layer and can be used programmatically. (It is a diagram and arrows, boxes, etc all have callout names that will eventually allow them to link to a database.)As near as I can tell, the Import dialog will NOT pass this info across between the two parts of the dialog.
View 1 Replies
Mar 20, 2011
I started a thread about a reference to a symbol House, in the output window, which was: House_1. A lot of people said some useful things about that. All day I've been thinking about it, and I came to the conclusion that I don't understand things, at a very basic level.
Consider:I make a movieclip which I give the Symbol name Drawer. (I don't export it for AcitonScript.)On the stage I manually place two instances of this Symbol. The first one I give the Instance Name drawer (in the properties panel). The second one I leave nameless.Now if I trace the names of both these clips, by
trace(this.getChildAt(0).name);
trace(this.getChildAt(1).name);
the output window gives me
drawer
instance2
Now I know that the so-called "instance name" which I gave in the Properties Panel (drawer) is, in reality, a variable name which Flash gives my first instance behind the scenes. And instance2 is a name that Flash gives my second instance. What exactly the nature of that name is, I do not know.My point is: both names (drawer and instance2) are the .name property of these movieclips. Otherwise I could not have traced them through asking for the .name property, in the above. Yet only the first of these two can be manipulated:
drawer.x can be set;
instance2.x can (as we know) not be set.
But...why? What is the real difference between these two kinds of names? How can they both be the .name property of their underlying movieclip, yet be of such a different nature? What IS the nature of the instance2 name? If it's a String, how come the .name property of one movieclip can be a variable name, while the .name property of another (but identical) movieclip is a String?
I've searched every bit of web page on the net I could find. But it looks as if nobody addresses this issue. We all just work with it - but it makes no bloody sense. A name property = a name property, you'd think. Whether Flash set it or I set it should not make a difference. The x property of a clip, for example, does not change in nature according to who set it - me or Flash.So, again, just to emphasize the problem: how can a property (the name property) of a movieclip change in NATURE depending on who set it? After it's been set, shouldn't the name property of a clip be of exactly the same nature as the name property of another clip?
View 8 Replies
Nov 10, 2009
I am trying to get the child XML tag names in my AS3 program. For example, I have a file with information like this:
<LocationInfo>
<City>New York City</City>
<State>NY</State>
<Zip>10098</Zip>
</LocationInfo>
I load the file into an ArrayCollection and can access each item I need by name such as
["City"] // Returns New York
Instead of getting the value, what I am trying to do is get the tag name such as State or Zip instead of NY or 10098.
View 3 Replies
Jun 19, 2009
i have some xml that is full of attributes. Without much detail, i would like to translate the xml into objects. However , i need a method that can get the attribute values AND names. Getting the value is a no brainer, but the names are not coming so easy. For example, the following will translate and xml node into an object with a prop and value of the same:[code]in trying this with attributes, i need to first find a way to get the attribute name.
View 6 Replies
Oct 31, 2009
how to change the Gallery names.
View 5 Replies
May 27, 2010
I am trying to create a pretty simple image script for a flash website. What it does is to create a container named mc and then loads in an image into the mc from XML. It goes through the XML file like in a for each loop. But the problem I have is that every image container then gets the name mc. So then now when I try to build the function which makes it possible to press on one of the image containers to enlarge them, it only makes the last image larger since that is the last one to be created with the name mc. So how do I give every movieclip that I create a different name such as mc1, mc2 etc.[code]
View 8 Replies
Mar 14, 2011
I've been seaching on how to get the key names of a flex Array as there is no such function in the Array class. Here is my answer that may be usueful to any of you.
View 2 Replies
Mar 17, 2010
I have a grid 8 columns, 3 rows.I used instance names such as 1-1, 1-2, 2-1, 2-2, ect to easily identify each cell. I can call the movieclips within them without a problem by doing this["1-1"].gotoAndPlay(1); but how do I go about calling them when I can't use "this"? "1-1".gotoAndPlay(1); does not work.
View 2 Replies
May 17, 2010
[code]I want to add some additional XML Names. As "Contact" above is listed. I chose the || (LOGICAL or). [code]My goal is to keep "Contact" as one of the exceptions, where the 3 buttons are removed. But I want to add others... Like "Press" "Showreel" "Background" and "Internship".
View 1 Replies
May 20, 2010
The thing is, I create a grid on the screen, and each of its element is given a name. The question is, how can I access those specific grid's fields by their names? Here's the code:
ActionScript Code:
private function drawGrid():void
{
var startX:uint = 0;
[Code]....
Now, If I wanted to remove, for instance, the box of the 13th row and the 25th column, how can I do that?
View 7 Replies
Sep 29, 2010
I've got another problem (similar to my last), although this time it's movie clip names, rather than variables.[code]I've created some movieclips as such ^ so for each user there are 2 empty movie clips, and now I'm trying to reference to these movie clips, but am having some trouble in doing that, for example:[code]While the last one doesn't bring any errors, it still doesn't seem to work.[code]
View 9 Replies
Jun 19, 2007
I'm attempting to build a menu using a XML. I have read the tutorial on the site and I am attempt to do it in a slightly different manner. Anyways, I am trying to make dynamic variable names for my text fields. And because of the way I am doing this I found it easier to try to use XML to hold the field name. But when I try to use the name from the XML file it won't work. I can trace it and get the proper word but when used in the script it breaks.Below I want to replace 'popMenu' with the fieldName variable.
Code:
mainMenu.menu1.onRollOver = function(){
listLength = menu_xml.childNodes[0].childNodes;
[code].....
View 1 Replies
Nov 24, 2007
How do I concatenate variable names in AS3?Something like this:
for(var i:int=0 ; i<5 ; i++) {
var "myVar"+i:Array = new Array();
}
View 5 Replies
Jan 26, 2009
In the first frame I have 60 buttons with each having a actionscript in it using the instance name "A1". What I need to know is how can I REPLACE the instance name from A1 to B1 in 60 buttons in my NEXT FREAME?
Is there an easy way to do it rather than typing one by one?? I used the "FIND AND REPLACE" option but it replaces A1 to B1 in both the frames. I need to alter the instance name only in the second frame. How can I do it?
View 3 Replies
Apr 26, 2009
I have two buttons, they're both movie clips, and have identical code except for their names. When I place one of each on the stage and give them instance names, they come up output:
[Code]...
View 1 Replies
Oct 22, 2009
Im a relative novice in Flash and Im used to working in CS3. However, I am trying out CS4 to do a change a template that a client bought. Everything is going smoothly for the most part.However, I am not able to change the tab names on the template that she wants. I expected for the text to be on its own layers as seperate rollovers, but I guess somehow they are nested within the button shapes and I cannot locate them. I've been trying to change them for the past 2 days and I have had no luck thus far.I know you guys are some of the best when it comes to Flash. Here is the working template and what I have done thus far. I was able to change the girl's eye color from blue to dark brown and change the default title that came with the template to the name of her business:
View 9 Replies
Sep 14, 2010
How to write the following AS codes using VAR instead of instance names?
my_Input_Txt.onChanged = function() { _root.my_Dyn_Txt5.text = my_Input_Txt.text;_root.my_Dyn_Txt6.text = my_Input_Txt.text;};
_root.my_Dyn_Txt5._visible = false_root.my_Dyn_Txt6._visible = false_root.MDT1._visible =
[code]....
View 7 Replies
Jul 15, 2009
I get the error "Access of undefined property menu_bar" when menu_bar is an instance name directly on the main timeline. I'm not sure how I would call it in the other class. It also isn't exported for actionscript is that the problem?
I have it imported to my document class as:
var mouseClicks:MouseClicks = new MouseClicks();
addChild(mouseClicks);
Then the class looks like this:
Code:
package{
import flash.display.MovieClip;
import flash.events.*;
[Code]....
View 2 Replies
Jan 27, 2010
I'm working on a project using google maps. For part of it the user must enter coordinates and click a button in order to add a marker to a map. The code I have written so far allows this to be done once:
play_btn2.addEventListener(MouseEvent.MOUSE_DOWN, submitdata);
function submitdata(e:Event){
var marker9:Marker = new Marker(
[code]....
As it is the only one marker can be added as it keeps getting replaced. I want to make it so that the variable name changes each time a marker is to be added.
View 2 Replies
Feb 19, 2010
In AS2 you could parse together movieclip names so that you could do things like this - Let's say you have a movieclip (clip1) inside a clip (clip2). You could do:
name1 ="clip" + 1;
name2 = "clip"+ 2;
and then when referencing the lower clip you could do: _root[name2][name1]._alpha = 50;
That doesn't seem to work in AS3, even if do something like
clip2[name1].alpha=.25;
I'm probably referencing the objects wrong, but can anybody shed any light on this? I'm having trouble parsing together paths and object names and it's driving me nuts.
View 3 Replies
Mar 4, 2010
I know I've read something about this here before but I can't find it, so for Mr. Thicky here, I have dragged some buttons on my stage - each one is actually an instance of the same movieclip. In the IDE, I have given them instance names like 'myButton1', 'myButton2' etc. I've then grouped all these buttons together into a single container movieclip called 'buttonHolder'. Now, in my code, I am trying to retrieve the instance name of the button I have clicked on:
[Code].....
View 3 Replies
Jun 3, 2010
I have 100+ of the same movieclips on the stage at the same time, all positioned differently.i'm getting really tired of clicking on one of them, then clicking in the instance name box then typing "i65", then clicking on one of them, then clicking in the instance name box then typing "i66"...
is there anyway flash can fill this information in for you? or a plugin anyone's heard of? this isn't really an actionscript question, I'm not so fussed about selecting the different movieclips based on getChildAt or any of that stuff, I'd just really like a faster way of assigning instance names.
View 1 Replies