ActionScript 2.0 :: Else/if With Loaded Variables?

Jul 7, 2007

I'm trying to create a quick prototype of an application so i decided to use text file based variables. This was an hours work that has turned into a days worth of hassle.I just cannot get the else/if statements to work with my variables. Here is a simplified code that I am trying to use:

Code:
myData = new LoadVars();
myData.onLoad = function(){
displaybut();

[Code]...

View 2 Replies


Similar Posts:


ActionScript 3.0 :: Accessing Variables In A Loaded Swf

Jul 1, 2009

I am creating a flash program to open other flash programs (load swf files), and change their textfields to my own extended textfield class. This is to capture all text written to screen using a textfield object. Here is what I am doing:

1. If a textfield has been created, the event is captured

2. I want to replace the textfield with my own class extending textfield

*3. Any further access to the original textfield for value changes can be captured, and would update the replaced extended textfield object

The problem is if in their original code, at sometime, the text value of textfield is changed (mainly through textFieldObj.text = some_value) , I don't know how to capture this event.

This cannot be captured by event.CHANGE which requires the user input (ie: keyboard strokes) into the actual text field and changing the text through the code: textFieldObj.text = some_value does not trigger the event.

Here is a simplified example:

// FlashMovie.fla START -------------------------------------------
// any DisplayObjects (such as a created textfield) created will be captured
// by ChildAdded()
this.addEventListener(Event.ADDED, ChildAdded);

[Code]....

View 0 Replies

Actionscript 3.0 :: Accessing Variables Of A Loaded SWF?

Jan 12, 2011

I'm having a SWF call functions from another SWF loaded in the first one with the Loader class. There are no problems as long as the target SWF does not contain any TLF TextFields created on stage by authoring time interface. As soon as I place a dynamic textfield on the stage of the loaded SWF, the main SWF (the loader) fails to call any of the functions within the SWF that is being loaded.Static text does not seem to present problems and neither do TextFields created via ActionScript.Also, is it possible to access variables of the parent SWF?

View 2 Replies

ActionScript 2.0 :: Accessing Variables In A Loaded .swf?

Dec 5, 2003

I am having a problem accessing variables in a loaded flash movie.

As my understanding goes (someone please correct me if I am wrong), if I load a flash movie into a parent movie (i.e. 'loadMovie("myMovie", emptyClip);'), I should be able to access the loaded movie's variables using dot-syntax.

As an example, say I have two movies: MainMovie.swf, and SubMovie.swf. SubMovie.swf contains a (global) variable called someText. After loading SubMovie into an empty movie clip called "emptyClip", MainMovie.swf should be able to access the aforementioned variable by saying "emptyClip.someText", right....? Well, when I try this I keep getting an undefined value for the variable.

View 7 Replies

ActionScript 2.0 :: Load Variables From Loaded SWF's

Jan 6, 2005

I am developing a flash board game which entails moving a piece around a board as a result of throwing a dice (the person will either move the dice themselves or it will move according to the outcome of the throw). When they land on particular squares I am going to have a random question (this is going to be a loaded SWF) appear that will have a multiple choice questions.Can I save the result of 'multiple choice question' within the main movie / separate movie and then use this variable ?

View 4 Replies

ActionScript 2.0 :: Passing Variables From Loaded Swf?

Jun 29, 2008

so I have menu.swf that uses loadClip to bring in data.swf

Depending on what button is pressed I want menu to read menuHeight = 4600; from data.swf

in data swf I declare the var as _root.menuHeight = 4600;

and in menu.swf I try to read it as normal. menuHeight.

Shouldnt this work since the _root. of data.swf is the _root. of menu.swf?

View 2 Replies

ActionScript 3.0 :: Variables Won't Carry Over To Loaded Mc

Jul 5, 2010

in my script, when a button is clicked it loads a movie clip from the library onto the stage

but what that movie clip does is supposed to be dependant on what button is being pressed. however that movie clip being loaded onto the stage doesn't seem to recognize or load any of the variables from the stage.

its as if, since the movie clip does not exist when the fla is initially run, the movie clip doesnt recognize previously existing variables.. or doesnt recognize any variables outside of itself

View 6 Replies

Actionscript 3 :: Accessing Variables Of Of Loaded Swf?

Dec 13, 2011

I'm loading swf externally. I need to access it's methods and variables. This is the code I'm using:

import flash.display.Loader;
import flash.net.URLRequest;
import flash.events.Event;

[code]....

View 2 Replies

ActionScript 2.0 :: Passing Variables To Loaded Swf?

May 15, 2011

i have a swf file that i am loading into a parent movie and i need to pass some variables to the loaded movie, unfortunately i do not have the original fla file of the movie being loaded in so i cannot use _root or _global ect..the swf that is being loaded in works fine and originally intended to have the variables passed though flashvars, is there any way i can pass these variables though the parent without having to change the fla of the loaded in swf

View 1 Replies

ActionScript 2.0 :: Accessing Variables In A Loaded .swf

Dec 5, 2003

if I load a flash movie into a parent movie (i.e. 'loadMovie("myMovie", emptyClip);'), I should be able to access the loaded movie's variables using dot-syntax.As an example, say I have two movies: MainMovie.swf, and SubMovie.swf. SubMovie.swf contains a (global) variable called someText. After loading SubMovie into an empty movie clip called "emptyClip", MainMovie.swf should be able to access the aforementioned variable by saying "emptyClip.someText", right....? Well, when I try this I keep getting an undefined value for the variable.

View 7 Replies

ActionScript 2.0 :: Pass Variables To A Loaded Swf?

Apr 25, 2004

Is it possible to pass variables to a swf that is being loaded from another swf without using GET or POST or loadVariables?Maybe a function? If so what is the code?

View 6 Replies

ActionScript 2.0 :: Loading Variables From Loaded SWF's

Jan 6, 2005

I am developing a flash board game which entails moving a piece around a board as a result of throwing a dice (the person will either move the dice themselves or it will move according to the outcome of the throw). When they land on particular squares I am going to have a random question (this is going to be a loaded SWF) appear that will have a multiple choice questions. My question to you guys is this. Can I save the result of 'multiple choice question' within the main movie / separate movie and then use this variable? I think essentially what I am asking is how do I load a variable from an external SWF.

View 4 Replies

ActionScript 3.0 :: Accessing Variables In Loaded SWFs

Oct 12, 2009

If I load an SWF file, is it possible for the pre-loader to access and change a string variable inside the loaded swf? Is there any special way to do this or would it be a simple case of loadedMC.variable = "new value"

View 3 Replies

ActionScript 3.0 :: Loaded External SWF - Variables Greyed Out

Jul 2, 2010

I'm trying to debug my movie, but the variables in the debugger are greyed out and I can't expand them. It also doesn't show the progress through the code. I think it's related to having loaded an external swf.

View 1 Replies

ActionScript 3.0 :: Report_field Can't Display Variables Loaded From Url

Dec 28, 2010

report_field can't display variables loaded from url. What's wrong in this script?

[Code]...

View 1 Replies

ActionScript 3.0 :: Accessing Variables In Loaded SWFs?

Mar 16, 2011

If I load an SWF file, is it possible for the pre-loader to access and change a string variable inside the loaded swf? Is there any special way to do this or would it be a simple case of loadedMC.variable = "new value"

View 2 Replies

Xml :: Assign The Loaded Txt File's Array To Variables?

Nov 21, 2011

I use following flash actionscript code, got from online, to load the "Loading.txt" file:

var myTextLoader:URLLoader = new URLLoader();
myTextLoader.addEventListener(Event.COMPLETE, onLoaded);
function onLoaded(e:Event):void {

[code].....

View 1 Replies

ActionScript 3.0 :: Grab Class Variables From Loaded SWF?

Sep 22, 2009

I have a project that works quite beautifully right now. I have come to my next task. Creating swfs that are loaded into another swf. This newly loaded swf needs to grab some variables from the main swf's document class or global variables class that I have created. I have set the class path as such that it can access the classes as needed. I did not set a document class.

Structure of loaded swf:

core.swf -> loadedBackground.swf -> interactive.swf

1.) Classes are all located in a folder titled classes

2.) cores.swf is outside the classes folder and is linked to document class within the classes folder: BuildCourse.as

