ActionScript 2.0 :: Setting And Then Checking Against Variables?

Jun 14, 2005

how I could somehow create an "if then" statement with variables for my website.

Basically I just want to have a button that checks for a certain variable when you click it (I want it to check if a movie, lets call it "movie1" is already loaded). If it comes back false, then movie1 and movie2 both get loaded.

This way, after movie1 is loaded for the first time, it wont be loaded again. Basically, movie1 is just my background for all my other movies. So clicking button1 for the first time would load movie1 and movie2. Clicking button2 AFTER button1 was clicked would only load movie3.

View 1 Replies


Similar Posts:


Checking Variables With If (varibale = *)

Oct 20, 2010

why this code works on my other flash file and it doesnt on the new one. This is the code:

if (test == "PRIZE1"){
trace ("prizes/prize1.jpg");
}

[Code].....

Basically it should check whther the variable has any of the above words loaded on it dynamically so that it loads a movie that corresponds to it. I put the trace on the above so I can track whther it was reading or not. Obviously it wasnt. My publish settings are Flash Player 8 with Actionscript 2.0

View 4 Replies

ActionScript 3.0 :: Checking For Variables?

Feb 5, 2010

Each button has 3 different animations on the same timeline: one for when you mouseover, one for when you mouseout, and one for when you click. Each animation ends with a 'stop();" command, obviously. However, when someone mouses over, then out of a button quickly, it interrupts the "over" animation and begins the "out" one, which looks choppy and awful. I need a way that when I mouseover a movie clip, a variable within said clip changes to 0, and when I mouseout, it changes to 1.

The big problem comes with the fact that I have multiple buttons with listeners, all of which use the same generic function to respond to mouseover/mouseout events. Is there a way to set up a variable associated with each button, then call the specific variable within the generic function?

ActionScript Code:
button1.outcheck = 0;
button2.outcheck = 0;
button3.outcheck = 0;

[code]....

Is there a viable solution, or will I have to just rethink the entire animation?

View 3 Replies

ActionScript 3.0 :: Checking Several Variables In An If Statement?

Sep 20, 2010

I've just been searching the internet for some code to check several variables in one big If Statement, I just wanted to double check here whether the code I found is correct! Is it right to type it like this?

[CODE].....

View 2 Replies

ActionScript 2.0 :: If Statements Checking Variables?

Sep 16, 2005

I'm having the hardest time getting this to work, I have the concept of how things need to be put together, but the code is wrong. I can't even get the first if statement to work.I have a menu that is going to be loading external swfs into an empty mc. It needs to check to make sure the external swf has gone through its stopping animation before loading something else. Here's what I've got so far... I hope this is clear enough...button:

