Change _global Variables To _global Array?
I'm having a problem with conflicting _global variables and was told that an array may solve my problem. I need to convert the code below to an array, but I'm a newbie when it comes to _global arrays.
How can I convert this?
Quote:
//ROLLOVER
/////////////////////////////////////////////
on (rollOver) { this.button2 = true; }
on (rollOut) { this.button2 = false; }
//SETS BUTTON OVER STATES
/////////////////////////////////////////////
on(press) {
for (var i in _global) delete _global[i];
_global.button2_on = true; }
// ROLLOVER FUNCTION (First Frame of MC)
/////////////////////////////////////////////////
this.onEnterFrame = function() {
if (button2) {
this.gotoAndStop(9);
_global.main_over = true;
} else {
this.prevFrame();
}
if (button2_on) {
this.gotoAndStop(9);
_global.main_on = true;
}
};
Here's an example of the menu: www.earph.com/test.html
KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 02-22-2005, 08:56 PM
View Complete Forum Thread with Replies
Sponsored Links:
Change _global Variables To _global Array?
I'm having a problem with conflicting _global variables and was told that an array may solve my problem. I need to convert the code below to an array, but I'm a newbie when it comes to _global arrays.
How can I convert this?
Quote:
//ROLLOVER
/////////////////////////////////////////////
on (rollOver) { this.button2 = true; }
on (rollOut) { this.button2 = false; }
//SETS BUTTON OVER STATES
/////////////////////////////////////////////
on(press) {
for (var i in _global) delete _global[i];
_global.button2_on = true; }
// ROLLOVER FUNCTION (First Frame of MC)
/////////////////////////////////////////////////
this.onEnterFrame = function() {
if (button2) {
this.gotoAndStop(9);
_global.main_over = true;
} else {
this.prevFrame();
}
if (button2_on) {
this.gotoAndStop(9);
_global.main_on = true;
}
};
Here's an example of the menu: www.earph.com/test.html
View Replies !
View Related
Convert _global Variables To _global Array?
I'm having a problem with conflicting _global variables and was told that an array may solve my problem. I need to convert the code below to an array, but I'm a newbie when it comes to _global arrays.
How can I convert this?
Quote:
//ROLLOVER
/////////////////////////////////////////////
on (rollOver) { this.button2 = true; }
on (rollOut) { this.button2 = false; }
//SETS BUTTON OVER STATES
/////////////////////////////////////////////
on(press) {
for (var i in _global) delete _global[i];
_global.button2_on = true; }
// ROLLOVER FUNCTION (First Frame of MC)
/////////////////////////////////////////////////
this.onEnterFrame = function() {
if (button2) {
this.gotoAndStop(9);
_global.main_over = true;
} else {
this.prevFrame();
}
if (button2_on) {
this.gotoAndStop(9);
_global.main_on = true;
}
};
View Replies !
View Related
Convert _global Varibles To _global Array?
I'm having a problem with conflicting _global variables and was told that an array may solve my problem. I need to convert the code below to an array, but I'm a newbie when it comes to _global arrays.
How can I convert this?
Quote:
//ROLLOVER
/////////////////////////////////////////////
on (rollOver) { this.button2 = true; }
on (rollOut) { this.button2 = false; }
//SETS BUTTON OVER STATES
/////////////////////////////////////////////
on(press) {
for (var i in _global) delete _global[i];
_global.button2_on = true; }
// ROLLOVER FUNCTION (First Frame of MC)
/////////////////////////////////////////////////
this.onEnterFrame = function() {
if (button2) {
this.gotoAndStop(9);
_global.main_over = true;
} else {
this.prevFrame();
}
if (button2_on) {
this.gotoAndStop(9);
_global.main_on = true;
}
};
Here's an example of the menu: www.earph.com/test.html
View Replies !
View Related
XML And _global Array.
Can someone please help me, I am new to AS, and I am in tight crazy deadline after pulling three design in record time this !$!#$!#, I am drained.
I am loading a XML file that loads different content pieces, in different languages, the animation was done and was working perfectly with a dirty old XML trick of assigning all the content to a single node attributes but the content management system guys did not like it because is going to created a lot of hard coding.
I try to rewrite this thing, but I am missing something, can you shoot what I am doing wrong? Please!
Desesperado in DC.
Code:
// XML Loader
var myMapContent:XML = new XML();
myMapContent.ignoreWhite = true;
myMapContent.onLoad = function (success:Boolean):Void {
if (success) {
var contentArray:Array = myMapContent.firstChild.childNodes;
for (var i:Number = 0; i < contentArray.length; i++) {
_global.content_step[i] += contentArray[i].firstChild.firstChild.nodeValue;
}
} else {
_global.content_step[i] = "Unable to load external XML";
}
}
myMapContent.load("includes/flash/XML/sc_map_lang_"+intLang+".aspx");
Before I wrote it like
Code:
// XML Loader
myMapContent = new XML();
myMapContent.onLoad = startContent;
myMapContent.load("/map.aspx?sc_lang="+intLang+"");
//myMapContent.load("includes/flash/XML/map_lang_"+intLang+".aspx");
myMapContent.ignoreWhite = true;
//
// Show the first slide and intialize variables
function startContent(success) {
if (success == true) {
rootNode = myMapContent.firstChild;
totalContent = rootNode.childNodes.length;
firstContentNode = rootNode.firstChild;
currentContentNode = firstContentNode;
currentIndex = 1;
updateContent(firstContentNode);
}
}
// Load all language content-values to Global Variables for Animation
function updateContent(newContentNode) {
_global.content_step1 = newContentNode.attributes.step1;
_global.content_step2 = newContentNode.attributes.step2;
_global.content_step3 = newContentNode.attributes.step3;
_global.content_step4 = newContentNode.attributes.step4;
_global.content_step5 = newContentNode.attributes.step5;
_global.content_step6 = newContentNode.attributes.step6;
_global.content_step7 = newContentNode.attributes.step7;
//_global.content_step7 = newContentNode.firstChild.nodeValue;
_global.content_step8 = newContentNode.attributes.step8;
_global.content_step9 = newContentNode.attributes.step9;
_global.content_step10 = newContentNode.attributes.step10;
}
GOT IT, Someone at my team spits AS, very kindly help me, I need to learn more AS, but design work is enough.
Thank you SZ.
Code:
var myMapContent:XML = new XML();
myMapContent.ignoreWhite = true;
_global.content_step = new Array();
myMapContent.onLoad = function (success:Boolean):Void {
if (success) {
var animations:XMLNode = myMapContent.firstChild;
for ( var animationNode:XMLNode = animations.firstChild; animationNode != null; animationNode = animationNode.nextSibling )
{
if ( animationNode.nodeName == "animation" )
{
for ( var contentNode:XMLNode = animationNode.firstChild; contentNode != null; contentNode = contentNode.nextSibling )
{
if ( contentNode.nodeName == "content" )
{
_global.content_step.push( contentNode.firstChild.nodeValue );
}
}
}
}
} else {
_global.content_step.push( "Unable to load external XML" );
}
}
if ( intLang == undefined ) intLange = "en";
//myMapContent.load("includes/flash/XML/sc_map_lang_"+intLang+".aspx");
//myMapContent.load( "XML/sc_map_lang_en.aspx" );
myMapContent.load("/map.aspx?sc_lang="+intLang+"");
View Replies !
View Related
_global Array Declaration
hello
i'm trying to make an array that i can use in many movieclips. so i thought i would make it global
but i have a syntax error when i declare it
Code:
var _global.vaulted:Array = new Array();
my array is called vaulted
what is the correct way like this?
thanks a lot
View Replies !
View Related
_global Variables
I'm having quite a time getting this _global variables thing to work for me. I have these 4 buttons that will take you to Lessons 1,2,3, & 4 respectively. now, in Lesson 1 I have a MC with 10 different buttons. when the user clicks any of the buttons i want a check mark to appear next to it to show that he/she has seen the MC that pops up.
Frame 1 reads:
if (_global.pub1=0) {
pubck1._visible = 0;
} else {
pubck1._visible = 1; {
button 1 (of 10) in this MC has the action:
on (release) {
gotoAndStop(2);
_global.pub1=1;
}{
now, in the timeline of this MC, i have dynamic textboxes that are labeled _global.pub1 - _global.pub10 (off the stage). I have 10 additional MCs that are labeld (pubck1 - pubck2). These should be invisible (see 1st code above) unless the user has already clicked the corresponding button which will change the value of it's var to 1. The first frame of code (above) is for pubck1... pubck2 - pubck10 would be included as well.
I need these variables (pub1 - pub10) to be global because i want the user to go to lesson 2 and perhaps return to lesson 1 and see which pubs he/she has clicked on.
as of now, when i go into lesson 1, i see the pubck MCs even though i haven't clicke any buttons. Ayudame, por favor!
View Replies !
View Related
_global Variables
Hi
How can I use a variable that resides inside a function elsewhere I have tried declaring it as _global but still its undefined unless its in side the function. I need to use the contents of result_lloyd to be inserted into a label from a separate function.
one_stepperListener = new Object();
one_stepperListener.change = function(eventObject) {
_global.result_lloyd = "Flash 8";
};
one_stepper.addEventListener("change", one_stepperListener);
Thanks for any help.
View Replies !
View Related
_global Variables
I have the following code in my timeline. I am trying to load variables for two arrays. I would then like to have these arrays available for all my other swf files to use.
The if then statement seems to be working when the playback advances to frame 25 I have a script: trace (_global.sm_product[4]);
Which returns "undefined"
Why isn't my _global variable working?
<iframe>
ActionScript Code:
_global.moveAhead = 0;
_global.sm_product = new Array();
var smallProduct_lv:LoadVars = new LoadVars();
smallProduct_lv.onLoad = function(success:Boolean) {
if (success) {
for (vars in smallProduct_lv) {
if (typeof smallProduct_lv[vars] == "string") {
//trace(smallProduct_lv[vars]);
sm_product.push(smallProduct_lv[vars]);
}
}
sm_product.reverse();
//trace (_global.sm_product[4]);
_global.moveAhead +=1;
_global.sm_product=sm_product;
}
};
var smallPhoto_lv:LoadVars = new LoadVars();
_global.sm_photo = new Array();
smallPhoto_lv.onLoad = function(success:Boolean) {
if (success) {
for (vars in smallPhoto_lv) {
if (typeof smallPhoto_lv[vars] == "string") {
//trace(smallPhoto_lv[vars]);
_global.sm_photo.push(smallPhoto_lv[vars]);
}
}
_global.sm_photo.reverse();
_global.moveAhead +=1;
}
};
smallProduct_lv.load("http://www.cricketsyndicate.com/smallProduct.php");
smallPhoto_lv.load("http://www.cricketsyndicate.com/smallPhoto.php");
if (_global.moveAhead=2){
gotoAndPlay(25);
}
</iframe>
View Replies !
View Related
_global Variables
Hello,
Can somebody please clarify to me how global variables work!?
Because im still confused!
All I want is to be able to have a variable that works anywhere in the timeline and in different swfs. I'm using directors MIAW (movies in a window) and having trouble.
Do I just use?
_global.myVar = true
That doesn't do alot for me.
Thanks
View Replies !
View Related
_global Variables
I am trying to set a variable that can be seen in another class. I am trying to use the _global property as in the attached code. My question is where do I place this declaration in my code i.e. in the document class, in the constructor for the class that calls it or where? All I get at the moment is "ReferenceError: Error #1065: Variable _global is not defined."
I am I missing the point here somewhere?
Attach Code
package app.gui{
import flash.display.*;
import fl.video.*;
public class FLVPlayer extends MovieClip {
//public var videoPlaying:Boolean;
public function FLVPlayer(videoToPlay:String) {
var introVid:FLVPlayback;
introVid=new FLVPlayback ;
introVid.setSize(720,480);
introVid.source=videoToPlay;//"FLV/sherrie_intro.flv";
introVid.skin="SkinOverPlayStopSeekMuteVol.swf";
introVid.x=100;
introVid.y=350;
videoPlaying=true;
_global.videoPlaying=true;
trace(videoPlaying);
addChild(introVid);
introVid.addEventListener(VideoEvent.STOPPED_STATE_ENTERED,removeFLVPlayer,false,0,true);
function removeFLVPlayer() {
removeChild(introVid);
_global.videoPlaying=false;
trace("stopped");
//new ButtonHandler();
}
}
}
}
View Replies !
View Related
AS2 - _global Variables Or Another Way?
Hi,
If I have a variable that needs to be accessible across several functions is my only option to make it a _global variable?
I know I could do this with a class and a static variable, but for this project the code simply embedded actionscript on the timeline.
eg:
function1 = function(){
_global.currentPage = 1;
}
btn_nextpage.onPress = function ()
{
_global.currentPage++
}
Thanks!
View Replies !
View Related
_global.var[i] Versus _global.var
Hello!
I simply can't understand this...
Code:
//works perfectly
_global.src = film.attributes.src;
trace(_global.src);
//returns undefined
_global.src[i] = film.attributes.src;
trace(_global.src[i]);
This is inside a function + a for-loop, so I really need the _global-stuff together with an array...
Thanks for any input!
Robin
View Replies !
View Related
Using _global Variables In An External .swf
I need to use some _global variables I declared in a Movie that loads another .swf into an empty Movieclip.
Here's the deal: the "bootloader" movie has the declaration for all global variables I need throughout the system.
This bootloader loads other movies (.swf) into empty movieclips. But I have not been able to use this variables in the loaded .swf's. The only way I can get their values is using "_root." preceeding the variable.
They are declared using "_global.", so, what's happening here?
Can anyone help me?
View Replies !
View Related
[F8] Setting _global Variables
Hi There,
I am having troubles setting _global variables.
As you can see at the top of my code I set my global variable...
_global.isImgLoaded = 0;
Then further down the code on the click of a button I attempt to set it to 1...
navProjects.onRelease = function(){
_global.isImgLoaded = 1;
But my onEnterFrame = function(){trace(isImgLoaded)} still says that the global variable is 0 and my code doesnt work accordingly.
How can I set the global variable "isImgLoaded" when I click the "navProjects" button???
Thanks for any help!
Jordan
----------------------
onEnterFrame = function(){
trace(isImgLoaded)
}
_global.isImgLoaded = 0;
stop();
var navEasing:Number = 0.2;
var layoutEasing:Number = 0.5;
function navEase(theClip, targ) {
var dy:Number = targ - theClip._y;
var vy:Number = dy * navEasing;
theClip._y += vy;
}
function ease(theClip, targX, targY) {
var dy:Number = targY - theClip._y;
var dx:Number = targX - theClip._x;
var vy:Number = dy * layoutEasing;
var vx:Number = dx * layoutEasing;
theClip._y += vy;
theClip._x += vx;
}
//Place the menus off the stage
navProducts._x = -1000;
navProducts._y = -1000;
navInfo._x = -1000;
navInfo._y = -1000;
//Main Nav About Sections
navAbout.onRelease = function(){
navProducts._x = -1000;
navProducts._y = -1000;
navInfo._x = 0;
navInfo._y = 17;
navInfo.gotoAndPlay("in");
if(_global.isImgLoaded == 1){
_root.mainSite.mainNav.productShots.gotoAndPlay("o ut");
}
onEnterFrame = function(){
ease(_root.mainSite.layout.layoutGroup, 0, 208.05);
navEase(navAbout, 0);
navEase(navProjects, 67);
navEase(navContact, 84);
}
}
navInfo.navPhilosophy.onRelease = function(){
onEnterFrame = function(){
ease(_root.mainSite.layout.layoutGroup, 0, 208.5);
}
}
navInfo.navMission.onRelease = function(){
onEnterFrame = function(){
ease(_root.mainSite.layout.layoutGroup, 0, -319.9);
}
}
navInfo.navFormunion1.onRelease = function(){
onEnterFrame = function(){
ease(_root.mainSite.layout.layoutGroup, 0, -848.8);
}
}
//Main Nav ProjectsSections
navProjects.onRelease = function(){
_global.isImgLoaded = 1;
navProducts._x = 0;
navProducts._y = 35;
navInfo._x = -1000;
navInfo._y = -1000;
navProducts.gotoAndPlay("in");
_root.mainSite.mainNav.productShots.gotoAndPlay("f u");
onEnterFrame = function(){
ease(_root.mainSite.layout.layoutGroup, -454.4, 208.1);
navEase(navAbout, 0);
navEase(navProjects, 18);
navEase(navContact, 100);
}
}
navProducts.navWinchester.onRelease = function(){
if(_global.isImgLoaded == 1){
_root.mainSite.mainNav.productShots.gotoAndPlay("o ut");
}
onEnterFrame = function(){
ease(_root.mainSite.layout.layoutGroup, -454.4, -1377);
}
}
navProducts.navLewishamcolt.onRelease = function(){
if(_global.isImgLoaded == 1){
_root.mainSite.mainNav.productShots.gotoAndPlay("o ut");
}
onEnterFrame = function(){
ease(_root.mainSite.layout.layoutGroup, -454.4, -848.8);
}
}
navProducts.navSuttonpark.onRelease = function(){
_root.mainSite.mainNav.productShots.gotoAndPlay("s utton");
onEnterFrame = function(){
ease(_root.mainSite.layout.layoutGroup, -454.4, -319.9);
}
}
navProducts.navFormunion2.onRelease = function(){
_root.mainSite.mainNav.productShots.gotoAndPlay("f u");
onEnterFrame = function(){
ease(_root.mainSite.layout.layoutGroup, -454.4, 208.1);
}
}
//Main Nav Contact Section
navContact.onRelease = function(){
if(_global.isImgLoaded == 1){
_root.mainSite.mainNav.productShots.gotoAndPlay("o ut");
}
navProducts._x = -1000;
navProducts._y = -1000;
navInfo._x = -1000;
navInfo._y = -1000;
onEnterFrame = function(){
ease(_root.mainSite.layout.layoutGroup, -909, 208.1);
navEase(navAbout, 0);
navEase(navProjects, 17.9);
navEase(navContact, 35.9);
}
}
View Replies !
View Related
Changing _global Variables
so... i have a core movie that loades external swf's through
ActionScript Code:
loadMovie("movie.swf", "movie");loadMovie("movie2.swf", "movie2");
no problem.
But then there is a button in "movie", that I am trying to have change a variable that "movie2" uses as a signal to do whatever.
I have tried all of the following (within an "on(release)" handler.
ActionScript Code:
variable=true_global.variable=true_parent.variable=true_root.variable=true_parent._parent=true
none of these seem to work. What the heck am i doing wrong here?
BTW - I am using flash MX 2004 pro
thanks
View Replies !
View Related
Changing _global Variables
so... i have a core movie that loades external swf's through
ActionScript Code:
loadMovie("movie.swf", "movie");loadMovie("movie2.swf", "movie2");
no problem.
But then there is a button in "movie", that I am trying to have change a variable that "movie2" uses as a signal to do whatever.
I have tried all of the following (within an "on(release)" handler.
ActionScript Code:
variable=true_global.variable=true_parent.variable=true_root.variable=true_parent._parent=true
none of these seem to work. What the heck am i doing wrong here?
BTW - I am using flash MX 2004 pro
thanks
View Replies !
View Related
Can't See _global Variables In A Loaded Movie
Hi,
I'm currently loading a .swf file into another .swf and I can't seem to "see" the variables that are in the loaded file. I'm using _global variables and using the LoadMovie command and have tried placing it in level 1, as well as putting it in a target on the main timeline.
Not sure what I'm doing wrong.
Maria
*******
Details on the code:
I'm loading dc.swf. In that file is a variable called "_global.dcswfstart". When I do the trace on "_global.dcswfstart" it says undefined.
now = new Date();
// make a variable for current time
start = new Date(2001, 0, 17);
// set a dummy start date
end = new Date(2001, 0, 17);
// set a dummy end date
loadMovie("dc.swf", "_root.DateCheck");
trace(_global.dcswfstart);
start = dcswfstart;
// set start equal to date specified in the DC.swf file (variable name dcswfstart)
end = dcswfend;
// set end equal to date specified in the DC.swf file (variable name dcswfend)
View Replies !
View Related
Declaring _global Variables And Functions
I'm using Flash MX 2004 Professional.
I have an application consisting of a main.fla which houses some _global variables as well as a _global function. I guess I was under the impression that those variables and functions that I've declared _global were accessable to all timelines. I'm loading an swf at _level100 which will access the _global vars and functions on the _level0 timeline. So far I haven't had any luck retrieving those things declared _global(at _level0) from _level100. Any suggestions?
View Replies !
View Related
Unusual Problem With Using _global Variables
Hi, I've read many posts about this _global function but I've run into a problem I can't solve and haven't seen in any other post.
I'm using Flash MX 2004 with Actionscript 1. I have multiple swf files that I load into a base swf movie. I'm publishing the base movie as a Flash 7 player version because I'm using some of the new 7 functions. But the loaded movies are using version 6 because the code that is in those movies won't work when published in version 7.
I've used _global for a long time and I'm very familiar with how it functions. My problem is that I have global variables that I'm trying to pass from a loaded movie to the base movie. This is not working. I have gottenmost things to work by changing "_global" to "_root" but I feel much more comfortable using _global than _root as it's easier to script when working with multiple swf movies and the other problems I'm having would be solved as well if I can get this to work with _global. Anyone else have this problem? Thanks.
View Replies !
View Related
Can't Access _global Variables On Crossdomain
Hi, I've encountered a problem on crossdomain scripting, I placed the parent.swf on www.mysite.com and its child.swf on http://xx.xxx.xx.xxx (IP ADD). Then I loaded the child.swf from the parent.swf, this loads perfectly, as I can see the child.swf on the parent.swf stage.
The problem is that the child.swf can't access _global.var (and _global functions) that was set on the parent.swf , the reason I've known this, is I setup a dynamic text on the child.swf and place this script:
txtstatus.text = _global.var
and the result is 'undefined'. I read all the security issues I can found on the Adobe site and google searches, and follow the steps to System.security.allowDomain(). But still it doesn't work, even if I placed the script on both swf:
System.security.allowDomain("*")
I can't sleep at night so if anyone experienced this and have solved it, I would really be grateful if you share some light on this topic.
Thanks in advance!
View Replies !
View Related
[MX 2004] Problem With _global Variables & CrossDomain
Is there or is there not possible to access _global variables between domains?
on www.Domain1.com i have index.html and index.swf. Index.swf then loads main.swf from www.Domain2.com.
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..
But i dont really think this is a problem i can solve with cross domain policys since i CAN access the variables and functions using _parent and _root...or is it?
View Replies !
View Related
[MX 2004] Problem With _global Variables & CrossDomain
Is there or is there not possible to access _global variables between domains?
on www.Domain1.com i have index.html and index.swf. Index.swf then loads main.swf from www.Domain2.com.
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..
But i dont really think this is a problem i can solve with cross domain policys since i CAN access the variables and functions using _parent and _root...or is it?
View Replies !
View Related
_global Help
Hello. From my Lingo days I used global all the time. Now that I've phased Flash in, I've been using _root.targetPath. I'm getting sick of typing a path every time I reference a var. Could someone explain the _global syntax and if there is an obvious advantage to either. You're a great help (in advance).
Thank you,
1M.
View Replies !
View Related
_Global
Hi all,
I been wondering anyone can show me a simple example on using global level. I have a hard time trying to figure it out. I'm using flash MX.
Pls help me.Thx
Marv
View Replies !
View Related
_global What The F
Ok I downloaded an awsome RPG sample from here at flashkit. and i have been playing around with it trying to lanr stuff so i an someday make my own. But in the movie it has Items.... it says they are _global bla bla in the actionscript thing rather than starting with.root I cant access the _global files anywhere in the movie its driving me nuts! anyone know what im doing wrong or what i need to do to find this movie clip or w.e i am actually looking for to make my own items? Please Help. Thanks alot
Matt
View Replies !
View Related
What's Up With _global?
I use an onLoad function to set some global variables in the main movie. Then in loaded movies, I reset it to another number, so I can use some if statements to read whatever the global is "now" and perform the appropriate actions. This works, twice, but not a third time or beyond.
Change the _global to _root, and it works, all the time. Can someone explain that, or at least tell me it's a known bug?
View Replies !
View Related
[F8] _global. And Over?
Hey im using this code at the moment:-
Code:
if(_global.block == 7){
_root.b3.start();
}
is there a way I can make it so its 7 and over so it doesn't have to be exactly 7 but like 8, 9, and 10 and keep going???
View Replies !
View Related
_global?
I have several text boxes which I want to display various text strings when the user clicks on a variety of buttons. These buttons are nested in a variety of locations so I have them set _global.InfoBox = "Work for me"; and inturn I have a dynamic text box in an MC with the variable set to _global.InfoBox.
But it dont work! I've done stuff similar before. Is _global hosing me, or is it something else?
View Replies !
View Related
Using _global
hey all,
i wanted to assign a value to an object one time, as it doesn't change in any sections - i.e. stylesheet, why does blow code not work? : i want to get rid of multiple instances i have in different sections but maybe i'm not doing this right?
this is in the root
ActionScript Code:
_global.txtContent._copy.styleSheet = styleObj;
_global.txtContent._copy.autoSize = "center";
_global.txtContent._y = 260-_global.txtContent._height;
anyone? thanks in advance.
View Replies !
View Related
No _global In AS3?
I realize this is basic stuff, but if I have created a master swf to hold additional loaded swfs, how do I name the master so I can refer to it and navigate within its timeline? I did this in AS2 with _global.master = this; I navigated to various labels in the master swf by clicking on buttons in the loaded swfs. With _global gone, I have no idea how to name the master so I can navigate within the master movie timeline. Any help?
View Replies !
View Related
Var _global.name:XML = New XML();
Quote:
var _global.xml_container:XML = new XML();
is of course not working.
Yes, I have googled and found the senocular solution but the forkaround
Quote:
_global.xml_container=null;
with (_global) var xml_container:XML = new XML();
is not working for XML.
Have anyone solved this? Please descibe how.
PS! I need the XML container to be _global, as I have to pass the XML to an other .swfs included later on.
View Replies !
View Related
_global In AS3 ...
Hi everyone,
i'm working with Flash CS3 and i'm doing an application with AS3.
right, i need use a global variable and i have problem with this..
in AS2 i just do it: _global.var = "hello world";
but readind Flash Help i see that function is REMOVED!
anybady know how i do it? for declaring a global veriable?
sorry for my english, i'm from Brazil.
Hugs!
View Replies !
View Related
_global.
Can anyone explain to me the usage of _global. better than the reference in 'MX does? I've used _global vars, NOT _global vars, AND a mixture of both, to have all three options work w/in multiple scenes, and I'd like to know a little more about when/where to use _global. . . anyone?
View Replies !
View Related
_global Help
Okay, I really have no idea why _global doesn't seem to be working for me but here is my code:
_global.xmlref=null
_global.xmlarray=null
function doload() {
xmlarray=new Array(3);
}
function loadContent() {
var p=page
xmlref=new XML();
xmlref.ignoreWhite=true;
xmlref.onLoad=function(suck) {
if(suck) {
doload();
}
}
xmlref.load(p);
}
loadContent()
trace(xmlarray)
Now to me xmlarray should contain Undefined, Undefined, Undefined yet it says null when I execute this. If someone can lead me in the right direction as to how to referenced _globals it would be appreciated. It seems that if dload() is inside the onLoad function then it does not reference globals correctly. And I also tried adding _global to all references but it still does not work. I this a bug or am I doing something wrong? Thanks
View Replies !
View Related
_global On As3.0
i have multiple swf in a project and i want to comunicate bettween them using a global var or a root var. in as2 i just called:
_root.VarOnTheRoot="something"
or
_global.VarOnTheRoot="something"
and i could use it whenever i wanted. now with as3 this doesnt seem to work,
thanks for the help
View Replies !
View Related
_global.
Can anyone explain to me the usage of _global. better than the reference in 'MX does? I've used _global vars, NOT _global vars, AND a mixture of both, to have all three options work w/in multiple scenes, and I'd like to know a little more about when/where to use _global. . . anyone?
View Replies !
View Related
_global Help
Okay, I really have no idea why _global doesn't seem to be working for me but here is my code:
_global.xmlref=null
_global.xmlarray=null
function doload() {
xmlarray=new Array(3);
}
function loadContent() {
var p=page
xmlref=new XML();
xmlref.ignoreWhite=true;
xmlref.onLoad=function(suck) {
if(suck) {
doload();
}
}
xmlref.load(p);
}
loadContent()
trace(xmlarray)
Now to me xmlarray should contain Undefined, Undefined, Undefined yet it says null when I execute this. If someone can lead me in the right direction as to how to referenced _globals it would be appreciated. It seems that if dload() is inside the onLoad function then it does not reference globals correctly. And I also tried adding _global to all references but it still does not work. I this a bug or am I doing something wrong? Thanks
View Replies !
View Related
Uses Of _global
Hallo,
I'm trying to hack some code with the _global scope, but sometimes it fails, and I have to put the _global prefix always, in front of each reference in the movie.
Does it work with variables only? Or with objects also? Say _global.mySound = new Sound(), is it feasible? Can I call it from wherever in the timeline, even loaded levels?
thank you very much!!
m.
View Replies !
View Related
When To Re-use _global.?
Hello, in my program I'm using a lot of global variables. I've noticed (especially with global arrays) that if I do NOT use the _global identifier when doing a complete reset of the arrays data, it doesn't always work.
Just to clairify, what I mean by a complete reset is looping through the array using a temp array to hold the valued I want to save then applying the temp array to the original arrray thus overwriting the original. I realize array.slice would be better, but humor me.
And on the flipside, I have some regualr number global variables that will NOT CHANGE when I try to re-set them to 0 if I use the global identifier on them.
So, what is it i'm missing, what is it I don't know about _global that's screwing me up?
Thanks.
View Replies !
View Related
_global HELP
Hi, I'm trying to control a movieClip in level20 from a loaded movie,
elements:
movie1
navigation
index(main movie level0)
I load movie1 from index(_level0) to _level5,
and load navigation(stand alone movie) from movie1 to _level10,
now I want to control a movieClip in navigation movie(_level10),
I put a function in index(_level0), I'm not sure if I could do this or not, but here is the code in index(_level0) first frame...
_global.function moveIt(myClip){
endy = 100;
speed = endy - myClip._y;
myClip._y += speed/5;
}
I just wondering if I could make a _global function in level0 and control eveything which being loaded into it.
so I can call it from movie1(_level5)
moveIt(someClip);
is that right?
can anyone tell me if can I write a _global.function()?....
does the _global.function() thing exist??
View Replies !
View Related
_global XML?
I have 3 swf's which are all linked to the same XML file. I have created a main swf which contain buttons which load the respective external swf using loadMovie.
Since the XML file is the same in all 3 - I was wondering, could I pull the XML loading information from each of the three swf files and put it in the main swf so that it only loads and parses the XML once and then each of the 3 swfs can pull the dynamic data from it there?
It seems like this would be faster and more effective way to do this?
View Replies !
View Related
_global Isn't Global
if i do this:
_global.hello="hello";
then anywhere in my movie i can say:
var another;
another=hello;
and another will be set to "hello"
and will be accessible from ANYWHERE in the movie
when i do this though:
_root.createEmptyMovieClip("newmovie",depth);
_root.newmovie.loadMovie(url);
then newmovie can't see the _global.hello
it can't even see anything in _root or _level0!
but when i use the debugger it shows that
_global has all _globals created both in the main movie
and in newmovie
is _global really global ?
can someone please tell me what i am missing here ?
or is _global really not global at all ?
thanks for any consideration
anilgulati
View Replies !
View Related
_global Problem ?
Hi ,
I have three scenes in my movie. The second scene contains a quiz game. I am counting number of questions asked and right and wrong answers. I am declaring all these variables as _global.rightAnswer= 0; so on.... in my first frame of Scene 2.
The problem happens when user jumps back to scene 2 from scene 3 . The previous information already exists. such as questions , answers etec.
How can I fix it? Please reply asap
View Replies !
View Related
|