3.) swfs folder contains the loadedBackground.swf and interactive.swf

4.) How can interactive.swf grab variables from the main.swf after it is compiled?

View 3 Replies

ActionScript 3.0 :: Passing Variables To Externally Loaded SWF?

Jan 30, 2011

how can I pass variables to externally loaded SWF written in AS2 ?

View 0 Replies

ActionScript 3.0 :: Access Variables Of Externally Loaded Swf?

May 12, 2011

I'm loading external swf's in a main swf, which are contained into a container "thisMC" which is a movieClip.

Now I've got various variables in these external swf's and I want to access these variables into my main swf.

eg - var myString:Variable = thisMC.myNumber;
trace("Whats the value "+myString);

o/p Whats the value undefined.so if myString is a variable that i've defined in the main swf and myNumber is a variable defined in the external swf, if I try accessing it like this , this is what I'm getting.

View 3 Replies

ActionScript 2.0 :: Ideas For Interpreting Loaded Variables

Feb 1, 2004

i am making a flash quiz game that loads questions and answers from an external .txt file and i was wondering how can I interpret with as something like this (i use the split function to make an array from the file):[code]

View 2 Replies

ActionScript 2.0 :: Make An Externally Loaded SWF And Variables

Feb 25, 2004

I'm tryin to do catalog on CD using flash. There will be 15 pages of items w/ the selections. The coding I'm using for their options is from this: [URL] Now my question is, since I can't use a DB because it's on a CD, I have to pass the variables through flash. But when they are done making all their selections how do I make an externally loaded SWF using this command:

[Code]....

read the final values that were selected on the specified pages? I've read lots of the threads concering passing variables and none of them. Also if anyone knows of any way to hold a DB on a CD and be able to write to it as well as read from it lemme know

View 8 Replies

ActionScript 2.0 :: Externally Loaded Txt And Urls With Variables

Jun 24, 2005

I've built a dynamic scrolling textbox that loads external text and formats it via css. Everything works as it should except I need to add some links in the text file that contain variables (i.e., something like this: [URL]

Flash will not interpret this properly as a normal html link in the loaed text file.

View 1 Replies

ActionScript 2.0 :: Setting Variables In A Loaded Movie

May 22, 2003

Can anyone tell me how to set variables in a child movie from a parent movie?[code]but it doesn't work!txtChild is a variable in the child.swf movie. (A dynamic text field with instance name "ChildText")

View 1 Replies

ActionScript 2.0 :: Passing Variables From Loaded SWFs

Jun 26, 2007

I'm working in a modular app and I'm having trouble passing variables between a Parent and it's loaded Child SWF file. The Child SWF has a single object called hotSpot_mc. The Parent has a frame called frame_mc to load the Child. I'm trying to pass the value of bHotSpot, which is turned on and off when the user mouses over the MovieClip. Testing shows that the value is being set in the Child but not in the Parent, where it remains undefined. Should I be using shared objects or do I just have to use better targeting?

Here is the parent SWF

Code:
// Load the child SWF into frame_mc
loadBackground("Room_1.swf");
function loadBackground(backgroundName:String):Void {

[Code].....

View 1 Replies

ActionScript 2.0 :: Referencing Variables In A Loaded Movie?

Sep 22, 2003

I'm having trouble referencing variables in a loaded movie. I read in other posts that you simply refer to the variable as if it belongs to the clip you load it into, however this doesn't seem to be working for me

View 2 Replies

ActionScript 3.0 :: Changes To Variables And Elements Are Not Reflected When One SWF Is Loaded Into Another

Apr 23, 2011

I am trying to figure out why changes to variables and elements are not reflected when one SWF is loaded into another. main.swf

[Code]...

When the main file is tested the out put of the traces is 50 & 300 which is what the variable and the bg object are set to at the top instead of what they changed to in the productsLoaded(event:Event) function. It's as if the myloader listener is ignoring changes to variables & elements inside of the loaded SWFs listener function. Seems wrong and very confusing.

View 1 Replies

ActionScript 3.0 :: Passing Variables To And From Externally Loaded SWF?

Jul 13, 2011

Then there is an external SWF that is loaded by main.swf. I am trying to get this external SWF to check the value of "myVar" and depending on what the value is, send the playhead in the main.swf to a certain frame. have it almost working, but it is giving me problems. And I am not sure it is the best way to do it.On the timeline of main.swf is a movieClip called "BG". It has 6 frames. the first frame declares that variable, and each of the other 5 frames, set the value of it. I need the external swf to check the value of "myVar" to detemine where to send the playhead of the mian.swf. So on a frame in the external SWF, I have this code:

Code:
MovieClip(parent).addEventListener(Event.ENTER_FRA ME, fl_EnterFrameHandler); function fl_EnterFrameHandler(event:Event):void { dispatchEvent(new Event("myVar_value", true)); }

[code]......

View 13 Replies

ActionScript 2.0 :: Adding Randomly Loaded Variables Together And More?

Feb 1, 2004

I'm struggling with a project. I'll try and describe it. 10 mc are loaded randomly with one of two ext.swf's. Each time you click/drag on one, 1 of 6 questions are randomly loaded from an array into a text box on the main timeline. I need to count and add up how many of each of the 2 ext.swf's have loaded and whether they have an x pos < or > 300. My first problem is: The question shows up in the text box when the mc is clicked/dragged but when I trace it, the question that shows in the output doesn't match the one that's loaded into the text box?The second problem is a big one. I need to be steered in the right direction as to keep track of what is where on stage. I only have a vague sense of how to go about it, and combining all the bits is too much.

1. I need to trace the question2. I need to say if the question is 'blah' do this3. The 'do this' is pretty complicated. I need to add up the #1 movies that have an x pos of <300 and the #1 movies that have an x pos of >300 and then do the same for the #0 movies. Then I need to compare a users input answer to the correct one!!! The question AS is in the external swf. [AS]stop();

// Questions Array
question = new Array(); {
question[0] = "How many hedgehogs are in the bed?";

[code]....

View 11 Replies

ActionScript 2.0 :: Accessing Variables Inside A Loaded .swf

Oct 18, 2003

Ive loaded an swf-file (using mc.loadMovie("the.swf")) into movieClip (mc)

inside of that swf there are some variables that id like to manipulate

how do i access them.

View 1 Replies







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