Code:
on (press) {
//check if this is the first mc being loaded

[code]....

View 6 Replies

ActionScript 2.0 :: Checking Multiple Variables Through MovieClips

Aug 22, 2010

I am trying to check through all of my movie clips to see if any of them are on frame 15 so that I can play them. This is my current code

Code:
anybtn = [btn1_mc, btn2_mc];
btn1.onPress = function(){
if(anybtn[0, 1]._currentframe == 15){
trace ("MC check is working.");
anybtn.play();
[Code] .....

I would also like to figure out a way for the button i click to wait to play the movie clip after the anybtn movie clip is finished playing. Overall I am trying to achieve a menu that works similar to this [URL]. So that it will finish playing the first clip before loading the next.

View 4 Replies

ActionScript 2.0 :: (MX 04 Pro) Setting Variables For An Mc?

Dec 12, 2004

What i need is to set some values for a few movie clips and then use them all at once. Eg, i'll have 5 mcs in my movie, each with either variable = 1 or variable = 2 etc assigned to each of them differently. Then i want to run some code kinda like

if (the variable on mc_one < 4){
do some stuff
}

Im not sure if im going about it the right way, but i think its fairly obvious what im trying to do

View 5 Replies

ActionScript 2.0 :: (MX 04 Pro) Setting Variables For A Mc?

Dec 12, 2004

What i need is to set some values for a few movie clips and then use them all at once. Eg, i'll have 5 mcs in my movie, each with either variable = 1 or variable = 2 etc assigned to each of them differently. Then i want to run some code kinda like

if (the variable on mc_one < 4){
do some stuff
}

View 5 Replies

ActionScript 2.0 :: [F8] Setting Variables From External Txt?

Feb 20, 2009

I am trying to control some of the global variables in my script through an external text file.I have a variable called "_global.scrollOrNot", which determines whether I want flash to use the text window with a scroll-bar or the one without a scroll-bar. I am trying to control that through an external text-file called "ScrollCommand.txt". Here is my code:

the external txt states:

&sb1WindowScroll=yes
frame1:
_global.scrollOrNot;

[code]....

this is were I have a problem. It will always choose "MCtextFeldSB1noscroll". I have tested the whole thing with other variables, which were not changed by any LoadVars function and it works just fine then. As soon as I change the variable using the LoadVars function it will not work any more.

View 2 Replies

ActionScript 3.0 :: Setting Variables In A FOR Loop?

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

ActionScript 3.0 :: Setting Variables In Different Classes?

Aug 13, 2009

I am trying to set the variable to classes in the loader like this

loaded_swf.content.classname.code = "AS3";

But that wont work for some reason?

View 1 Replies

Flash8 :: Setting Up Variables In Different Levels?

Dec 25, 2010

Actionscript Code:
if (Key.isDown(attack2Key)&&shot2reload == 0) { for (i=1; i<2+1; i++) { shot2++; shot2reload = 30 var newname =

[code].....

View 1 Replies

Actionscript 3 :: Setting Flash Variables Not From VB?

Oct 9, 2011

I'm trying to pass flash variables to SWF file from my VB application.It worked in AS 2.0 using:SetVariable method of ShockwaveFlash object but it doesnt' work in AS 3.0.

View 2 Replies

ActionScript 3.0 :: Setting Variables To Parent?

Feb 8, 2010

I have loaded a movie clip into the "root" from the library using addChild. Inside this loaded movieclip, I need to populate a variable, but this variable is in the main time. The value must be sent when the user click on the clip that has been loaded. I have tried the following using a mouse click event listener.

MovieClip(this.parent).currentScore = 20;

but it won't work.

View 6 Replies

ActionScript 2.0 :: Setting Variables With Checkbox?

Dec 18, 2009

let's say 30. they are nothing less than colors of different shades/tints. firstly i need to randomize the loading of one of those movieclips when i push a button and secondly i want to control that randomization with a couple of check boxes. let's say i have a first row of checkboxes which control the particular color that is going to beoaded(red,green,yellow,blue) and a second row that controls the shade(extremely dark,very dark,dark,light dark,neutral,light bright,bright,very bright,extremely bright). for instance if i choose yellow and green from the first row of check boxes and neutral and light from the second row i want the movie to load randomly yellow and green movieclips with those particular shades(neutral and light).

View 2 Replies

ActionScript 3.0 :: Setting Variables For Timer Function

Jan 1, 2011

I'm making an animation of calculating a projectile motion with air resistance based on Python code from [URL]. I include the relevant portions of codes as follow. I'm not familiar of the vector object in AS3 so I translate them into variables as follow:

Actionscript Code:
//timer related variablesvar
fps:uint = stage.frameRate;var interval:Number = 1/fps;
var myTimerYes:Timer = new Timer(1000/fps);
//air resistance timermyTimerYes.addEventListener(TimerEvent.TIMER, startSimYes);
function startSimYes(e:TimerEvent):void{
[Code] .....

The timer activates when the user clicks the start button. The start buttons set the variables for the timer function. The variables are created at the start of the actionscript file. The code of the start button is:

Actionscript Code:
start_btn.addEventListener(MouseEvent.CLICK, goTimer);
function goTimer(e:MouseEvent):void{m = int(airText_mc.mass_txt.text);
A = int(airText_mc.refA_txt.text);
Cd = int(airText_mc.Cd_txt.text);
rho = int(airText_mc.density_txt.text);
[Code] .....

The result I get is the aX = 0 all the time, even after the update I specified in the timer codes. I can't understand what's wrong with the code, it's supposed to be updating every time the timer goes on.

View 1 Replies

Flex :: Setting Variables During Component Initialization

Oct 25, 2010

I am loading a component which makes a HTTPService call to get data that will then be used to set certain variables in the component. I make the HTTPService call in an init() function (for the initialization event) and then set the variables according to the data received in the HTTPService result handler. However, the variables are still null at both the initialize stage and at the creationComplete stage. If I try and read the variables in a creationComp() function (for the creationComplete event), those variables are still null. Is this correct?

I guess I don't understand the flex initialization cycle very well. When are those variables actually set and available to be used? I need to manipulate those variables automatically after the component loads. Is there an event that comes after creationComplete that is appropriate or some other way to approach this? I am using Flex 3.

View 2 Replies

ActionScript 3.0 :: Setting Multiple Variables Dynamically?

Nov 10, 2009

I've automated a lot of my script, but cannot automate the very beginning where one sets the variables. I have the following script that I'd like to put in a "for" loop :

private var aliPlane1:Plane3D;
private var aliPlane2:Plane3D;
private var aliPlane3:Plane3D;

[code]......

View 9 Replies

ActionScript 2.0 :: Setting Flash Variables From Javascript

Jul 7, 2004

Does anyone know the correct syntax for setting a variable on _root using Javascript?

The Macromedia site says:

<!-- javascript
movie.SetVariable("/:varname", "varvalue");

However, this notation is quite old. I haven't been able to get it to work.

View 1 Replies

ActionScript 2.0 :: Using Set And Eval Functions Setting Variables?

May 12, 2006

I'm having problems in setting three variables using a for loop and then passing these variables to my function. I think it's something to do with the set function I'm using, because my colorFadeTo function claims it's being passed an undefined variable.

Code:
for (var i=0; i<circles.length; i++) {
var current = circles[i];

[code].....

View 1 Replies

ActionScript 2.0 :: Setting Variables In A Loaded Movie

May 22, 2003

Can anyone tell me how to set variables in a child movie from a parent movie?[code]but it doesn't work!txtChild is a variable in the child.swf movie. (A dynamic text field with instance name "ChildText")

View 1 Replies

ActionScript 3.0 :: Setting Global Variables Within MovieClips

Dec 9, 2010

I'm working on a Flash game (AS3) and have come to a point where I need to change the value of a global boolean variable from within a movieclip. After searching all over I have yet to find a solution. Essentially, the problem is that I have a movieclip that contains a section of animation for my game. When this movieclip is told to begin its animation, it checks these global variables to see which of six animations to play. When it finishes any of these animations, I need to set the associated variable and increase the score.

View 2 Replies

ActionScript 2.0 :: Setting Flash Variables From Javascript?

Jul 7, 2004

Does anyone know the correct syntax for setting a variable on _root using Javascript? The Macromedia site says:

<!-- javascript
movie.SetVariable("/:varname", "varvalue");

However, this notation is quite old. I haven't been able to get it to work.

View 1 Replies

ActionScript 2.0 :: Setting Variables On Press And Release?

Oct 14, 2002

I am trying to create a scrolling text section for a cd-rom I am creating.I have created buttons for the scroll up and scroll down and so far all I am able to get is a click click click to scroll up and down 1 line at a time.Would prefer to make a loop so when you hold down the button it "scrolls" until you release.Have had no luck in setting variables on press and release.

View 6 Replies

Actionscript 3 :: Setting Multiple Variables Of An Object In An Array Possible?

Jan 25, 2010

Right now, I have many MovieClips's in my array. I want to update all the alpha values of the MovieClips in my array. Right now, I am using a for loop but this is not the fastest way to do it.

View 3 Replies

Flash :: Actionscript 3 - Setting Color Of Variables In A String

Nov 29, 2011

I'm pretty new to Flash and I'm struggling with defining the text-color of a variable within a compound String. Here's what I have so far:

[Code]...

View 1 Replies

ActionScript 2.0 :: Setting Variables Using Input Text Boxes?

Oct 27, 2004

Setting variables. Have a look at the file. Current height and width are both set at 200. I dont think i got the scripting right, or it may be in the wrong place.

View 4 Replies

ActionScript 3.0 :: Setting Flash To Demand Type On Variables?

Dec 2, 2009

Being a code purist, I always set Flash to demand that I declare all variables/functions with a type. Like this:var myVar1:int = 14; //Okvar myVar2 = 18; //Compiler ERRORMy problem is that I just reinstalled my computer (including Flash) but I've forgotten where I do this setting. Anyone here with a better memory than me?

View 4 Replies

ActionScript 2.0 :: [CS3] Setting Variables Through Button Press For Scripted Animation?

Jun 3, 2009

getting the following working:

Code:
stop();
import mx.transitions.Tween;
import mx.transitions.easing.*;

[code].....

What's supposed to happen is when you click button "go_0", the object "square" will animate moving down.

View 2 Replies

ActionScript 2.0 :: Setting Array Values To Variables In Another Array

Dec 11, 2007

I have some variables created on the main timeline and a mc called options which will be where those variables can be manipulated. A way I've tried to this is by creating a first array(array1) and populating it will all the variable names found on the main timeline, and another array(array2) containing the values of the variables the user has changed(which are displayed on some dynamic text fields). To make these changes, an "apply" button is pressed which will set the values found in array2 to the variables in array1.[code]How would you do this so that var1, var2... are updated properly according to the values found in array2?And because array2 contains strings(read from dynamic textfields), how do you deal with that since var1 and var2 are numbers?

View 6 Replies







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