Define Global Var Outside Of Flash?
im trying to declare a global var in flash outside of flash with php ex: i have a php page that wants to send a php var to flash then define it as a global var ... is ths possible
thanks.
ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 11-05-2008, 05:12 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Define Global Var Outside Of Flash?
im trying to declare a global var in flash outside of flash with php
ex: i have a php page that wants to send a php var to flash then define it as a global var ... is ths possible
thanks.
How To Define A Global Variable?
How do I make a variable global? In the following code, the value of MyText is lost after the function:
Code:
var MyText;
TextLoad = new loadVars();
TextLoad.load('Text.txt');
TextLoad.onLoad = function (success)
{
if (success == true)
{
MyText = unescape(TextLoad);
}
}
trace(MyText);
Serious Call For HELP How To Define And Use Global Variable ?
I have problems using variables and my global variables dont seem to work.
Can anyone tell me how to define a global variable so that different movie clips can use it ? And, how to use global variables ?
I have read some other threads on the same problem but I still dont understand.
please explain it with the simplest way because i am a newbie at action script. Thanks!!
Need To Load Url With Java Script, But Want The Flash To Define What Url
I'm working in flash mx, and I want to make a pop up window that I can customize size, position, and menues with java script. The only ways I have all found to do this require the java script to determine the file loaded. Is there anyway to use the normal get url in flash, and put the file to be loaded in that, but have it call up the java to set the window attributes? I'm doing this because I need to open several different sites with one java script within one movie. If anyone knows how to do this, any input would rock. Thanks
Html Page Size Define From Flash?
is it possible to define that window size from within flash? i dont know how to set the html to open at a specific size from within dreamweaver, and i though maybe someone might know a code in flash that will tell the page where the swf is inserted in to change the size upon load.
thanks
[CS3] Global Function = Global Variables As Well?
CS3/AS2
if i have a global function with some variables defined within it, are the variables global too? if not how would i make them global too?
_global.function someFunction() {
var cake = 10;
var book = 15;
}
someFunction is global so therefore "cake" and "book" are too?
Global Function, Global Variable
how to declare global function and global variable? if i declare it just in frame 1, then the object in other frame can reach it? thanks for answer..
Global Var Using In Flash MX
Hi!
I'm trying to set global var at the main movie timeline in first frame. Than I need to reach and to change this var inside of the sub-mc every time when it plays in loop with main mc.
In details: there is a sub-sub-mc which gets visibility from sub-mc depending on this global var, and also changes this global var. So I need to reach it and change every loop of mc.
Would be very glad to get any suggestions. I tryed many ways - nothing has worked.
oleg.
Global Variable In Flash 5
Hi ppl, I want to ask whether flash 5 uses global variable, and how to use it because I want to call a variable allGone in a function but allGone is located within a different function so that's why I want to use global variable but I don't think that this is a good idea. Both the function is within the same time frame. Thz
PHP And Flash / Global Variables
I could really use some help - I have been struggling with this all day. My hosting provider turned off GLobal Variables on their server, now none of my PHP / Flash combo stuff works anymore. I tried something like the following:
(In FLASH within a Movie)
X="TEST";
loadVariables "Check.php",this,"POST";
(In PHP)
global $X;
print"X";
and nothing gets received into PHP. I am not sure what to do,help please. Thanks in advance.
Flash Var's Local Or Global?
hi,
if I define a var (variable) in a child-movieclip, is it then only for that specific child-movieclip or for the whole flash movie?
and if it's only for that specific child-movieclip, how can I access it then from other child-movieclips in different layers?
thanx for an answer
xant
Global Function In Flash
How can we write a Global function in flash. I want a same function to be used when I click different buttons.
[Flash 8] Global Variables
Hey, I was wondering if I could assing a global variable to a local variable;
For example:
in the frame 1 of my main timeline, I have something like
Code:
_global.Jumping = false;
in a movieclip, I have the following code (example):
Code:
if (Jumping == true){
_y+=50;
}
The thing is, I have all my code written already without the _global thing in my movieclip, but I want to call that global variable, do I have to always use _global.Jumping? Couldnt I do something like:
var Jumping = _global.Jumping;
inside the movieclip? to not change all my "Jumping" to "_global.Jumping"?
I tried that but doesn't seems to work.
I hope you understood what I meant.
Thanks in advance for any help,
-javier
Global Variables In Flash MX
Here is what i have.
I have a main movie that loads when needed other movies on diferent layers.
What i need to knw is that is posible to see the main movie variable in the loaded movie.
Or somehow to not relay on loadVariableNum, it's preatty anoying to check on the server each time you do an task
________
George, M
Flash MX / PHP Global Vars
I don't suppose anyone could tell me the difference between flash mx _global vars, and PHP $GLOBAL vars; where they're stored, how to access PHP vars from a flash mx generated .swf, and vice versa?
Macromedia sure has some very nice software, but there documentation pretty much sucks. Any help would be appreciated. Thanks.
Flash Variables => Local, Global ?
If I initialize a variable in one keyframe, can I than always use it in other keyframes of other movie clips.
Another question: I want to get one variable out of a txt file and use it in the flashscript of a menu i'm making. I know how to output it to the screen but I can't get it fixed to use it in my script. I think the problem is related to my first question.
Problems With Global Variables In Flash
I've a problem with global variables in flash MX and 5.
Flash don't store the value of this in diferent frames o timelines.
How I can store this value?
Thank's
Global Numeric Variable - Flash 5
How do you make AND test for a global numeric variable in Flash 5.
I want to make a numeric variable on the 1st frame of the 1st scene.
This must a number or integer.
I MUST be able to manipulate and test for this IN ANY FRAME, AT ANY LEVEL of the movie.
Is this even possible? (you'd think it would be)
****** I AM TRYING THIS, BUT IT DOESN't WORK******
var vendorset=1; //in frame 1 of scene 1
// I am testing for it like this
if(vendorset == 1){
...do something here...
}
WHY WHY WHY Does the above code ONLY work in level0 or scene1.... I NEED THE ABOVE TO WORK On ANY ANY ANY ANY Frame of ANY ANY ANY movieclip in the movie
Can Anyone Help Me!!
********************
How do you make a TRULY global numeric variable that can be changed and tested for in ANY Frame or ANY movieclip ANYWHERE in the flash Movie
********************
Thanks!!!
Global Stats On Flash Players
Anyone know? I'm about to begin development on a global flash demo for the company I work at, basically will call in demo text via xml (assuming we can get that bit worked out on our server, blocking it in testing and production environments but not development environments, for some reason).
I'd like to know if anyone has any stats on players based by country/region, and also the major differences between Flash Player 6/7/8/9?
What I'm getting at is I don't want to aim too low on all the new toys and bells and whistles if most users are in 8 or 9. In the US, our standard is to code to 7 just because that's what IT has put on all of my coworkers computers, but if it's otherwise across the world, I'd be curious to know.
Thanks!
Flash Global Search And Replace
Flash global search and replace
When developing a flash file, is it possible to do a global search and replace throught the entire file or do you have to go through each clip/button code individually?
Global Security Settings In Flash 9
Hi,
I´m experiencing some problems with the security settingsmanager (choose settings > advanced > then the website of Adobe opens with an embedded flash movie in which you can change some security settings).
I have the following questions:
- Is it possible to integrate this movie in your own (acces this panel offline...). I have found some things on the internet: http://livedocs.macromedia.com/labs/...rityPanel.html but I dont understand them..
- Some computers show the security panel and others won´t.... I can´t find the reason for not displaying the panel. I cheked the IE (security) settings, the flash version, but nothing gives the solution for this problem.
With kind regards,
Pascal Timmermans
Are Global Variables Really Global?
Hi everyone!
This might sound like a dumb question, but i've just been struggling with variables (more specifically global variables) for the last 3 hours, and now that i made it work, i'm wondering if my solution is the "normal" one.
From what i gather, when you declare a _global variable, you can just use it from any timeline without using a path, right? I have a variable (whichHoliday) which i initiate in the first frame of the main timeline, this way:
_global.whichHoliday="";
I want to give a new value to this variable inside a MC on that timeline. The only way i could do it was by using:
_global.whichHoliday="whatevervalue";
Shouldn't i have been able to use only: whichHoliday="whatevervalue" ?
Why did i need to use _global again to set the value?
Thanks for any input!
[F8] My Global Variables Are Not Global
Hi
I have a problem, my global variables aren't global, as soon as a new timeline is entered the global variable is undefined. (I read somewhere in a forum that it is only possible to use a couple of global variables for F8, could that be correct?)
I use:
if (_global.thing == true){
thing._visible = true;
}
This works for the timeline where true was set and one more timeline, but as soon a third timeline is entered the global value is set to undefined!
What could be the problem?
I am soo grateful for any suggestions!
Thanks!
My Global Variables Don't Seem So Global
what the hell am i doing wrong!?
heres what i've got:
in my UI class i have this:
#include "ContainerClass.as"
#include "MapClass.as"
#include "ObjectiveClass.as"
#include "SponsorClass.as"
#include "MeasureClass.as"
#include "InitiativeClass.as"
#include "AnalystClass.as"
#include "MilestoneClass.as"
#include "StoryLineClass.as"
#include "CommentsClass.as"
var dbPath = "localhost";
_global.scriptPath = "http://"+dbPath+"/strategymap/scripts/";
then in all of the included files i have something like:
myloadvars.sendandload(scriptPath+"/filestoload.whatever",x,"POST");;
sometimes i just want to break something. grrrrr!
Flash5 To Flash MX : Global Variable UNDEFINED ?
I opened Flash5 files [movieA and movieB] with FlashMX and I scripted on movie A :
_global.page=5
loadmovie ("movieB.swf","","POST")
on movie B I scripted :
trace (page)
However the traced (page) returns the variable :
Undefined
I recreated movieA and movieB using FlashMX NEW Documents with the same scripts but it worked - the trace returns : 5.
Anyone can confirm this and tell me why?? Can anything be done for the Flash5 files to work in FlashMX ? All my works were already done in Flash5 I dont want to re-do everything in MX....
Flash Player 8 Global Settings Not Working
Platform:
======
OS X 10.4
Safari 2.0(412)
FP 8
When I go to macromedia (adobe) site and open global security settings for FP 8 it doesnt show the add localtion combobox. Below is the screen cap.
anybody any idea ?
Apply Global Gradient To All Layers - Flash
Is it possible to either:
1. select multiple layers that contain shape tweened flat colour shapes (with outlines) and apply a gradient to all with one click?
2. apply a mask that creates a global gradient to all the aforementioned layers?
Some more detail on the project:
Its a multilayered, shape tweening animation that I want to give a 3d effect by applying a gradient to each layer....the problem is i need the fastest way to do it as there isnt just one animation...there is about 70 of the blighters..
Cheers
Rossy
X Y Define
hi!
how to define x or y into actionscript for the movie trajectory like
like...
if(x>200 && y<100) {
random();
}
any suggestion?
thanx in advance!!!
How To Define FPS From As
hi, i'm asking about one thing that i need in the past and i need now.
Set for different movieclips, different fps velocity, how i make that?
tks all
How To Define This...
This code works fine with 3 buttons. But what to do if I have more than 3 buttons, let's say 5 of 'em?
// code begins
_root.picnumber=0;
this.btn1.onRelease = function () {
if (_root.picnumber == 2) {
pic2.gotoAndPlay (12);
} else if (_root.picnumber == 3) {
pic3.gotoAndPlay (12);
}
_root.picnumber = 1;
pic1.gotoAndPlay (2);
}
this.btn2.onRelease = function () {
if (_root.picnumber == 1) {
pic1.gotoAndPlay (12);
} else if (_root.picnumber == 3) {
pic3.gotoAndPlay (12);
}
_root.picnumber = 2;
pic2.gotoAndPlay (2);
}
this.btn3.onRelease = function () {
if (_root.picnumber == 2) {
pic2.gotoAndPlay (12);
} else if (_root.picnumber == 1) {
pic1.gotoAndPlay (12);
}
_root.picnumber = 3;
pic3.gotoAndPlay (2);
}
Define A Var In XML?
I want to be able to get my var from my XML file. But when I add another node in my XML file, let's say its called <picNum>3</picNum> I can't seem to get it into my flash file? Any clues on this? I only want one number under each <subnumber> node if thats possible?
I have this var in my .fla.
Code:
var picNum:Number = 3; // could be any number
and I load my XML like this:
Code:
var pArray = new Array();
var tArray = new Array();
var myXML:XML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = function (success:Boolean):Void {
if (success) {
var xmlData = this.firstChild.childNodes[0].childNodes[0];
for (var i = 0; i<xmlData.childNodes.length; i++) {
pArray.push(xmlData.childNodes[i].childNodes[0].firstChild.nodeValue);
tArray.push(xmlData.childNodes[i].childNodes[1].firstChild.nodeValue);
}
containerMC.loadPic(0);
picInfo.alphaTo(100, speed_fadeIn, tweentype_fadeIn, speed_fadeIn);
} else {
picInfo.text = "Unable to load external file.";
}
}
myXML.load("xml/XMLdata.xml")
And my XML file looks like this:
PHP Code:
<?xml version="1.0" encoding="iso-8859-1" ?>
<xmlData>
<main>
<subnumber>
<subinfo>
<path>main1/images1/01.jpg</path>
<info><![CDATA[<p>main1, sub1</p>]]></info>
</subinfo>
<subinfo>
<path>main1/images1/02.jpg</path>
<info></info>
</subinfo>
<subinfo>
<path>main1/images1/03.jpg</path>
<info></info>
</subinfo>
</subnumber>
<subnumber>
<subinfo>
<path>main1/images2/01.jpg</path>
<info><![CDATA[<p>main1, sub2</p>]]></info>
</subinfo>
<subinfo>
<path>main1/images2/02.jpg</path>
<info></info>
</subinfo>
</subnumber>
</main>
</xmlData>
Is There Something Like #define ?
Hi guys,
Is there something in AS3 that's like a #define in C(++) ?
Like this:
#define HORIZONTAL 1
#define VERTICAL 2
var direction:int=HORIZONTAL;
I know I can just declare variables and name them accordingly but that seems like a waste of memory.
Thanks.
How To Define This...
This code works fine with 3 buttons. But what to do if I have more than 3 buttons, let's say 5 of 'em?
// code begins
_root.picnumber=0;
this.btn1.onRelease = function () {
if (_root.picnumber == 2) {
pic2.gotoAndPlay (12);
} else if (_root.picnumber == 3) {
pic3.gotoAndPlay (12);
}
_root.picnumber = 1;
pic1.gotoAndPlay (2);
}
this.btn2.onRelease = function () {
if (_root.picnumber == 1) {
pic1.gotoAndPlay (12);
} else if (_root.picnumber == 3) {
pic3.gotoAndPlay (12);
}
_root.picnumber = 2;
pic2.gotoAndPlay (2);
}
this.btn3.onRelease = function () {
if (_root.picnumber == 2) {
pic2.gotoAndPlay (12);
} else if (_root.picnumber == 1) {
pic1.gotoAndPlay (12);
}
_root.picnumber = 3;
pic3.gotoAndPlay (2);
}
Define This Var?
How can I make this work? I'm trying to define a var of my textdoc in order to just have to change it in one place. The textdocs reside in a folder called "_textdocs". Here's what I'm trying to do:
Code:
var myDoc = textdoc.txt;
lv.load ("_textdocs/" -- what to write here? --);
Clear The Lager Number Of Global Variables Set In Flash
i am writing a program with actonscript. Once the program runs, there are many calculation involved and many variables are generated. now i would like to add a button of "redo/restart".
Is it any actionscript common that can erase all variables generated?
I've tried to frame works to remove a movie clip and reload. but it only remove the local varibles inside the main movie clip but not some variables of global varss.
could you help me?
thanks for your attention. millions of thanks
Define Label In AS
Hi,
i try to define a lable in ActionScript. Is this possible? Or can i get a lable with AS like "foo = lable at framenumber"?
thx
necro
How 2 Define A Swf Loaded Into MC?
I am loading external swfs into an invisible MC on root timeline. I want to tell this swf to unload after the movie has completed - and return to 1st frame root in prep for another movie. I have tried several action script strings of unload movie, tell target stop, go to new frame, etc. I think that my problem is defining the swf within the movie clip. . . .
Last attempt was:
on swf - last frame:
stop
tell target _root.InvisMCName
unload movie name.swf
This did not work - help help help help
Go see http://www.blackdiamondproductions.com
screening room page for visual
Much thanx-d
Define Matrix
please help me with a *.fla example, to know how to define, then to compute a inverse of a matrix
Define ContainerMC Plz
hey all!
dumb question: im looking at this script, and this guy keeps referring to the "containerMC". can anyone explain this to me?
thanks in advance!
- nick
How Can I Define Another Popup?
i followed the steps for the new popup window and it worked http://www.flashkit.com/tutorials/Ac...-708/index.php
but how can i do this with 3 different buttons,whose open all a different popup window.
Where To Define Function
I have several scenes that use the same movie, this movie contains a logout button and i want to place all the logout commands in a function somewhere. the logout button exists on several movies as well. I want to place the function in a place where i only have to modify it once so that it is accessible to all scenes at any time. Where should this function be placed that that it is basically global to all scenes and movie
Thanks
Please Someone Help Me Define What An Object Is.
ok I have been writing/scripting actionscript and all the documents books etc dress up what they are, with explanations of chocolate boxes, simple boxes.
But when i scripting for example "taken from a book"
mycolor = newcolor(shirt);
mycolor.setRGB (OxFF3300);
My understanding is that an object contains lots of others scripts that are pre-made that tell actionscript how to change the definitions of the properties of the movieclips/sounds etc all you do is enter the properties into the parentheses to alter these properties...
Am I correct or is there a better way of explaining this, or is my question badly phrased???
Please help as I really want to nail this concept
tanks
stef
Define Object
You were right that the Object was not properly defined. Could you explain what this actually means/does?
this["testData"+c] = {};
How To Define Two Or Three Variables As A One In The End?
Hello,
I need a help.
I am working on a small form where there are three fiedls with variable names assigned. In the end, I need to send all three variable as one variable to the server. It something like phone numbers fields - 111 222 3333.
Is that possible to create a script which will pass all three variables from those fields to the one hidden field which will actually have all numbers in one. It is like - 1112223333.
Also, I am using radio buttons and wondering how to assign in this situation a variable which be possible to get after clicking a radio button.
Just in case, I am sending a test.fla file which describes everything.
Any advise is highly appreciated.
Many thanks in advance!!!
|