ActionScript 2.0 :: Using _global With Functions?

Aug 28, 2008

I am using _global to declare my vars and funcs. On the whole it makes things easy for me. However, I have come up against something that I cant fix.

Code:
_global.swipeCount = function() {
if (c >= 3) {
text01_mc._visible = 0;
text02_mc._visible = 1;

[code]....

This function is called from some MCs that have a simple single-layer, timeline-tween with an action at the last frame calling this function. The problem is that _root.swipe_mc.stop(); never executes. The MC keeps playing. I can however make it _visible = false; So it is finding the correct path.

View 1 Replies


Similar Posts:


ActionScript 2.0 :: _global Functions From External Swfs

Jun 25, 2007

i am loading in a movie clip from a location online. that much works fine, however, in this external movieclip, it is making a _global function call to some code i have in my main swf which this clip is being loaded into.

[Code]...

View 2 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 2.0 :: Get A Value Of _global.id Var Outside The Function?

Jan 6, 2010

i want to get a value of _global.id var outside the function. Here is the code

var xml = new XML();
xml.ignoreWhite = true;
xml.onLoad = loadXML;[code]....

when i trace _global.id out of function it is undefined, and when i trace it in the function it gives 1, which is ok. How can i get that value out from function?

View 4 Replies

ActionScript 2.0 :: How To Return _global

Aug 5, 2004

orrect the syntax of my code:Code:firstOne = _root.content.content_group+_global.whichOne;I have 3 movieclips called content_group1, content_group2, etc. I have a button that calls this: _global.whichOne = "1";Now, how can I correct that code above so I get content_groupX?

View 3 Replies

ActionScript 2.0 :: Using _global For New Sound?

Feb 20, 2006

is that a bad thing? or does it not matter? sorry if i missed a post where this has already been cleared up eg..

[Code]....

View 3 Replies

ActionScript 2.0 :: Different Between _root And _global?

Jun 4, 2009

difference between _root and _global when dealing with variables or point me in the direction of a good explaniation on the web? I feel like there is something basic I am missing. For example the other day I was working on making some scenarios. In a nut shell I was setting up dynamic text boxes where the text would changed based on what the student selected (via buttons).

When the varible was changed (by clicking the button) the text wouldn't refresh when it was a _global, but would refresh when it was _root. Everything is working fine but I've been trying to understand the "why" it works this way.

View 3 Replies

ActionScript 2.0 :: _global Good Or Bad?

Mar 4, 2004

I recently read an article about prefacing your variable w/ _global.

And I think it rocks!!!

Why is this practice taboo?

Why do so many tutorials insist you remember the scope of every movie clip?

It seems to me that memory space is memory space.

View 2 Replies

ActionScript 2.0 :: Inserts The FIRST _global Property?

Apr 9, 2010

I have a button with a list of _global settings:

_global.practiceName = pName.text;
_global.practiceStreet = pStreet.text;
_global.practiceCity = pCity.text;[code]....

Then I have a MC with a dynamic text box with some AS:

practiceInfo.text = practiceName+' - '+practiceStreet+", "+practiceCity+", "+practiceState+" "+practiceZip+" - "+practicePhone+" - "+practiceSite;

The problem I am having is it ONLY inserts the FIRST _global property! Only the pName.text goes in. Am I missing something here?The practiceInfo.text works great if I manually state:

practiceName = "AbC";
practiceStreet = "1235 Way";

View 1 Replies

ActionScript 1/2 :: Declare _global Variable In Swf

Mar 22, 2012

I have a swf page where the external swf will load, there is any way to declare variables who work in all swf. What I am trying to do is: like a switch, with several options in which all these are listed in the main swf

View 9 Replies

ActionScript 2.0 :: Simple _global Not Working

Aug 27, 2003

This is plain and simple, why is it not working? BUTTON

[Code]...

View 7 Replies

ActionScript 2.0 :: Change The Value Of _global.valA In The Different Frames In B?

Jul 23, 2010

I have this code in an mc.

//////
function musikstil(a,b){
a.onRollOver = function(){

[code]......

View 3 Replies

ActionScript 3.0 :: Alternatives To _global Variable Path?

Jun 8, 2009

through out a very old complicated fla there are buttons which set variables using _global paths
 
such as:
 
function menu1_2(Event:MouseEvent) {
global.mode = "hide_hotbox";
MovieClip(this).gotoAndStop("stage_1_b");
}
 
How can I make the variable "hide_hotbox" and others like it accessible and changeable from any movie clip -- whether they be nested in other movie clips or on the main timeline, etc?

View 6 Replies

ActionScript 2.0 :: Detect Change In _global Variable?

Nov 18, 2010

how do you detect change in a _global variable?

This following is the code I am using which watches for change. (only the local variable)

ActionScript Code:
// Declaring the variable
myVar = "AtoF";
// Callback that will be triggered every time there is a change

[Code]....

I use _global to declare the global variable and its not working with this code.

View 0 Replies

ActionScript 2.0 :: _global Variable Doesn't Work?

Jun 17, 2005

I'm getting frustrating Why in Gods name this example doesn work???kirupa2 loads kirupa1 in which is _gloal variable setup (_global._myVariable = "XYZ")After clicking on PLAY button trace outcome is undefined

View 6 Replies

ActionScript 2.0 :: _global Won't Listen (get The Globals Set By Projector.swf)

Jul 30, 2005

I have Flash site with different .swf's.

[Code]....

In projector.swf I have a movieClip with 2 buttons for language: nl_btn & eng_btn. Clicking makes the _global.taal change to "dutch" or "english". menu.swf gets the global and responds, but all the movies loaded in _level0.container_mc won't get the globals set by projector.swf. Now that menu.swf is in as1 i thought this would be the problem, but changing the _level0.container_mc movies into as1 I still couldn's trace the _globals.

View 2 Replies

ActionScript 2.0 :: Passing The Value Of An Attribute To A _global Variable

Aug 23, 2007

I need to pass the value of a attribute to a _global variable that can be accessed somewhere else in the movie.But it traces as undefined outside of onLoad.

eg.FRAME ONE

ActionScript Code:
var xml:XML = new XML();
xml.ignoreWhite = true;

[Code].....

View 3 Replies

AS3 :: Flash - Simulate AS2 _global Variable Using A Simple Class?

Feb 14, 2011

I have recently started making (and am still making) the transition from ActionScript 2 to 3. I have used the _global variable in an AS2 project as I needed a variable to be accessible from within ANY swf loaded into my main movie. This worked like a treat.

However, along came AS3 and whipped that from right under my feet. After much Googling, a few people suggested making use of a simple class with a simple variable that can be publicly set and retrieved. I made a simple class, imported it and manipulated the value, and all went well, however the instance of the class I create in my main loader movie is still not accessible from within a second SWF that gets loaded into my movie. If I re-instantiate the class in the SWF that is being dynamically loaded, the value reverts to the default value in the class code, not the new value set in my parent (first) movie.

Here is my class code, stored in an external .as file, is there any way I can simulate the ostype variable being a global variable?

package{
public class ostype {
public var ismac:Boolean = false;

[code]....

it's used as a simple identifier as to what operating system this flash app is being used on (mac or windows) and as a result let's me server content - such as saving files - in a different manner.

View 1 Replies

ActionScript 2.0 :: Stopping All Movie Clip Animation With _global?

Oct 8, 2010

Is there a way to stop every nested mc animations as once. In other words, I would like to stop every existing playhead in my swf file with one button. Currently, I got on button stopping the main scene playhead, but it doesn't stop any nested mc animation.Here is what i got on my main scene action layer :

ActionScript Code:
_global.drapeau="1";
_global.stopPlay="play";

[code]......

View 1 Replies

ActionScript 2.0 :: Where Is The Drawback To Just Making _global Standard Practice

Mar 4, 2004

I recently read an article about prefacing your variable w/ _global. And I think it rocks!hy is this practice taboo?Why do so many tutorials insist you remember the scope of every movie clip?It seems to me that memory space is memory space

View 2 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 :: Getting Error 1120: Access Of Undefined Property _global?

Aug 30, 2008

I can't understand this stuff. A global variable is a variable I can read from anywhere in the document right? if I make a mc and in the action frame I type:

_global.myVar=5;

After that in the action frame of the main timeline I try to trace the variable with this sentence:

trace (_global.myVar);

and I get this error 1120: Access of undefined property _global.It's just me or the help menu or live doc are really useless?The examples I found are not working. The definitions are not really clear etc etc

View 1 Replies

ActionScript 2.0 :: Access The _global Object, Which Was Created In The Main File?

Apr 5, 2005

Here's some background: I am working on a project in which we have one main Flash file that loads other Flash swfs into an empty movie clip within the main file.The main file instantiates a class I've made (stateManager) into a _global variable.This object keeps track of the most recent states of the other individual files so users can navigate between them all and come back to the same status they left it.Here's the issue:In the sub files, I need to access the _global object, which was created in the main file, many times so I would like to use the 'with' construct to reduce typing. However, because the 'with' statement needs an object to reference, I am unable to publish my files .I've tried adding an if-statement at the top of each file (if(_global. stateManager == undefined){ ), but this doesn't work either.I've included a portion of my code for you.

Code:
import classes.stateManager;
if (_global.stateManager==null) {
_global.stateManager = new classes.stateManager("./InitFiles/global.xml");[code]....

View 1 Replies

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

Actionscript 3 :: Calling Functions In Functions And Avoiding The Player To Crash / Hang?

Oct 6, 2011

I have a series of calculations i'm doing over a bunch of objects stored in a array. Each function is pretty CPU demanding but if you only run one function, it just works fine.

[Code]...

View 2 Replies

ActionScript 3.0 :: Import Vs Include - Basic Functions To Be In BasicFunctions.as And The Make A Library For More Specific Functions

Jun 6, 2010

I've got a project thats getting a bit big, so Im taking the actionscript out into separate as files. I want all the basic functions to be in BasicFunctions.as and the make a library for more specific functions. I find that a lot of people use the import statement but I cant get that to work with a simple Hello World trace, yet the include statement works fine (see attached). I understand that import/include work differently, but which is the better method? If import, then is that heavier to work with. Any rate, what's the best way to organise code when it gets to the 1000+ lines?

[Code]....

View 9 Replies

ActionScript 3.0 :: Mimicing The Until Functions - Load Of Global Functions In One File?

Nov 4, 2009

I'm trying to find a way to have global functions in my as project, similar to how flash does with stuff like the util functions (describeType()...), where you can just call the function wherever you need it. For example:

[Code]...

So when I call Test(), it prints out "hello world" fine. My problem comes in that I can't change the name of the Test function, and I can't add any other functions without compiler errors. Is it possible to have a load of global functions in one file, or do I have to split them up into separate files like in the example? Also, I know that I can make a Global class and call static functions like Code: Global.doSomething() but I'd like to know if there's a way to do it as flash does it (describeType(), getDefinitionByName(), etc), or rather, how does flash do it?

View 9 Replies

ActionScript 2.0 :: Call Other Functions From Generic Mouse Event Functions?

Nov 25, 2010

Is it not possible to call other functions from generic mouse event functions?

Code:
_root.myButton.onPress = function(){
hide();

[code]......

View 6 Replies

ActionScript 2.0 :: Functions And Sub-functions - Button Doesn't Work OnRelease?

Jun 17, 2004

I have one function that puts text in a text field and makes a button goto a url onRelease.The code is like this:

Code:
item.onRelease = function() {
myButton.onRelease = function() {
getURL("http://google.com", "_blank");
}
talk = this.txt;
}
the only problem is that the button doesn't work onRelease. i think that it is because there are too many functions there, but at the same time,

View 5 Replies

ActionScript 2.0 :: Multi-functions -values Of (12) And (21,39) Are Lost At The Geo And Geo1 Functions ?

Dec 2, 2004

in this example why the values of (12) and (21,39) are lost at the geo and geo1 functions

[code]...

View 11 Replies







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