ActionScript 2.0 :: Setting Variable Retrievable By Other Layers

Sep 8, 2006

How do you set a variable so that other layers can retrieve that variable.
PHP Code:
nick.onPress = function (){
set.my_txt = "nick";
gotoAndPlay(2);
trace(get.my_txt); // This does return "nick"};
// Then in another layer after the animation :trace(get.my_txt);
// this returns undefinedmaintextarea.text = get.my_txt + "'s Portfolio";

View 10 Replies


Similar Posts:


Actionscript 3 :: Setting Multiple Depth Layers?

Sep 30, 2011

I get how to set depth in as3 - but with as2 i could begin multiple 'depth points' using numbers - where in as3 all i can seem to do is set this object to a higher/lower depth than that object. The problem is (when dealing with a stack of isometric boxes, which can be placed by the user on a grid in any order) i don't want to deal with the added complexity of having every element know where every other element is, then adjust appropriately.

What I'm trying to do is set up 6 total depth numbers/positions, one for each column in a 6 x 6 grid. So anything in column 1 will begin it's depth placement at say 500, anything in column 2 will begin its depth at 1000, column 3 would be 1500 and so on.

That way, the second i place an object on a particular column, it would tuck itself under, or place itself above all surrounding items in other columns, this to me is much much easier than somehow figuring out where 15 different sized boxes are, how they relate to one another, then figure out what depth order they need to go in. as3 seems to have removed the ability to set a depth to a specific number.

View 1 Replies

ActionScript 2.0 :: Setting Frame Rates For Individual Layers In Flash?

Jul 18, 2007

Is there a way where I can compile or build different frame rates into the various layers I create using an action script?? I.e. If there are say six layers running in a particular player, each layer should be running at a different frame rate, independent of each other

The problem am facing is am playing multiple media content in multiple layers (masked, so that it appears as if all the layers are playing in the same level) and each media content played in different layers needs to be played at a different frame rate to get a good visual effect!

View 4 Replies

ActionScript 2.0 :: Access Variable Value In Other Layers ?

Oct 18, 2010

i'm making a menu with flash cs5 using actionscript 2.0 for my game that can be use scaleform menu made it with flash, i have a little problem.

i have a layer called "action" in my timeline where is a function that receives from my game a variable value (slot) that indicates to the player if the slot is available to save a game or not.

i have another layer called "newgame", where are some controls, pictures and movie clips, when the player click on the marker in this layer, i need to load the "slot" variable from the layer called "action" to let the player save or not save the game, but i can figure out on how to get the value for the slot variable from the Action's layer.

i have tried with this:

Code:
stage.actions.slot1;
stage.slot1;
_parent.actions.slot1;

[code]....

View 5 Replies

ActionScript 3.0 :: Root Variable Not Accessible In Child Layers

Dec 2, 2010

I got a variable "VideoFolder" well defined in my root level. However when I used this variable directly in child layers, my script does not recognize it and I get error 1120: Access of undefined property VideoFolder. I tried changing VideoFolder with _root.VideoFolder in all my child layers scripts, but it changes nothing.

View 2 Replies

Setting A Variable With A Checkbox?

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

ActionScript 2.0 :: Action Scripted Layers Always Act As Top Layers?

Sep 10, 2005

the snow effect always acts like the top layer, ok what i mean is, i have 3 layers, (1)toplayer= a car, (2)middle= snow, (3)low= background.I want to make the snow to be seen behind the car...i hope you understand what i mean , whenever i put the code from the link above it acts as the top layer and appears in front of everything.

View 4 Replies

ActionScript 2.0 :: Setting A Component Variable

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

ActionScript 2.0 :: Setting A Range Variable

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

ActionScript 1/2 :: Setting Value In A Variable Via A Combobox?

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

ActionScript 1/2 :: Setting Variable On A Textfield?

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

AS3 :: Setting Flash Variable With Javascript

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

ActionScript 3.0 :: Setting Variable From Child?

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

ActionScript 3.0 :: Setting A Class Variable?

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

ActionScript 2.0 :: If() Statements And Variable Setting

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

ActionScript 2.0 :: Setting Variable On Rollover?

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

ActionScript 2.0 :: Setting And Passing A Variable?

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

ActionScript 2.0 :: If() Statements And Variable Setting?

Oct 26, 2004

Here's the problem

PHP Code:
var pin:Number;pin=1234; enter_btn.onRelease = function(){if (pin=input_pin) {gotoAndPlay(3)}} 

[code]....

View 8 Replies

ActionScript 2.0 :: Setting Variable For Input Text?

Sep 1, 2009

I need to create a Flash Quiz with the following:

1.) A page with a question, including a "submit" button, and an Input Text field where the user can type in his answer.

