ActionScript 2.0 :: Accessing Variables - If-statement Has Been Activated, _global.var1 Is Still 0 When I Trace It In Frame2?

May 25, 2004

I am making a jigzaw and when all the pieces are put in the right place, another movie clip will be played.All pieces are buttons placed in different movieclips. The movieclips are then placed in scene 1.

In frame 1, I've written
_global.var1=0;

In frame 2, I've put movieclip1, and in movieclip1 I've placed button1, with the following actionscript:

on (press) {
startDrag ("_root.movieclip1");
}[code]..........

However, when the piece is in the right place, and the if-statement has been activated, _global.var1 is still 0 when I trace it in frame2.

View 3 Replies


Similar Posts:


ActionScript 2.0 :: _global Variables Disappear - "undefined" In The Trace?

Jul 2, 2009

I loaded and then trace my _global variables for three screens and they follow me fine until,. then on the the screen i have tiny bit of code:

[Code]...

Could it be the level 99 I use. I tried using 0 and it did not work? I have tried doing this for way too long,

View 0 Replies

Regex :: Flex - Extracting Variables From A String Like /var1/var2/var3/?

Aug 4, 2009

I need to extract in actionscript the variables from a string like /var1/var2/var3/...Each variables can be characters or/and number and variable size.My current regex /(w+)/g work for the first variable but not for the others.

var matchExpression:RegExp = /(w+)/g;
var match:Array = matchExpression.exec(browserManager.fragment);

View 4 Replies

ActionScript 2.0 :: [MX 2004] Access _global Variables Between Domains?

Apr 6, 2005

Is there or is there not possible to access _global variables between domains? on [URL] i have index.html and index.swf. Index.swf then loads main.swf from [URL].In index.swf i have a _global variable that i want main to use. When calling for it all i get is undefined. The only way to access it is if i call for it using _parent or _root.

I have allowed the domains to communicate using

System.security.allowDomain("http://www.Domain1.com");
System.security.allowDomain("http://www.Domain2.com");

I have also put a crossdomain policy file on both servers..cross domain policys since i CAN access the variables and functions using _parent and _root...or is it?

View 7 Replies

Actionscript 3.0 :: Trace Statement Firing Twice

Mar 24, 2010

When I run this code, I get to click on either the container "Big Box" or its contents "Poly". The associated trace states should fire but look at the tracer on "Poly" it fires twice. Why? [code]

View 2 Replies

Actionscript 3 :: Change The Color Of A Trace Statement?

Mar 10, 2010

i suspect the answer here is "no", but i'm wondering if it's possible to set the color of trace statements which appear in flex's console pane. ie, i have a few "levels" of log statements, and i'd like the warnings and errors to really stand out.

View 2 Replies

Actionscript 3.0 :: Flash Trace Statement Evaluation?

May 2, 2011

Flash is returning decimal floating point formats in evaluation results under the IEEE 754-1985 format.I looked it up and this seems to be how ActionScript 3 was designed to follow that standard which creates these results.This doesn't happen in the ActionScript 2 compiler. It only happens under ActionScript 3, paste these trace statements and compile so you can see what I mean:

Code: Select alltrace(48.48 + 0.01) // returns 48.489999999999995

trace(18.48 + 0.01) // returns 18.490000000000002

this one is ok: Code: Select alltrace(18.49 + 0.01) //returns 18.5

I need a two decimal place precision result as this is for an algorithm that I'm trying to use to round up or down by a penny so I can't simply convert it to an integer but there's no pattern that I can see so I can predict results for it either.I can't have a $18.8999999999995.

View 2 Replies

ActionScript 2.0 :: Get No Trace Statement Or Loaded Clip?

Nov 22, 2004

Trying to get a MovieClipLoader to work for me... This code is taken pretty much right from Macromedia's Help file. I get no error messages (yay), but I also get no trace statement (boo) or loaded clip (boo2). There *is* a clip named audioplayer.swf in the same directory as my file.

[Code]...

View 2 Replies

