ActionScript 3.0 :: Setting Loop Variable For XMl Btns
Jul 8, 2009
I'm trying to set up a loop for a movieclip btn with the instance name "btnEnter". btnEnter is loading XML content from a file called menuDef.xml
Here is the code I have inplace so far,
//CODE//
var link: URLRequest = new URLRequest("menuDef.xml");var loader:URLLoader = new URLLoader(link);var i:intvar myXML:XML = new XML();//call the loaders load function to load the specified URL
[Code]....
Right now I have only the item_spacing and item_count variables in place, but I'm not sure of my next step?
View 5 Replies
Similar Posts:
Mar 24, 2010
I am a newbe to AS3. I have 30 btns/thumbnails which I want to change alpha on when mouse over.For a single button I would code somthing like this:
set1_mc.thumb01_btn.addEventListener(MouseEvent.MO USE_OVER,hooverOver);
function hooverOver(event:MouseEvent):void
{
[code].....
View 9 Replies
Apr 23, 2009
I used to dynamically set some variables using a FOR loop kinda like so PHP Code:
//Sorry, from memory
var possibleValues:Array = ["red","green","blue","yellow"];
for (i=0;i<possibleValues._length;i++){
_root["colorNumber"+i] = possibleValues[i];
}
Second question, using that code in a function would set the variables at the root level making them available throughout the timeline. Without "_root" how do I get that variable available to everything?
View 7 Replies
Mar 23, 2007
I'm planning to implement as sound that will simply play in the background of my site. The sound file is just under 30 seconds in length. Obviously I want this to loop ... can I set it to do so using ActionScript? If so, would you mind providing me with some sample code?
View 3 Replies
Nov 9, 2010
Should I declare the _mcContainer var before the loop or no? (performance increase?)
for(var i:uint = _startIndex; i <= _endIndex; ++i){
var _mcContainer:MovieClip = _mcParent["i_" + _position];
}
[Code]....
View 1 Replies
Mar 2, 2007
I have some code that seems to have a problem. I can't seem to pass the x variable from one loop to within another loop.
Code:
var myLv = new LoadVars();
var myNv = new LoadVars();[code]....
View 2 Replies
Jan 29, 2010
I am having a bit of a nightmare with a site i am trying to build at the moment and would be most grateful for any help. I have a menu bar which is made by looping through an array of the menu options (and submenus) and then attaching a menuitem movieclip in each case (then setting the text). The menuitem movieclip contains a dynamic text field and also actionscript to draw the background depending on the current settings (colour, border etc).I have a variable in my root fla file called menuwidth and this is used within the menuitem movieclip to define the width of the menuitem. When i set this to one value it works absolutely fine and creates the menus accordingly. i can change this to whatever size i want (including calculating the size of the largest option and then setting it to that, to ensure all options fit).
I have been trying to code it so that the menu options can be different sizes (in the event of a horizontal menu) so that you can have one that is wider than another. The code has become quite long (due to submenu and other functionality) but in a nutshell it is:[code]Instead when i use the code above all of the menuitem movieclips end up the same width as tthe final one (so if there are 5 menu options and the starting length is 50 then the ending length is 75 then all of the movieclips are 75 wide). When i try and debug it and check the value of _root.menuwidth inside the menuitem movieclip it states that it is set at 75 every time with no variation at all.It is almost as if it doesn't run the attach movie commands until the loop has finished, at which point all of them execute (and _root.menuwidth has already increased to it's highest possible value), but i can't see how this would make any sense.Obviously there are a number of other options that could be at fault, but i am trying to whittle it down and would be most grateful if anyone could explain to me if the above logic holds true and that increasing the _root.menuwidth value within the loop just before callin attachMovie should cause each one to be progressively bigger?
View 2 Replies
Sep 3, 2010
Here is my site sans looping video: [URL] I am setting my video up to loop. I used the following code:
__________________________________________________ ___________
[Code]...
View 13 Replies
Jan 29, 2010
I have a menu bar which is made by looping through an array of the menu options (and submenus) and then attaching a menuitem movieclip in each case (then setting the text). The menuitem movieclip contains a dynamic text field and also actionscript to draw the background depending on the current settings (colour, border etc).
I have a variable in my root fla file called menuwidth and this is used within the menuitem movieclip to define the width of the menuitem. When i set this to one value it works absolutely fine and creates the menus accordingly. i can change this to whatever size i want (including calculating the size of the largest option and then setting it to that, to ensure all options fit). This works great.I have been trying to code it so that the menu options can be different sizes (in the event of a horizontal menu) so that you can have one that is wider than another. The code has become quite long (due to submenu and other functionality) but in a nutshell it is:
for(var i=0; i<menulength; i++)
curr_item = curr_menu.attachMovie("menuitem","item"+i+"_mc", i);
}
[code].....
View 4 Replies
Apr 13, 2010
If you had a set of buttons called: bt1, bt2, bt3 etc all the way to "bt11" and you wanted to assign the same eventlistener to all of them how would you go about this? ie:
bt1.addEventListener(MouseEvent.CLICK, closeShutters); bt2.addEventListener(MouseEvent.CLICK, closeShutters); bt2.addEventListener(MouseEvent.CLICK, closeShutters); etc (too repetitive)
View 1 Replies
Sep 6, 2010
I have a script which dictates alpha on rollout and onroll but I want to set a default alpha setting for images which are loaded via xml. Here's a tidbit:
[Code]...
I've tried combinations of tn_group["tn"+i].tn_button.tn_pic._alpha = 85; and such but I'm still a big newbie
View 2 Replies
Feb 18, 2010
coypaste an AS3 bnt code to use in-conjunction with a Dreamweaver frameset.
View 10 Replies
Jun 30, 2009
I have a series of mc's I'm attaching from the library, with buttons in the main movieInside each of the attached mc's is a close button that needs to close the attached mc and launch a function in the main movie, but I'm having trouble addressing the button inside the attached mc from the main timeline.I've tried this:
Code:
calloutHolder_mc.attachMovie("mar01callout", "callout_mc", 0);
calloutHolder_mc.callout_mc.close_btn.onRelease = function(){
[code]......
View 0 Replies
May 26, 2009
I have several external loaded with related buttons. However, I want the loaded flv removed when other buttons click. I s there any way to do it?
View 6 Replies
Dec 2, 2010
I have 35 movieclips, named s1, s2, s3 etc, depending on the value of currentDisplay, I would like to set a movieclip visible property to true while the others are set to false, I have tried the following:
Code:
for (i=1; i<36; i++){
trace(i);[code]....
but I receive an error message: 1083: Syntax error: dot is unexpected. I assume it is referring to the dot before visible.
View 1 Replies
Apr 25, 2007
I am doing a Flash header where button text and links has to be easily configured by the owner, so i'm thinking the smartest way is to load button text + link from an xml file.There will be 7 horizontal buttons. The name of the button will be loaded into a dynamic textfield i guess, but what about the link?Im fairly sure it's possible to make an animated button and load an html link into it's Actionscript... but how?My XML would look like this:
Code:
<?xml version="1.0" encoding="UTF-8" ?><buttonsDanish>
<forside name= "Forside" url= "http://www.whatever.biz" />
[code].....
View 1 Replies
Dec 18, 2009
I can't figure out how to set a boolean variable to 'true' if someone clicks a checkbox. Help, please. I'm working on AS2, btw.
View 1 Replies
Apr 4, 2007
Flash 8 duplicating movie clips and setting 3 nodes from XML. I am trying to read in an xml with 3 parameters; 2 links and one text field for a caption. What am I doing wrong this time?
[Code]...
I am trying to have "bMC" load into and repeater for however many XML props there are. within "bMC" are two MC's that on click would open window or grab file and One Text field which would load in caption. For some reason the "bMC" isnt even loading at all. Attached is the .Fla
View 2 Replies
Jul 23, 2009
I'm trying to get some accordion style btns to close if the mouse leave the stage.here's the code I have in place thus far:
stop();
stage.addEventListener(Event.MOUSE_LEAVE, closeall);function closeall(event:Event):void {
if (btn1.currentFrame != 0) { btn1.gotoAndPlay(10); } if (btn2.currentFrame != 0) { btn2.gotoAndPlay(10); } if (btn3.currentFrame != 0) { btn3.gotoAndPlay(10); } if (btn4.currentFrame != 0) { btn4.gotoAndPlay(10); }
}
If my cursor leaves the stage nothing happens?
View 1 Replies
Jun 12, 2010
does setting the fixed property of a Vector to true before entering a loop is better for performance?
View 6 Replies
Mar 23, 2009
How do I set/access the "Text File" variable as shown in the two pictures. _root and _global don't work.I also tried to access it from _root.CrosswordPuzzle.cp_words_textfile.I don't get components.
View 1 Replies
Nov 21, 2009
[Code]....
What I am trying to do is create a root variable that can simultaneously equal a range of numbers. But I cant use the for command because the variable it will assign will only be confined to those brackets and can only be pulled from code inside the brackets
View 1 Replies
Nov 12, 2009
my string LINK at the end of the script is undefined it should change when i select the categories with my combo box
here is the xml :category.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<slideshow>
[code].......
View 4 Replies
Jun 3, 2010
I'm using createTextField to create a textfield. I have also created a input textfield with a variable called textline1 (I don't create the inputfield with as).I want to display the letters in the created textfiled that I'm typing in the input field. So this in my AS coed:
_root.createTextField("text1",1,100,100,300,100);
text1.variable = textline1;
format1 = new TextFormat();
[code]........
View 3 Replies
Dec 4, 2009
How could I set a Flash (Actionscript 3) variable using javascript? Or is it possible to call a flash function with parameters from javascript? I have tried ocument.getElementById('flash').SetVariable("data", "asdf");but it only works in AS2 and AS1.
View 3 Replies
Feb 8, 2010
I have loaded a movie clip from the library using the addChild Method. Now, from withing the main timeline of this loaded movie clip I'm trying to set the value of a curScore variable on the stage.
Code:
MovieClip(this.parent).curScore += 10;
Doesn't work...
View 0 Replies
Aug 3, 2010
trying to get a variable set so that I can use it in another class.I am trying to set the class variable animate. My "intended" goal is that I am trying to load in an external SWF file that is a pulley In this external SWF file I have a function that stops the animation called "stopAnimation()". I want to be able to access this stopAnimation function in a couple of class files. So I pass this object to those classes and then I should be able to access the stopAnimation() function from where ever but I cannot seem to get the contentloader info into a class variable in order to call it from other objects.
Here is the code
PHP Code:
package com.ahicks.assets{
import com.ahicks.Main;
import com.ahicks.Trace;
import com.ahicks.ndTween.easing.*;
[code]....
View 0 Replies
Oct 26, 2004
PHP Code: azar pin:Number;pin=1234; enter_btn.onRelease = function(){if (pin=input_pin) {gotoAndPlay(3)}} It's a cash machine demo, if you were wondering about the "pin" variables. Basicaly there is an input textbox with the instance name "input1" and the "var" setting is "input_pin" the button has the instance name "enter_btn". If the pin number = pin number typed in, go to frame 3. But it dont work...
View 8 Replies
Apr 23, 2006
I am using laco tweening prototypes http://laco.wz.cz/tween/ and have a little problem which im sure is easy to solve, but i just dont know how...
I have e.g 3 movieclips which i want to animate with a rollover from 3 different buttons - btn1 animates mc1, btn2 animates mc2 etc.
Each mc has the same animation (3 tweens - x,y and rotation) so i have set up a function for the three tweens using a variable for the mc name:
[Code]...
View 9 Replies
Jun 1, 2009
im trying to set up a variable passing system where once the user clicks a button it sets a variable and then once the movie hits a certain frame an if statement checks the variable and sends the user off in the direction depending on what the variable is.
here is the code on the button
on(release) {
set("global", "variable1");
}
[Code]....
the code seems to be working on the first part as the movie goes to the "here" part but i cant get it to go to the "thisplace" section.
View 6 Replies