Defining A Variable As "undefined"
How can i do this? I tried using both variable = undefined; and variable = "undefined";
Is there another method i'm missing?
DevShed > Flash Help
Posted on: December 7th, 2004, 08:13 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Defining/Re-defining Variable Value Based On Button Press?
I've got 50 buttons, each with an instance name of Example_1 thru Example_50.
I have a variable x whose value I would like to redefine based on the button pressed; i.e. Example_1 pressed, x = 1, Example_2 pressed x = 2, and so on.
Is there a way to do this that is more graceful than a button action for each button instance?
Thanks
Defining A Variable In MX
I would like to define the data in a dynamic text box named score as a variable, but I'm not really sure of the syntax.
thanks.
Defining A Variable. HELP...
Hey all,
I've got several nested thumbnail pics which are buttons, that when pressed, need to go into a another nested symbol, play the first ten frames, and then, depending on which thumb was pressed, go to a specific frame label.
I'm trying to define a variable on each button that's activated when pressed so it will remember and then go to the right label.
this is on the first btn;
on(press){
vendor="baileyStreet"
_root.homeDecor.gotoAndPlay("intro");
}
and then once it's played the ten frame intro I need it to jump to a specific frame in that same symbol by acknowledging the defined variable and going there.
this is on the last frame after the intro;
stop();
gotoAndPlay(vendor);
I'm doing something wrong because it's just sits on the 10th frame and doesn't go anywhere. I need some help!
thanks...
Defining A Variable... HELP... (again)
I've got several nested thumbnail pics which are buttons, that when pressed, need to go into a another nested symbol, play the first ten frames, and then, depending on which thumb was pressed, go to a specific frame label.
I'm trying to define a variable on each button that's activated when pressed so it will remember and then go to the right label.
this is on the first btn;
on(press){
vendor="baileyStreet"
_root.gotoAndPlay("home decor vendors");
}
and then once it's played the ten frame intro I need it to jump to a specific frame in that same symbol by acknowledging the defined variable and going there.
this is on the last frame after the intro;
gotoAndPlay(vendor);
Once a variable is defined, it's global right? Not just applicable to that nest level... It's got to be a syntax issue, but I can't figure it out. would really appreciate some enlightenment...
thanks...
Preloader Defining A Variable
is there anyway in which I can cause certain events to take place in relation to the percentage at which the preloader has reached. i've been trying to make a variable dynamically alter and thus allow movie clips to play as they are loaded and cannot for the life of me get the thing to work. any help would be much appreciated
Defining Variable Problem... Please Help
Duplicating a movie clip and each one has to load data from a different file, duplicate 1 loads data from 1.txt, duplicate 2 loads text from 2.text... etc.
And at the same time each duplicate loads an image.
Atm my code works if you run the script to loads the data and image into the first duplicate but not if i want to do it for multiple movieclips.
In order to load multiple data im doin this:
Also I have commented how ive tried to create variable with an incremented value withe each. (see line 2 of the code)
Code:
//XY = Duplicate count
for(var L = 1;L<XY;L++){
["loadText"+L] = new LoadVars(); //Is this possible to do? Can i create a variable like this, if so is this the way to do it?
["loadText"+L].load("Card"+L+"/data.BC");
["loadText"+L].onLoad = function(success){
if(success){
var ComTxt = this.Company;
var NamTxt = this.Name;
var AddTxt = this.Address;
var cNumber = this.TNumber;
var eAddie = this.Email;
var eAddLab = this.EmailLabel;
var BacTxt = this.Background;
var wAddie = this.Website;
var wAddLab = this.WebsiteLabel;
var ConTxt = cNumber + ", <a href='mailto:" + eAddie + "'><u>" + eAddLab + "</u></a>";
var WebsTxt = "<a href='" + wAddie + "'><u>" + wAddLab + "</u></a>";
_root.Holder["crdHld"+L].C1.FrontCard.CompanyTxt = ComTxt;
_root.Holder["crdHld"+L].C1.FrontCard.NameTxt = NamTxt;
_root.Holder["crdHld"+L].C1.FrontCard.AddressTxt = AddTxt;
_root.Holder["crdHld"+L].C1.FrontCard.ContactTxt.htmlText = ConTxt;
_root.Holder["crdHld"+L].C1.BackCard.BackGTxt = BacTxt;
_root.Holder["crdHld"+L].C1.BackCard.WebTxt.htmlText = WebsTxt;
trace("Loaded");
}else{
trace("Loading");
}
var mc_holder:MovieClip;
mc_holder = _root.Holder["crdHld"+L].C1.FrontCard.ImgHld.Hlder;
mc_holder.loadMovie("Card"+L+"/img.png");
this._lockroot = true;
};
}
Someone help me out soon.
Cheers
Defining A Variable Within A Function
I am bringing in some values from an XML document and am having mixed success.
I am retrieving an attribute from a node(postit) in the xml doc and trying to assign it to a variable called postTitle in my AS; this happens inside an onLoad function which i believe is an acceptable method when retrieving values from an xml doc. When I trace this variable inside the function it outputs fine however I need the variable to be accessible outside the function as it needs to be displayed with a dynamic text box.
As you can see I have tried defining the variable before the function but when this happens the output is some html tags. The code is annotated.
Thanks in advance. Gareth
Code:
<stickies>
<gcse>
<postit title="Example Title 1" maintext="test text" />
</gcse>
</stickies>
Code:
var postTitle:String;
my_xml.onLoad = function(success){
var gcse = my_xml.firstChild.firstChild;
var postit = gcse.childNodes;
for (var i=0; i<postit.length; i++){
currPostit = postit[i];
var postTitle = currPostit.attributes.maintext;
trace(postTitle);//outputs ok within the function
}
}
trace(postTitle); //does not output at all or outputs html tags (<p align="left"></p>)
Defining Variable In Movieclip
I'm kinda new to AS3 right now, and I have a question.
How do you define a variable in a movie clip and access it in an event?
Thank you,
GamerFlash
[F8] Help Defining Special Variable
i have been messing around with flade tonight and im trying to create 10 circle particles with a for loop the only problem is that i need to know how to use the for loop to create each cirlce
Code:
var ["p"+i]:CircleParticle;
["p"+i]= new CircleParticle(px, py, 1);
Trouble Defining Variable
Hey, I'm kinda new to Actionscript 3.0, and I'm having trouble defining a variable. The best way to illustrate is to view the attached code.
I have a movie clip in the library named "block". I can get similar code to work fine adding one at a time, but when I try to do it through a loop, no dice.
I'm getting a syntax error when I define the MovieClip. The error I get says "1086: Syntax error: expecting semicolon before leftbracket.
Attach Code
import flash.display.MovieClip;
var m:Number = 10;
var n:Number = 10;
for (var i = 0; i < 2; i++) {
var block[i]:MovieClip = new MovieClip();
block[i] = new block;
block[i].name = "block" + i;
block[i].x = m + 10;
john[i].x = n + 10;
addChild(block[i]);
}
Creating/defining A Clip Variable
I need the variable myClip to have the same value as content_win_about.
I used the following code to create the vars:
Code:
var area:String = "about";//area changes value
var myClip:String = "content_win_"
myClip += area;
Then I have this to create the clip:
Code:
_root.content.createEmptyMovieClip(instanceName=myClip, getNextHighestDepth)
//THERE IS NO SPACE IN MYCLIP, DON'T KNOW WHY IT SHOWED UP THAT WAY
and this to test:
Code:
if (_root.content.content_win_about != undefined) {trace('Clip is defined.);}
//RESULT: "CLIP IS DEFINED"
if (_root.content.myClip != undefined) {trace('Clip is defined.);}
//RESULT: ---(NOTHING)---
(Trigger is a rollOver btn)
It is creating the clip, but it is only recognized by content_win_about. Is there something wrong with how I am defining this var.
[NOOB Q] Defining A Variable That Identifies A Url... Or Something...
Hey gang,
Please forgive the noob question. For some reason I'm just coming up blank (haven't paid much attention to this type of variable before).
I'm putting together a presentation for work that has 4 sections, each with a bunch of externally loaded swfs in them. I've created a button for each section tied to the beginning of each section's frame label, so that the user can skip around from section to section if needed (I also have nav buttons that go straight through the presentation that I don't need help with).
My section buttons need to be set to fade out the current movie on the stage and then unload it, then fade in the movie associated with the frame label. I understand how to do all that.
What I need is to define a variable named "currentMovie" that will store either the url of the loaded swf currently on the stage or the incidence name of the empty mc it resides in on the stage so that the button code knows which swf to fade and unload.
I hope I'm making sense. I can provide what I've done so far if it's needed.
Can anyone help me define this variable? MX04 and AS2.0
Thanks!
-Sandy
Text Variable-Defining Font
I am working on this page, click on CLIENT LIST, I used a simple text scroller, however doing it this way I have not figured out how to define the font of this text that is loaded in.
http://www.philly-productions.com/flash/about.html
I am using BellGothic PL, which is not a standard font, but I need it to work on dynamic text just like it works on static text. How can I define it to this dynamic text field with the variable of the text that is loaded in? The text field font is BellGothic PL, but it still loads in as whatever the default text is on the users computer.
Any advice/suggestions greatly appreciated!
Tell Targets: Defining A Frame Label With The Value Of A Variable
I am trying to tell a movie clip to go to a certain frame label. Instead of writing hundereds of if/then statements, can I tell the movie clip to go to a frame label that is defined by the value of a variable...?
In other words, can I do this:
tellTarget("/main") {
gotoAndStop ("the value of a variable");
}
any help would be appreciated
Defining Object Color In Flash By Asp Variable
Hi,
I'd like to define a color of an object in flash, by entering a hexcode value into a variable which is then passed on to the swf.
I really have no clue how to do this.
I read the tutor 'asp and flash' on asp101.com from Dan but i still don't seem to be able to figure out how to do this.
Any help would be greatly appreciated.4
Defining Increasing Variable (easy Question)
Hi, so well i have what should be a fairly easy question.
I have loaded in say, n variables by FlashVar so that there is _root.path0, _root.path1 ..... _root.pathn. Now i only want to load in all of these into a array called path.
If you look at the for-loop right now i have this path[inc] = _.root.path+i. I know this doesn't work but i explains what i want to do. I only want path[1] to be _root.path1 and path[2] to be _root.path2 etc. But i don't know the right syntax in Flash, it's easy as that. The number of path's are NOT fixed.
And one more question, using FlashVar, is the flashmovie loaded with the variables or do i have to check when they are loaded before doing actions?
Attach Code
var inc = 0;
for (i in target_mc) {
path[inc] = _root.path+i
inc++;
}
Variable I Undefined
hi guys, i have a little problem of variable path.
i have a for loop and i attached dinamically my list of buttons.
But if i try to take the i value inside the event handler "on releale" of the button it returns undefined.
I want to know how i can use i using relative paths.
Thanx for help.
for (var i=1; i<=bt_array.length; i++) {
var namebt = bt_array[i];
this.menuContainer.attachMovie("myMc",namebt,i);
this.menuContainer[namebt]._y = y_increment;
this.menuContainer[namebt].onRelease = function() {
projectID = i;
trace(projectID); //problem: return undefined!!!
}
}
Undefined Variable
Hi all,
Why do i get undefined when i use the following;
Code:
loadVariablesNum ("quotes.txt", 0);
newquote = random(numQuotes);
_root.myquote = eval("quote" +newquote+ "txt");
Regards,
mic
Undefined Variable HOW?
Hi i am creating a variable called startAboutY which is used to store the Y position of my movie clip aboutContent_mc. To test that there are no errors i have placed this using trace statement trace("startAboutY variable" + startAboutY); on my actions layer line 40. However, when testing it i keep getting error "variable undefined" . So when i look at where i have defined it in my code it looks perfectly fine. So i really do not understand why it says that?? The code before it ie startHomeY, is perfectly normal so i don't get why my second variable is not working. Can somebody give me some assistance please.
Thanks
Undefined Variable
I'm using a conditional to set a variable based on the answer:
Code:
if ((H1 > 5) && (H1 < 11 )) {
setProperty (_root.checkKeyN, _visible, 1);
setProperty (_root.redXKeyN, _visible, 0);
var H1Score:Number = 1;
\trace (H1Score);
}else {
setProperty (_root.redXKeyN, _visible, 1);
setProperty (_root.checkKeyN, _visible, 0);
var H1Score:Number = 0;
\trace (H1Score);
}
Tracing the code (commented out in the example) gives me the respective value.
When I go to call that variable on a button release and display the variable's content in a dynamic text field, I get undefined, but I don't know why.
Here's the code
Code:
on (release) {
_parent.cardAScoretxt.text = H1Score;
}
Can someone please tell me what I am doing wrong?
[F8] Undefined Variable
im loading .txt files externally in to my swf, and when i test the movie it works, but qhe the swf or exe are exported its says variable undefined, i already checked the directorues and evething its working
can someone help me plz
Variable's Value 'undefined'?
Hi
I am trying to assing a variable the value of a text input component. But, when I trace my var, i get 'undefined'. The value I am trying to assing is a number.
this the code i have inside a function: (The value i should be getting is 2 as that's what appears on the text input)
Code:
var variable = textInput.text;
trace(variable);
Any help will be very much appreciated.
Thanks,
E
Variable Value Undefined...
Here is this code:
ActionScript Code:
for (t=1; t<5; t++) {
if (arrows[t] == true) {
test = '_root.arrow_'+t;
test._visible = true;
}
test._visible returns as undefined
I know that arrows[t] will always be true (at least for testing purposes)
So, arrows[1] = true, arrows[2] = true, etc.
_root.arrow_1 is a MC on the stage and has visibilty set to false first thing
What am I missing?
Thanks for any help!!!
Undefined Variable
Hi. I just can figure out why this code will not work!
var WhatString:String = WhatButton;
trace(WhatString);
var Substring:String = WhatString.substring(6,7);
trace(Substring);
WhatButton is a var from elsewhere in the code. The first trace statement works, but the second is undefined?!?
If i change the first line to :
var WhatString:String = "WhatButton";
it works fine, but its important that the WhatButton is a variable.
Anyone got a clue?
bmolbach
Undefined Variable. But Why?
Hello everyone.
I have troubles with an undefined variable.
I have three movieclips (a,b,c):
b scrolling limits are "controlled" by variable "i" setted in a.
c is a movieclip that must appear only for a certain value of "i" established as follow.
a has this script:
onClipEvent (mouseDown) {
if(this.hitTest(_root._xmouse,_root._ymouse,false) ){
if (_parent.i < 50) {
_parent.scrolling.fine -= 96;
_parent.i++;
}
}
}
In the first frame of main timeline is written:
i=1; // to let limits of scrolling movie
And adding:
if (i=1) {
mc._alpha=100; }
else {mc._alpha=0;}
it doesn't work!
c is visible but, after clicking on a to scroll b, c remains still visible (while, "i", that lets scrolling, has changed to 2).
How can I resolve, please?
Thank you very much.
Undefined Variable
on level 0 : I have variable1=23;
by clicking on a button : loadmovie test.swf on level 1
once the test.swf loaded :
on level 1 another button with AS :
dir=level0:variable1
on (release) {
_level0.gotoAndStop(dir); // but this button don't work
}
the error is in the AS of this button.
by typing the AS : _level0.gotoAndStop(23); everything is ok. The AS works.
So I made a trace(typeof(dir)) and the result is : undefined
who can I get this button to work ? do I have to transform the variable dir to a number ???
is there another possibility?
thanks for your help
Variable Undefined
we have this variable from the internet, val(0), in a dynamic text field we can see a digit from this variable. but when we use this variable in actionscript and test it with trace, the variable shows as undefined.
how can we make this work without it coming up as undefined??
Undefined Variable
on level 0 : I have variable1=23;
by clicking on a button : loadmovie test.swf on level 1
once the test.swf loaded :
on level 1 another button with AS :
dir=level0:variable1
on (release) {
_level0.gotoAndStop(dir); // but this button don't work
}
the error is in the AS of this button.
by typing the AS : _level0.gotoAndStop(23); everything is ok. The AS works.
So I made a trace(typeof(dir)) and the result is : undefined
who can I get this button to work ? do I have to transform the variable dir to a number ???
is there another possibility?
thanks for your help
Variable Undefined?
on the first frame of my movie I have
counter == 0;
a few frames later I have a trace(counter); and it says my variable is undefined? Why is this? Thanks!
Undefined Variable?
almost got this working, but still need a little help!
this is an example of what i type...
http://www.mysite.com/test.swf?folder=64
this is what i get...
undefined
I have created a test swf file to make sure the variable is sending and coming back the way i want it. here is my script in php....
if($member->active == 1){
$fileURL="http://www.mysite.com/test/",$folder,"/mytest.xml";
print "playurl=$fileURL";
}
i am not sure how exactly it pulls the variable from flash, but i think it works for my mysql stuff that i have in the php file.
Here is my actionscript in flash....
lvOut = new LoadVars();
lvIn = new LoadVars();
lvIn.onLoad = function (success)
{
_root.vartext.text = lvIn.playurl;
}
lvOut.folder = _level0.folder;
lvOut.sendAndLoad("http://www.mysite.com/variables.php?folder=" + _level0.folder + "", lvIn, "POST");
I got that script from a post on this site, but just edited it so it will work with my variables. the part where it says...
lvOut.sendAndLoad("http://www.mysite.com/variables.php?folder=" + _level0.folder + "", lvIn, "POST");
i tried loading just variables.php instead of the ?folder= blah, and that did not work either
if there is anything i need to change, please tell me!!!! i need to get this freakin script working!
Thanks!
Tim
Undefined Variable
Hello,
I am trying to dynamically stop a series of movie clips using the code below. The problem I am having is that I am getting an "undefined" error when I try to trace trans[i]. Is this not the proper way to evaluate the [i] variable? Can anyone tell me how this would be done?
Thanks!
var trans = 2
for (i = 1; i<=trans; i++) {
_root.trans[i].stop();
trace(trans[i]);
}
Variable 'undefined' With If/Else
Hi, what Have I done wrong! I want 'time' to return a number from the function it fires, So that it gets placed into the alphaTo Function ....>
OK have a look
Code:
blocks = 6;
for(i=0;i<blocks;i++){
var time:Number = xSym();
function xSym(){
if (i<blocks/2){
time = i;
}
else{
time = i - blocks;
}
}
_root["block"+i].alphaTo(0,time);
}
So you see that I want to return a Number to 'time' ... How do I Return the Number???????????
Help appreciated!
Variable Undefined
we have this variable from the internet, val(0), in a dynamic text field we can see a digit from this variable. but when we use this variable in actionscript and test it with trace, the variable shows as undefined.
how can we make this work without it coming up as undefined??
Undefined Variable
on level 0 : I have variable1=23;
by clicking on a button : loadmovie test.swf on level 1
once the test.swf loaded :
on level 1 another button with AS :
dir=level0:variable1
on (release) {
_level0.gotoAndStop(dir); // but this button don't work
}
the error is in the AS of this button.
by typing the AS : _level0.gotoAndStop(23); everything is ok. The AS works.
So I made a trace(typeof(dir)) and the result is : undefined
who can I get this button to work ? do I have to transform the variable dir to a number ???
is there another possibility?
thanks for your help
Variable Undefined?
on the first frame of my movie I have
counter == 0;
a few frames later I have a trace(counter); and it says my variable is undefined? Why is this? Thanks!
Undefined Variable. Why, Please?
Hello everyone.
I have troubles with an undefined variable.
I have three movieclips (a,b,c):
b scrolling limits are "controlled" by variable "i" setted in a.
c is a movieclip that must appear only for a certain value of "i" established as follow.
a has this script:
onClipEvent (mouseDown) {
if(this.hitTest(_root._xmouse,_root._ymouse,false) ){
if (_parent.i < 50) {
_parent.scrolling.fine -= 96;
_parent.i++;
}
}
}
In the first frame of main timeline is written:
i=1; // to let limits of scrolling movie
And adding:
if (i=1) {
mc._alpha=100; }
else {mc._alpha=0;}
it doesn't work!
c is visible but, after clicking on a to scroll b, c remains still visible (while, "i", that lets scrolling, has changed to 2).
How can I resolve, please?
Thank you very much.
AS3 Undefined Variable
Can someone help me out with why this error "ReferenceError: Error #1065: Variable navigation is not defined.at main_fla::MainTimeline/frame2()" keeps occurring. The code I am using is below.
ActionScript Code:
//Loads Navigation
function Nav()
{
var navigation:nav = new nav();
navigation.x = 440;
navigation.y = 432;
addChild(navigation);
}
Nav();
navigation.user_mc.addEventListener(MouseEvent.CLICK, onRollover);
function onRollover(event:MouseEvent):void {
trace("TRACE!");
}
I have no idea why this isn't working.
Thanks,
Chris
Undefined Variable
If I run this on flash1.swf
_root.container.loadMovie("enemy.swf");
Then on the second one I have a movie clip with this
onClipEvent (load) {
_root.enemyname = "Dragon";
_root.enemydef = 5;
}
Then back on flash1.swf why can't I do trace(_root.enemydef); I get undefined.
What Happens When A JS Variable Is 'undefined' And Sent To Flash?
Need to confirm this.
I have a JS variable that initially may be undefined to Javascript. Once this variable is sent to a Flash variable, if it is undefined originally, it becomes an empty string. "".
When evaluating in flash, undefined or null both fail, but "" correctly evaluates it as empty. However, in JS, evaluating it BEFORE it is sent ot flash returns undefined.
Is this consistent and correct behavior that I can rely on to occur 100% of the time?
Undefined Class Variable
Hi,
I have a class like this one:
PHP Code:
class Tank extends MovieClip {
var MyTank:MovieClip;
var UserName:String = '';
function Tank(_tank_id:MovieClip,_UserName:String){
MyTank = _tank_id;
UserName = _UserName;
trace(UserName);
}
public function RunEngine() {
trace(UserName);
}
}
So, the first trace does work, but the secound one returns undefined.
But the Variable MyTank is working just fine.
I just dong get it. What am i doing wrong?
Hope you can help me, thank
Testing For Undefined Variable
Hi folks,
Just trying to test for an undefined variable. Here's what doesn't work:
Code:
if (_global.count == undefined) {
trace ("worked");
}
Undefined Variable Outside Of Function HELP
Hi, im pulling in an xml document. Ive pushed all the nodes in to arrays and have successfully performed calculations on some variables. Now, i have the arrays defined as _.global arrays, but when i try and trace them outside the function they are undefined. They trace fine inside the function.
Is ther anyway of accessing these variables outside the function???
this is my file, as you can see at the botttom i am trying to trace the variables but it wont work???
PHP Code:
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("stocks.xml");
_global.indicename = new Array();
_global.currentprice = new Array();
_global.valuechange = new Array();
_global.newLocation = new Array();
function loadXML(loaded) {
if (loaded) {
for (i=0; i<3; i++) {
_global.indicename.push(this.firstChild.childNodes[i].childNodes[0].firstChild.nodeValue);
_global.currentprice.push(this.firstChild.childNodes[i].childNodes[1].firstChild.nodeValue);
_global.valuechange.push(this.firstChild.childNodes[i].childNodes[2].firstChild.nodeValue);
}
for (i=0; i<_global.indicename.length; i++) {
trace("Symbol = "+_global.indicename[i]);
trace("Current Price = "+_global.currentprice[i]);
trace("Value Change = "+_global.valuechange[i]);
_global.mySubstring = _global.valuechange[i].substr(0, 1);
if (_global.mySubstring == "+") {
_global.origprice = parseFloat(_global.currentprice[i])-parseFloat(_global.valuechange[i]);
trace("Original Price = "+origprice);
//Following finds percentage change
_global.percentage = parseFloat(_global.valuechange[i])/parseFloat(_global.origprice)*100;
trace("Percentage Change = "+percentage);
_global.newLocation[i] = _global.percentage*100;
trace("Move To >"+newLocation[i]);
}
if (_global.mySubstring == "-") {
_global.origprice = parseFloat(_global.currentprice[i])-parseFloat(_global.valuechange[i]);
trace("Original Price = "+origprice);
//Following finds percentage change
_global.percentage = parseFloat(_global.valuechange[i])/parseFloat(_global.origprice)*100;
trace("Percentage Change = "+percentage);
_global.newLocation[i] = _global.percentage*100;
trace("Move To >"+newLocation[i]);
}
if (_global.mySubstring == "0") {
_global.origprice = parseFloat(_global.currentprice[i])-parseFloat(_global.valuechange[i]);
trace("Original Price = "+origprice);
//Following finds percentage change
_global.percentage = parseFloat(_global.valuechange[i])/parseFloat(_global.origprice)*100;
trace("Percentage Change = "+percentage);
_global.newLocation[i] = _global.percentage*100;
trace("Move To >"+newLocation[i]);
}
}
}
}
trace(indicename[0]);
trace(currentprice[0]);
trace(newLocation[0]);
this is my xml file,
PHP Code:
<?xml version="1.0" encoding="utf-8" ?>
- <indices>
- <indice>
<BVSP>BVSP</BVSP>
<indiceprice>60532.40</indiceprice>
<valuechange>+80.30</valuechange>
</indice>
- <indice>
<MXX>MXX</MXX>
<indiceprice>30647.39</indiceprice>
<valuechange>+557.49</valuechange>
</indice>
- <indice>
<MERV>MERV</MERV>
<indiceprice>2085.20</indiceprice>
<valuechange>-4.51</valuechange>
</indice>
</indices>
Undefined Variable Trouble
Hi guys, i am having a LOT of poblems with this.... So i really appriciate it if anyone helps out. In my key frame i have the following code
Code:
var receiver:LoadVars = new LoadVars();
receiver.onLoad = function(ok:Boolean):Void {
if (ok) {
_root.numberttl = Number(receiver.total);
_root.ttl = Number(receiver.total)+1;
for (n=0; n<_root.ttl; n++) {
_root["id_"+n] = receiver["id_"+n];
trace(_root["tn"+n]=receiver["tn"+n]);
trace(_root["sold"+n]=receiver["sold"+n]);
trace(_root["listing"+n]=receiver["listing"+n]);
trace(_root["description"+n]=receiver["description"+n]);
trace(_root["price"+n]=receiver["price"+n]);
trace(_root["address"+n]=receiver["address"+n]);
// Actions
}
} else {
_root.gotoAndStop(3);
}
if (_root.cpage == 1) {
#include "1.as"
}
};
receiver.load(_root.connect1);
stop();
For those of you wondering what include1.as contains
Code:
_root.cmc1.onRelease = function() {
getURL("http://yourcapecoral.com/homes.php?id="+_root.id_1, "_self");
};
_root.i1.m1.loadMovie("http://yourcapecoral.com/wizard/data/"+receiver.tn1);
_root.cmc1.d.text = receiver.address1;
_root.cmc1.a.text = receiver.description1;
_root.cmc1.p.text = "Price - $ "+receiver.price1;
_root.cmc1.seller.text = receiver.sold1;
if (receiver.sold1 == true.toString()) {
_root.cmc1.f.gotoAndStop(3);
} else if (receiver.sold1 == false.toString()) {
_root.cmc1.f.gotoAndStop(2);
}
////////////////////////////////////////////////////////////////////////////////////////////
_root.cmc2.onRelease = function() {
getURL("http://yourcapecoral.com/homes.php?id="+_root.id_2, "_self");
};
_root.i2.m2.loadMovie("http://yourcapecoral.com/wizard/data/"+receiver.tn2);
_root.cmc2.d.text = receiver.address2;
_root.cmc2.a.text = receiver.description2;
_root.cmc2.p.text = "Price - $ "+receiver.price2;
_root.cmc2.seller.text = receiver.sold2;
if (receiver.sold2 == true.toString()) {
_root.cmc2.f.gotoAndStop(3);
} else if (receiver.sold2 == false.toString()) {
_root.cmc2.f.gotoAndStop(2);
}
////////////////////////////////////////////////////////////////////////////////////////////
_root.cmc3.onRelease = function() {
getURL("http://yourcapecoral.com/homes.php?id="+_root.id_3, "_self");
};
_root.i3.m3.loadMovie("http://yourcapecoral.com/wizard/data/"+receiver.tn3);
_root.cmc3.d.text = receiver.address3;
_root.cmc3.a.text = receiver.description3;
_root.cmc3.p.text = "Price - $ "+receiver.price3;
_root.cmc3.seller.text = receiver.sold3;
if (receiver.sold3 == true.toString()) {
_root.cmc3.f.gotoAndStop(3);
} else if (receiver.sold3 == false.toString()) {
_root.cmc3.f.gotoAndStop(2);
}
////////////////////////////////////////////////////////////////////////////////////////////
_root.cmc4.onRelease = function() {
getURL("http://yourcapecoral.com/homes.php?id="+_root.id_4, "_self");
};
_root.i4.m4.loadMovie("http://yourcapecoral.com/wizard/data/"+receiver.tn4);
_root.cmc4.d.text = receiver.address4;
_root.cmc4.a.text = receiver.description4;
_root.cmc4.p.text = "Price - $ "+receiver.price4;
_root.cmc4.seller.text = receiver.sold4;
if (receiver.sold4 == true.toString()) {
_root.cmc4.f.gotoAndStop(3);
} else if (receiver.sold4 == false.toString()) {
_root.cmc4.f.gotoAndStop(2);
}
////////////////////////////////////////////////////////////////////////////////////////////
_root.cmc5.onRelease = function() {
getURL("http://yourcapecoral.com/homes.php?id="+_root.id_5, "_self");
};
_root.i5.m5.loadMovie("http://yourcapecoral.com/wizard/data/"+receiver.tn5);
_root.cmc5.d.text = receiver.address5;
_root.cmc5.a.text = receiver.description5;
_root.cmc5.p.text = "Price - $ "+receiver.price5;
_root.cmc5.seller.text = receiver.sold5;
if (receiver.sold5 == true.toString()) {
_root.cmc5.f.gotoAndStop(3);
} else if (receiver.sold5 == false.toString()) {
_root.cmc5.f.gotoAndStop(2);
}
////////////////////////////////////////////////////////////////////////////////////////////
_root.cmc6.onRelease = function() {
getURL("http://yourcapecoral.com/homes.php?id="+_root.id_6, "_self");
};
_root.i6.m6.loadMovie("http://yourcapecoral.com/wizard/data/"+receiver.tn6);
_root.cmc6.d.text = receiver.address6;
_root.cmc6.a.text = receiver.description6;
_root.cmc6.p.text = "Price - $ "+receiver.price6;
_root.cmc6.seller.text = receiver.sold6;
if (receiver.sold6 == true.toString()) {
_root.cmc6.f.gotoAndStop(3);
} else if (receiver.sold6 == false.toString()) {
_root.cmc6.f.gotoAndStop(2);
}
////////////////////////////////////////////////////////////////////////////////////////////
_root.cmc7.onRelease = function() {
getURL("http://yourcapecoral.com/homes.php?id="+_root.id_7, "_self");
};
_root.i7.m7.loadMovie("http://yourcapecoral.com/wizard/data/"+receiver.tn7);
_root.cmc7.d.text = receiver.address7;
_root.cmc7.a.text = receiver.description7;
_root.cmc7.p.text = "Price - $ "+receiver.price7;
_root.cmc7.seller.text = receiver.sold7;
if (receiver.sold7 == true.toString()) {
_root.cmc7.f.gotoAndStop(3);
} else if (receiver.sold7 == false.toString()) {
_root.cmc7.f.gotoAndStop(2);
}
////////////////////////////////////////////////////////////////////////////////////////////
_root.cmc8.onRelease = function() {
getURL("http://yourcapecoral.com/homes.php?id="+_root.id_8, "_self");
};
_root.i8.m8.loadMovie("http://yourcapecoral.com/wizard/data/"+receiver.tn8);
_root.cmc8.d.text = receiver.address8;
_root.cmc8.a.text = receiver.description8;
_root.cmc8.p.text = "Price - $ "+receiver.price8;
_root.cmc8.seller.text = receiver.sold8;
if (receiver.sold8 == true.toString()) {
_root.cmc8.f.gotoAndStop(3);
} else if (receiver.sold8 == false.toString()) {
_root.cmc8.f.gotoAndStop(2);
}
////////////////////////////////////////////////////////////////////////////////////////////
_root.cmc9.onRelease = function() {
getURL("http://yourcapecoral.com/homes.php?id="+_root.id_9, "_self");
};
_root.i9.m9.loadMovie("http://yourcapecoral.com/wizard/data/"+receiver.tn9);
_root.cmc9.d.text = receiver.address9;
_root.cmc9.a.text = receiver.description9;
_root.cmc9.p.text = "Price - $ "+receiver.price9;
_root.cmc9.seller.text = receiver.sold9;
if (receiver.sold9 == true.toString()) {
_root.cmc9.f.gotoAndStop(3);
} else if (receiver.sold9 == false.toString()) {
_root.cmc9.f.gotoAndStop(2);
}
////////////////////////////////////////////////////////////////////////////////////////////
_root.cmc10.onRelease = function() {
getURL("http://yourcapecoral.com/homes.php?id="+_root.id_10, "_self");
};
_root.i10.m10.loadMovie("http://yourcapecoral.com/wizard/data/"+receiver.tn10);
_root.cmc10.d.text = receiver.address10;
_root.cmc10.a.text = receiver.description10;
_root.cmc10.p.text = "Price - $ "+receiver.price10;
_root.cmc10.seller.text = receiver.sold10;
if (receiver.sold10 == true.toString()) {
_root.cmc10.f.gotoAndStop(3);
} else if (receiver.sold10 == false.toString()) {
_root.cmc10.f.gotoAndStop(2);
}
Thing is what is soposed to load loads no probelm. but see i have all 10 defined up there, and if i dont want something to load it comes up undefined.... anyone have a solution for this?
(i tryed looping it, witch worked.... but the buttons wouldnt go anyplace....
plus when someone presses the next button cpage will change to 2 and a different as file will be included, wich looks exactly the same but with different numbers....)
I really do appriciate any help, and thank you for your time.
~Gabor Szauer
Undefined Defined Variable...
Hi guys, i have
Code:
c1.cardName = "A7";
trace(c1.cardName);
on my main timeline, but it traces "Undefined"....
Does anyone know what is wrong with this, or how to fix it?
I appriciate your time
~Gabor
Radio Variable - Every Other Undefined
I'm running multiple groups of radio buttons at differnt places in my timeline - all are named the same.
Each time I click to submit and go to the next section of frames / radio buttons I run this script to send the variables to a processing page:
---
on(release){
// int form variables:
formData = new LoadVars();
formData.d = "";
formData.i = "";
formData.s = "";
formData.c = "";
// Get radio button selections:
formData.d = d.getValue();
formData.i = i.getValue();
formData.s = s.getValue();
formData.c = c.getValue();
// Get querystring input global variable:
formData.id = id;
d = formData.d;
i = formData.i;
s = formData.s;
c = formData.c;
id = formData.id;
gotoAndPlay(126);
}
---
This works fine for the first set then I get undefined for the second.. works fine for the third set then I get undefined for the fourth.. and so on and so forth.. I assume that I'm not "closing" the variables correctly but I thought by setting them all to = "" at the start of each button I'd be alright. I've been trying to pick this apart forever and would appreciate any input - thanks!
Aaron
forwardtrends.com
Global Variable Undefined
Hi folks, here is the set up. I'm working with three files. Main.swf which contains navigation.swf in a blankmc, empty mc called mcContent where navigation sleclected materials are loaded.
In the navigation.fla here is the code
ActionScript Code:
trace("now defining global"); _global.loadFile_str = strPicName; trace("global defined as"); trace(_global.loadFile_str);_root.mcContent.loadMovie("monthlyreports.swf");
which leads to the trace results of...
ActionScript Code:
now defining globalglobal defined asimages/cbookings.jpg
when i do a trace of loadFile_str in the first frame of monthlyreports i get a undefined. I have tried trace(loadFile_str) and trace(_global.loadFile_str)
I also noticed that if i define the global on the main movie ( it maintains the global variable, the navigation fla will not overwrite it) not sure if that helps anything but i thought i let you know.
Thanks for any help.
Help With Undefined Variable Problem
Hi!
I'm working on a photogallery and I'm using xml to load names, images…
the problem is: I want a button to open a new browser window but something is wrong with the variable, I think it is because of the function, but still don't know how to solve it…
Would appreciate very much any comment or help
Here's where I think the problem is:
ActionScript Code:
this.onEnterFrame = function() { var bytes_loaded = holder.boton.getBytesLoaded(); var bytes_total = holder.boton.getBytesTotal(); var percent_loaded = Math.round((bytes_loaded/bytes_total)*100); _root.txt_mc.name.text = percent_loaded+" %"; if (percent_loaded == 100) { holder._alpha += 10; if (holder._alpha>=98) { holder._alpha = 100; _root.txt_mc.name.text = this.title; trace (this.link) /////when I trace this.link it works//// _root.txt_mc.onRelease = function() { getURL(_root.link, "_blank"); }; holder.onRelease = unloadImage; delete this.onEnterFrame; } } };
Thanks in Advanced!
Absurd Undefined Variable.
Hello everyone.
I have trouble with an undefined variable.
I have three movieclips (a,b,c):
b scrolling limits are "controlled" by variable "i" setted in a.
c is a movieclip that must appear only for a certain value of "i" established as follow.
a has this script:
onClipEvent (mouseDown) {
if(this.hitTest(_root._xmouse,_root._ymouse,false) ){
if (_parent.i < 50) {
_parent.scrolling.fine -= 96;
_parent.i++;
}
}
}
In the first frame of main timeline is written:
i=1; // to let limits of scrolling movie
And adding:
if (i=1) {
mc._alpha=100; }
else {mc._alpha=0;}
it doesn't work!
c is visible but, after clicking on a to scroll b, c remains still visible (while, "i", that lets scrolling, has changed to 2).
How can I resolve, please?
Thank you very much.
|