ActionScript 3.0 :: Timer Function - Trace Statement Not Working

Oct 23, 2009

I am having a problem with the if statement in my timer function, the trace statement within in it is not working, eventually I wanted to use this if statement further but need to make sure it is working first.

Code:
timerFunction();
} function call in function above
function timerFunction() {
trace("hey");//this trace works
var myTimer:Timer=new Timer(1000,15);
[Code] ......

View 8 Replies

Actionscript 3.0 :: Trace Statement Not Working In Document Class

Jan 27, 2009

I am new to actionscript and just like some of you, I would like to start off on the right foot. After several attempts to solve this problem I am now taking a break and reaching out to those in the community. I have created a .as file named Main.as and the code inside main.as is:[code]then i created a new fla file and named it testas. I then typed Main in the Document class under properties.The code has no errors and when I attempt to test the movie, there is no output to the output panel.

View 7 Replies

ActionScript 2.0 :: XML - Make The Final Trace Statement Work?

Oct 17, 2006

I have the following code in the main timeline:

[Code]...

how to make the final trace statement work?

View 5 Replies

ActionScript 2.0 :: Stage Height In Flash - Run A Trace Statement?

Dec 1, 2008

Is there a bug with stage height in Flash? Every time I use that and run a trace statement, it's wrong.

View 1 Replies

Flash :: AS3 - Print Current Class In Trace Statement For Debugging?

Mar 3, 2010

Is there a statement in AS3 that will return current class and/or scope? I'd like to use that in trace statements so that I know the exact location of a trace.

View 2 Replies

ActionScript 3.0 :: Switch Statement Not Executing Trace Commands From OnClick Event

Sep 10, 2009

3 buttons are called to the stage, and each button has an eventlistener that listens for a Click event. A switch statement is used to trace the clicks, but the only message i get is from the "default message"?[code]...

View 3 Replies

Flash :: Accessing Movieclips Within Movieclip Using For Statement?

Nov 1, 2011

I am trying to access movieclips within my movieclip using a for statement. To try and make this clear, here is how it looks at the moment:

sections = Holder movieclip where dtf_sections is placed, as well as other clips that are needed.

dtf_sections = Where all the title movieclips are placed that are going to be used when called. Placed in here to make it easier to move, within sections

title = Movieclip that contains the text that needs to be changed, within dtf_sections

Here is my code that works:

sections.dtf_sections.title1.dtf_title.text = "Section 1"

There are upto 10 titles within dtf_sections. So, what I thought would work is this:

for(var i:uint=1; i<10; i++){
sections.dtf_sections.["title"+String(i)].dtf_title.text = "Section" +(i)
}

The reason why they are within the movieclips is masking, and appearing at different times.

View 1 Replies

ActionScript 2.0 :: _global SetInterval - Change To A "local" Function Instead Of "_global"

Sep 2, 2003

I have my setInterval that is set this way:

[Code]...

I was wondering how I might change this to a "local" function instead of "_global". I've been trying, but my syntax is either screwed up or just just plain doesn't work.

View 13 Replies

ActionScript 3.0 :: Accessing A Static XML Variable From Within A Switch Statement

Jun 1, 2009

In the following class

Code:
package
{
public class Factory
{

[Code]]....

A break point on the "Okay" line shows that x1 is null but x2 is equal to "<entity id="DRONE" points="100"/>".

If I take the whole block out of the switch statement, both x1 and x2 are equal to the expected xml.

View 6 Replies

ActionScript 3.0 :: SendAndLoad - Var1 Is Undefined?

Dec 23, 2009

I try make work a simple sendAndLoad but I got a strange answer from server!

AS3-PHP.fla :

ActionScript Code:
var var_put:URLVariables=new URLVariables();
var_put.name1="John";[code].........

First var1 is undefined, second it's strange to see a part of the html page.I read other examples which looks like to mine, I don't know what write more to make it works.

View 7 Replies

ActionScript 3.0 :: "If" Statement Into The OnClipOver Function - Trace What Specific Button Is Being Pressed

Apr 8, 2011

I'm making the transition from AS2 to AS3 and have some rollover and rollout code below. I'm looking to place an if statement into the onClipOver function that can trace what specific button is being pressed. In AS2 I would use the "this" command to see which movieclip was being used. how to properly write the IF statements using AS3 in the code below.

[Code]...

View 2 Replies

ActionScript 2.0 :: Way To Add Variables In An If Statement?

Jul 15, 2009

I'm about to start a game/quiz project where the user must click several buttons, one after another (though not in any special order) to answer a question:[code]Is this the right approach and way to add variables in an if statement?

View 1 Replies

ActionScript 3.0 :: Dynamic Variables - Undefined On The Last Trace

Mar 7, 2010

[Code]....

I do not understand why i am getting undefined on the last trace.

View 7 Replies

Trace All Movie Clip Variables And Functions?

Jan 21, 2010

How can I trace all available Movie Clip variables and functions?

View 5 Replies

ActionScript 3.0 :: Possible To Trace Variables Stored Into Memory?

Jan 30, 2012

I know that flash use the garbage collection metod to delete variables from memory, however into the official guide I see: When you no longer need an event listener, remove it by calling EventDispatcher.removeEventListener(); otherwise, memory problems might result. Objects with registered event listeners are not automatically removed from memory because the garbage collector does not remove objects that still have references. So, it's exist a method to trace the memory status and know if a variable was correctly deleted?

View 9 Replies

ActionScript 3.0 :: Multiple Variables In A For Statement?

May 7, 2009

I'm trying to declare a few variables in a for statement using the variable in the for statement. In older flash versions I would use something like this.

Code:
for(a=0;a<10;a++) {
_root["variable"+a] = "Some text "+a;

[code].....

View 3 Replies

ActionScript 1/2 :: Using Variables: Statement Must Appear Within On Handler

Jun 30, 2010

I would like to use variables in my flash app. The app is quite simple, has many buttons, and on each of those buttons I have a simple script: on-rollover and on-release. For both actions I use the same value, which I want to put in a variable. The following script results in an error message: Statement must appear within on handler. When I have to declare the variable inside the on-handler, I have to declare it twice, which makes it useless as I have to enter the value twice. How can I get this working?
  
country = "uk"
on (rollOver){    gotoAndPlay(country)}
on (release){    getURL("/"+country+"/", "_self");}

View 1 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 3.0 :: Declaring New Variables Within A Switch Statement?

Oct 10, 2009

does anyone know if declaring new variables within a switch statement (inside of case: break actually creates new variables inside those switch statements, or are the variable declarations moved to the top of the function when compiled?

i know that when declaring new variables inside a for or while loop, the compiler declares those variables at the beginning of the function. is it the same for if or switch statements?

View 3 Replies

Data Integration :: Checkbox Statement Using Variables

Aug 24, 2006

Using Component Inspector, I can control input dynamically. But I can't find a way to control checkboxes.

[Code]...

View 5 Replies

Action Script 3.0 :: Flash - IF Statement For Variables?

Mar 27, 2012

Im building a sample pad type instrument for a project, i have four channels for four different instruments the interface has four buttons to select the instrument, when the button is selected the image should be green but when another instrument is selected it should go to the second frame of the movie clip which is a red button to signal them instrument is off.

Line 23 i added a conditional statment for the variable associated with the channels it doesnt spit out any errors but also doesnt change the image when i click another button anyone know where im going wrong

//import flash stuff
import flash.events.MouseEvent;
import flash.display.MovieClip;

[code]....

View 2 Replies

ActionScript 3.0 :: Conditional Statement For Multiple Variables

Oct 27, 2009

I have a conditional statement (if) that I am trying to use contingent on multiple variables being true. So the AS I have right now is:

[Code]...

But when I run that I get the following error message: "Error 1050: Can not assign to a non reference value" What do I need to change so that once 1,2 and 3 have been visited visitComplete is set to true?

View 3 Replies







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