2.) A page with "Correct" and a page with "Incorrect".I have already gotten the pages and graphics created. But for the life of me my Action script is not working. The tutorials I have looked at would help me if I were making the quiz one total page where when you answered the question there would be a comment that came up, but that's not the case.

View 2 Replies

Flash Movie With Two Frames - Setting Variable?

Jan 25, 2010

I have a flash movie, which has two frames and constantly loops. On the first frame I have set my variable, and on the next frame I make it add 1 to that variable. Thing is, the variable is currently being set to "0" on frame one, added one, then set back "0" again as it goes back to the first frame. Is there a way, without adding extra frames to set a variable on Load but then to not set it again?

My actionscript is like this:
Frame 1:
count = 0
Frame 2:
count +=1

View 2 Replies

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

ActionScript 3.0 :: Setting A Variable From A Symbol Definition?

Jul 15, 2009

I have a navigation bar movieclip that has the following EventListeners in symbol definition:
 
news_btn.addEventListener(MouseEvent.CLICK, clickHandler);function clickHandler(event:MouseEvent):void {event.target.root.gotoAndStop(1,"newsawards");
event.target.root.categoryName = "Transportation" <<<DOES NOT WORK}

[code]....

View 3 Replies

ActionScript 1/2 :: Setting Maximum And Minimum Value For Variable

Jun 30, 2010

How do you set a max and min value for a variable? I have defined a variable, myVar, to have a default value of 10 at run time. The user can then use buttons to increase and decrease the amount. How do I set the limits?

View 1 Replies

ActionScript 3.0 :: Setting Variable To True Or False

Feb 17, 2011

Are you aware how to set a variable to true or false in AS3;
I tried
Code:
var flip:void = true;
But this is not recognized by AS3.

View 5 Replies

ActionScript 2.0 :: Getting Labels Framenumber Without Setting Variable?

Jul 15, 2004

I have one timeline with two labels; "Sound" & "Mute". Is it possible to get the labels framenumber without setting variables as the movie plays? I need to "get" the framenumber directly when the movie is loaded.

In words if that makes it easier:
When movie is loaded
Get framenumber for label "Sound"
Get framenumber for label "Mute"
Done

View 4 Replies

ActionScript 2.0 :: Duplicating MovieClip - Setting X (Variable) Value

Feb 27, 2006

I have an MovieClip star with a setup var X which is set to 0 for the thing I'm duplicating, namely star

===Star======
onClipEvent(load){
x=0;
}

If I duplicate the clip a bunch of times so I have Star0....N. Is there a way to set the x value here to the i value of the loop for each object duplicated. Such that star0 will have its x=0, star2 has its x=1 and so on.
setProperty wont do it or _root["star"].x=i;

View 1 Replies

ActionScript 2.0 :: Setting Value Multiple Strings In A Variable?

Dec 3, 2006

i have long string values how do i set it up ... like this

var longString:String = "Lorem Ipsum is simply dummy text of the printing and
typesetting industry. Lorem Ipsum has been the industry's standard since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. ";

View 1 Replies

ActionScript 2.0 :: [Flash8] Setting An External Variable?

May 10, 2008

how I can declare a variable that is retrievable when the browser reloads.

View 7 Replies

ActionScript 3.0 :: Flash - Setting A Variable In A Textfield?

Aug 31, 2010

I want to do something like this, is it possible to set a variable in a textfield?Pop this in a new Flash file and you'll get an error.

Code:
var blah_txt:TextField = new TextField;
stage.addChild(blah_txt);

View 3 Replies

ActionScript 2.0 :: Setting And Concatenating Variable Values?

Jul 24, 2009

I&#65533;m calling a ColdFusion page that generates output in the form of a text file to be used in a scrolling dynamic text field.So, Instead of calling a text file like so:

//calls a static text file
loadText.load("StaticTextFile.txt");
Im calling a ColdFusion page like so:

[code].....

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved