Load variables, remembering variables

I am trying to load variables from a text file, and have them
available from then onwards in the movie, globally so to speak.
While I can read the variable values in a loader function
which executes when the text file is loaded, I don't seem to be
able to keep those variables available afterwards.
How do I that? Isn't AS3 wonderful? :(
John

I think you are missing the fact that things don't happen in
a sequence you write the code. The very core of events model is to
allow dealing with things happening asynchronous and at
unpredictable times while proceeding with the code.
In your example I suspect you envision that when Flash hits
the line "function urlLoader_complete(evt:Event) {" it waits until
text is loaded. This is not correct. The fact (and the beauty) of
it is that Flash goes right pass this line to the line
"trace("After: " + sspColourBG);" Naturally, sspColorBG variable is
not defined by that point.
urlLoader_complete is executed ONLY after index.as3.txt is
loaded which happens some time after.
I suggest to time your code to grasp the sequence of events.
In the example below you will observe that trace 2 comes after
trace 4:
trace("1: " + getTimer());
var sspColourBG;
function urlLoader_complete(evt:Event) {
trace("2: " + getTimer());
trace("During: " + urlLoader.data.extColourBG); // returns
correct value
trace("3: " + getTimer());
trace("After: " + sspColourBG); // returns undefined
trace("4: " + getTimer());

Similar Messages

  • Please help me understand making and loading variable classes

    Hi guys ,
    I know that I am stupid but I just can't get this!  AS3 says you need to load variables into a class?  Please please give me a simple example
    my variables look like this... (the whole point of playing around with variables was that if I had to make a change I could access one place and change them...
    but now I realse that I can't access or call them outside the movie clip they are in:(
    please hlep me!
    var ans1="";
    var ans2="";
    var w1="ABN";
    var def1="An ABN (Australian Business Number), is a personal number for your business that makes it easier and quicker to deal with  government and other businesses.";
    var w2="ACN";
    var def2="An ACN is an Australian Company Number, which is a special number that each company gets to identify it.  No two companies can have the same ACN";
    var w3="Action Plan";
    var def3="A business Action Plan will show What needs to be done and When it needs to be done by."
    var w4="Advertising";
    var def4="Advertising is producing information to let people know about your business and try to increase sales."
    var w5="Promotions";
    var def5="Promotions are where your business tries to increase the sales of a particular item through offering a good deal, advertising or a special display.";
    var w6="Benefit";
    var def6="A benefit is something good that you get.  One benefit of doing exercise is getting fit, another benefit is losing weight.";
    var w7="Business Mentor";
    var def7="A business mentor is a trusted guide. Someone who has experience and has been successful in business and can help and advise you.";
    var w8="Business Name";
    var def8="A Business name is the name a business uses to do its work.  It lets customers know who you are.";
    var w9="Business Registration";
    var def9="When you start a business you need to register your ABN, you may need to register your business name.";
    var w10="Cash flow";
    var def10="Cash Flow for a business is having enough cash saved to be able to pay your bills when they are due.";
    var w11="Characteristic";
    var def11="The characteristics of something are describing words about that thing.";
    var w12="Charges";
    var def12="A charge is something you have to pay, an expense.";
    var w13="Company";
    var def13="Is the same as a corporation. A company is a type of business that needs to be registered (either State or Federal) and has special legal status.  A company can put Pty. Ltd after it’s business name.";
    var w14="Competitor";
    var def14="A competitor is another business that is challenging you for customers.";
    var w15="Constitution";
    var def15="A constitution in business is a list of rules and principles that a company has agreed to follow.";
    var w16="Corporations Aboriginal and Torres Strait Islander Act";
    var def16="In the 1960s and 1970s, various reviews advised the Australian Government of the need for legislation to make it easier for Indigenous communities and organisations to form corporations. As a result, the ACA Act was passed, allowing Aboriginal and Torres Strait Islander groups to form corporations for any social or economic purpose.";
    var w17="Corporations Act";
    var def17="The Australian Securities and Investments Commission (ASIC) have laws that apply to corporations and these are found in the Corporations Act.";
    var w18="Cultural knowledge";
    var def18="Cultural knowledge is special information that is held by a particular cultural group, this could include technologies (e.g. special ways of using materials, making and using tools), stories, language and song, cultural rules, taboos, regulations and oral history.";
    var w19="Customer";
    var def19="The customer is someone who is buying something from a business.";
    var w20="Debt";
    var def20="Is something that you have to pay back. If you borrow 20 dollars you have a $20 debt.";
    var w21="Direct competitor";
    var def21="Is selling exactly the same thing as your business and competing for your customers.";
    var w22="Dividend";
    var def22="A dividend is money that is paid to shareholders regularly out of the company’s profits.";
    var w23="(Microsoft) Excel";
    var def23="Microsoft Excel is a computer program that lets you keep lists of numbers and also add up totals and do other sums to those numbers.";
    var w24="Fees";
    var def24="A fee is something that you have to pay, an expense.";
    var w25="Financial Management";
    var def25="Financial Management is the planning, organising, checking  and controlling of the income, expenses and Tax for a business.";
    var w26="Franchise";
    var def26="A franchise is a type of business you can buy. When you buy a franchise you set up the same type of business that has been successful somewhere else.";
    var w27="General ledger";
    var def27="A general ledger for a business is where all of the income and expenses for that business are kept in a document.";
    var w28="Goal";
    var def28="A goal is a target that you set yourself or your business.  Something that you want to achieve.";
    var w29="Growth opportunity";
    var def29="A growth opportunity is a chance for a business to get bigger.";
    var w30="GST";
    var def30="The Goods and Services Tax is paid when you buy things. Some items like food and medicine do not have the Goods and Services tax charged to them.";
    var w31="ICN";
    var def31="Indigenous Corporations Number is a special number given each indigenous corporation to identify it. No two indigenous corporations can have the same ICN.";
    var w32="Incorporate";
    var def32="Incorporate is what people do when they create a company or corporation.";
    var w33="Indirect competitor";
    var def33="An indirect competitor is selling a similar product or service to your business.  E.g. If you had a pizza shop, a fried chicken shop is an indirect competitor because it sells food and your customers might want to eat chicken instead of pizza.";
    var w34="Labour";
    var def34="Labour is all the work done by people (including you) in your business.";
    var w35="Legal name";
    var def35="Your Legal Name is the name that is on your Birth Certificate.";
    var w36="Legal protection";
    var def36="Legal protection means you are protected under the law from certain things happening.";
    var w37="Legal structure (business)";
    var def37="Legal structure is the type of business, sole trader, company, partnership.";
    var w38="Liability";
    var def38="A liability is something you are responsible for.";
    var w39="Licence";
    var def39="A license is proof that you have permission to do something.  For example, if you have a driving license you can drive a car.";
    var w40="Lodge";
    var def40="To lodge a form means to send it to where it has to go.";
    var w41="Manufacturing";
    var def41="A manufacturing business makes things.";
    var w42="Marketing budget";
    var def42="A marketing budget is the amount of money you have set aside for advertising and promotion for your business.";
    var w43="Minor criminal convictions";
    var def43="A minor criminal conviction is something small you have been in trouble over with the police.  Shop lifting is an example of a minor criminal conviction. ";
    var w44="MYOB";
    var def44="MYOB is financial management software for business.";
    var w45="Networks";
    var def45="A network for business is all of your contacts, customers and the people you know through doing business. ";
    var w46="Obligations";
    var def46="Obligations are things you are responsible for.";
    var w47="One off";
    var def47="A “one off” cost is something that only needs to be paid for once.";
    var w48="Operating budget";
    var def48="The Operating Budget is a record of the income and expenses of a business.";
    var w49="Overheads";
    var def49="Overheads are the expenses or costs in running your business, the things you have to pay for.";
    var w50="Partnership";
    var def50="A partnership is where two or more people own and run a business.";
    var w51="Permission";
    var def51="Permission is where you ask if you can do something.  If you ask and the person, group or council and they say yes, you have permission.";
    var w52="Permit";
    var def52="A permit is a special license or permission to do something";
    var w53="Personal assets";
    var def53="Personal assets are things that you own, like your car, house and furniture.";
    var w54="Personal protection";
    var def54="Being part of a company offers the shareholders some personal protection from legal and debt liabilities. This means that they have less responsibility than a Sole trader.";
    var w55="Photo identification";
    var def55="Photo Identification is a document that shows who you are and has your photo on it, like a Driver’s License, 18+ card or a passport.";
    var w56="Postal address";
    var def56="Your postal address is the address where you get your mail sent.  It might be different to the address where you live.";
    var w57="Pricing structure";
    var def57="Pricing structure is where prices for something can change depending on how much the customer orders.  The bigger the order the cheaper the price becomes.";
    var w58="Private";
    var def58="Private means not part of government.";
    var w59="Profitable";
    var def59="Profitable means that there is money left over after a business pays for all of its expenses out of the money it has made.";
    var w60="Promote";
    var def60="When you promote something you try to advertise or increase the amount of people who know about it.";
    var w61="Public liability insurance";
    var def61="Public Liability Insurance gives legal protection to the business owner against getting sued by a member of the public for things like injury or property damage. ";
    var w62="Quickbooks";
    var def62="Quickbooks is financial management software for business. ";
    var w63="Registered";
    var def63="Registered means that you have recorded your information on an official list.  You register your car to be able to drive it on the road.";
    var w64="Regulations";
    var def64="Regulations are rules or laws that control what you can and can’t do.";
    var w65="Retail";
    var def65="Retail is where things get sold in small amounts to customers.  Retail usually happens in a shop and the prices are higher.";
    var w66="Service";
    var def66="A Service business provides a service, like lawn mowing or accounting services.";
    var w67="Shareholders";
    var def67="Shareholders are people that own part of a company.";
    var w68="Sole trader";
    var def68="A sole trader is where one person owns and runs a business.";
    var w69="Start up budget";
    var def69="A Start Up Budget is the first Budget that gets done for a starting business and includes all of the costs involved in setting up the business.";
    var w70="strategy";
    var def70="A strategy in business is a plan of attack, or a plan of how to get something done.";
    var w71="system";
    var def71="A system is business is a set of detailed plans and rules for how to do something in your business.";
    var w72="Vision";
    var def72="Vision in business is being able to imagine and see something in the future.  To set up a new business you need to be able to see something new that wasn’t there before.";
    var w73="Wholesale";
    var def73="Wholesale is where things get sold in large amounts, usually for a cheaper price. The Wholesale price. A wholesaler is usually a big shed where goods are stored. Wholesale is not usually available to just anyone.";

    no, that's not a reason you would use a class file.
    anyway, your document class variables are defined on the main timeline so to reference them from any timeline you can use:
    MovieClip(root).w36;  // for example  (but it's really undesirable to have coding in more than one timeline)

  • How to load variables from a .txt file

    Hi.
    I usually make a flash aplication in colaboration with a php
    programmer. But i want to test my swfs without having to wait for
    him. So i want to do that through a text file. I know that flash
    can load variables from text files. The problem is i don't know how
    to format the text file ( example.txt).
    Thank you

    Here's a couple of ideas.
    First you probably want to change what you have...and put
    your 'if (pVar==1' etc inside a separate function and call it from
    the onLoad handler after you have assigned the value to pVar...
    because the onLoad will run at some unknown point in time after
    loading has finished (actually in the test environment this might
    work... but that wouldn't be the same as what happens in a
    production setting).
    To create test files for loadvars... simply create a new as2
    file and put this code on the first frame and test movie:

  • Loading Variables in a Class Function

    I am having problems loading variables from an external text
    file inside of a class function. The text file has been created
    properly, and the code that I use in the class is as follows:
    _root.createEmptyMovieClip("texRules", -100);
    loadVariables("texRules.txt", _root.texRules);
    m_Rules = _root.texRules.rules;
    I create an empty movie clip on the root frame named
    texRules, load the variables into that movie clip with the next
    line and then set my member string value equal to the text file
    variable named rules. When I run the program, I get an undefined
    for my m_Rules.
    Here is my texRules.txt:
    rules=THESE ARE THE TEXAS HOLD'EM RULES.
    Any ideas as to what I am doing incorrectly?

    I've opted to use the LoadVars instead of creating an empty
    movie clip and loading the variables there. Here is my new code.
    public function setRules():Void
    var rulesLoader:LoadVars = new LoadVars();
    rulesLoader.onLoad = function (success:Boolean):Void
    if (success)
    trace(rulesLoader.rules);
    this.m_Rules = rulesLoader.rules;
    else
    trace( "Unable to load external file.");
    rulesLoader.load("texRules.txt");
    Here is where I define my properties of my class:
    class TexHoldem extends Game
    //Class member properties
    //Private Properties
    private var m_Rules:String;
    private var m_Target:MovieClip;
    Here is my constructor:
    public function TexHoldem(target)
    this.m_Target = target;
    super("Texas No Limit Hold'Em", 0, 1);
    setRules();
    The setRules function works fine, the only problem now is
    that I can't save the variables once the onLoad function goes out
    of scope. I've thought of modifying it so that it returns a type,
    but that seems difficult. The two easiest solutions I see is to
    create an empty text field that holds the string or find a way to
    get the rulesLoader.rules outside of the onLoad scope. Any
    suggestions now? Sorry to change the problem on you.

  • Problem loading variables and controls in Workshop 8.1 (Beta) Palettes

    Hi All,
    I am getting problem in loading variables and control in the Workshop Data and
    Control Palette at times when I open the application. The Workshop interface shows
    the variable at times and does not show up at all on another instance. Let me
    know if anybody else has faced a similar problem or not

    Akshay,
    Please post this question in the Workshop 8.1 Beta Newsgroup.
    weblogic.developer.interest.81beta.workshop
    Thanks
    Raj Alagumalai
    WebLogic Workshop Support
    "Akshay Aggarwal" <[email protected]> wrote in message
    news:3e9107da$[email protected]..
    >
    Hi All,
    I am getting problem in loading variables and control in the Workshop Dataand
    Control Palette at times when I open the application. The Workshopinterface shows
    the variable at times and does not show up at all on another instance. Letme
    know if anybody else has faced a similar problem or not

  • Load variables externally?

    I am fairly new to flash.
    Can anybody give me any advice on how to load variables from
    an external file on my website that I can edit with a text editor.
    I am making a flash intro to a website that has a pull-down panel
    that displays information on new content on the website. It has two
    variables in the main actionscript 3 code:
    var gotoUrl:URLRequest = new URLRequest("
    http://www.website.tld/newcontenturl")
    var whatsnewText:String = "There is something new on this
    website!"
    The first one defines the url that a Go To button will link
    to to allow the user to visit new content directly.
    The second one defines the message displayed on the panel.
    I am looking for a way to load these from a file I can edit
    with a text editor like Notepad++ so I don't have to open flash to
    update the content.
    Can anyone give me any advice on how to do this?

    I changed something related to what that variable is used
    for.
    I replaced whatever with
    "Text". This is used in an action that changes a dynamic
    text field to say what is in the variable. So it would make a text
    field say
    Text. This part does work because before I tried your code I
    had just set the variable in the actionscript with the var action.
    instead of whatever I used
    "Text"

  • Loading Variables from ASP into Flash

    I can find plenty of tutorials detailing how to load
    variables from a defined asp page into Flash, but here's my
    dilemma...
    I have an asp page that is reading a URL with a unique
    identifier in it (www.sampleURL.com?id=123456), and then turns the
    id number from the URL into a variable. On the same page then, sits
    my swf where I need to use LoadVars to pull in that ASP variable
    via Actionscript. If I don't have a static asp page to pull the
    variables in from and I want to pass the variable within the same
    asp page the swf is located on, how do I do it? Many thanks in
    advance...

    "bonzomn65" <[email protected]> wrote in
    message
    news:ej0630$pjh$[email protected]..
    >I can find plenty of tutorials detailing how to load
    variables from a
    >defined
    > asp page into Flash, but here's my dilemma...
    >
    > I have an asp page that is reading a URL with a unique
    identifier in it
    > (www.sampleURL.com?id=123456), and then turns the id
    number from the URL
    > into a
    > variable. On the same page then, sits my swf where I
    need to use LoadVars
    > to
    > pull in that ASP variable via Actionscript. If I don't
    have a static asp
    > page
    > to pull the variables in from and I want to pass the
    variable within the
    > same
    > asp page the swf is located on, how do I do it? Many
    thanks in advance...
    >
    You don't need LoadVars for this at all. You can just pass
    the variable to
    your Flash movie by specifying a query string when you are
    calling the
    movie.
    If you are using the straight object, embed method then it
    would look
    something like this:
    <param name="movie" value="movie.swf?id=11111">
    <embed src="movie.swf?id=11111" ... >
    If you are using the ActiveContent JavaScript for your movie
    then you just
    leave off the .swf... so
    "name", "movie?id=11111"
    Then, in flash you can access the value of id from the _root,
    like
    var idInFlash:Number = _root.id;
    Of course in the above example you would replace 11111 with
    the proper
    syntax for printing a variable's value in ASP.

  • Movie refuses to load variables from text file

    Hi,
    I'm sure you can solve my newbie problem in less than 1
    minute...
    I'm pulling my hair out on a template I bought 2 days ago
    from templatemonster.com
    I am using Flash 8 Pro.
    All I want to do is change an existing textfield that is
    Static to Dynamic and load variables from a text file.
    The Action Script I use to do so comes directly from
    Macromedia documentation (see attached)
    It works fine when I create a brand new movie, but doesn't do
    anything when inserted into the template.
    It doesn't even complain about not finding the text file if I
    rename or delete it!
    Here are the FLA and text file:
    Edit : Link to source file removed
    The textfield I would like to change is in the txt2 symbol.
    Here is how I proceed:
    When I open HEADER.FLA, Flash tells me I'm missing a font,
    ok, so I click on Use Default, I'll deal with this later.
    I open up the Movie Explorer, go to Layer 30, go to Frame 75
    and click once on txt2
    I name the instance "myMovie_mc" and save (converts from
    Flash MX to Flash 8)
    I double-click on the Movie Clip, select the word
    "Automobile" on the Stage, change from Static to Dynamic and call
    that instance "myText_txt"
    Still in the Movie Clip, I create a new layer I call
    "actions", and in Frame 1 I copy the attached Action Script:
    This script works when I create a new flash file, but it does
    absolutely nothing in this template.
    I know I'm doing something wrong, but I wonder what?
    Many thanks to any helping soul!
    Ferris.

    try this:
    // Load text as variable and assign it to the
    // dynamic text field
    var features_lv:LoadVars = new LoadVars();
    features_lv.onLoad = onText();
    features_lv.load("safetyFeatures.txt");
    function onText(success:Boolean) {
    if (success) {
    myText_txt.text = features_lv.safetyfeatures;
    } else {
    myText_txt.text = "unable to load text file.";
    or this
    // Load text as variable and assign it to the
    // dynamic text field
    var features_lv:LoadVars = new LoadVars();
    features_lv.onLoad = function(success) {
    if (success) {
    myText_txt.text = features_lv.safetyfeatures;
    } else {
    myText_txt.text = "unable to load text file.";
    features_lv.load("safetyFeatures.txt");

  • Assigning loaded variables using loadvard

    hi
    i am using loadvars to load url encoded data from a php file.
    when i trace the output it shows that the variables have been
    retrived successfully.
    now i need to use the values by assingning then to a
    variable. i cant seem to get this going
    i am using flash 8 with as2.
    myVars.onLoad = function (success) {
    if (success) {
    trace (" variables loaded ");
    ad1id.text = myVars.ad1id;
    ad1src.text = myVars.ad1src;
    clipid.text = myVars.clipid;
    clipsrc.text = myVars.clipsrc;
    ad2id.text = myVars.ad2id;
    ad2src.text = myVars.ad2src;
    } else {
    trace (" Error loading variables ");
    is the above method used for assigning the variables correct.
    ram

    The method look fine.
    Inside the success if block, you need to trace the data:
    trace("myVars:" + myVars);
    trace("myVars.ad1id:" myVars.ad1id);
    Also send the same inputs to the PHP script via an HTML form
    or on the address line and see what is returned.

  • Please help with Load Variables / ASP

    Hello,
    I am using Load Variables to retreive a variable from an ASP
    page, (which uses a response.write) to output the variable
    getfile.onRelease = function()
    myData = new LoadVars();
    myData.onLoad = function(success){
    if(success) {
    getfile_txt.text = this.strString;
    } else {
    getfile_txt.text = "error";
    myData.load("sendFile.asp");
    stop();
    the problem is that the output says "undefined", but when I
    access the .asp page through my web browser I get the expected
    result of the variable which is "Test1.Doc"
    if any1 can help with this, i would be massivley thankful,
    thanks.

    p.s strString is the variable that I am trying to pass from
    the ASP page.

  • Can I Send&Load Variables at the same time using php?

    Hi
    I have a php file that is using $_GET method to get the "id"
    of an item and then a query will search the database and return the
    results back. I am using the following code but there is something
    wrong. Can anyone help me with this?
    myVar = new LoadVars();
    myVar.id = "1";
    myVar.SendAndLoad("
    http://localhost/sports/latest_news.php",myVar,"GET");
    //<?php $out = "";
    // $out .= "idn" . $i . "&" ;
    // $out .= "titlen" . $row['sports_news_title'];
    // echo $out;
    //?>
    myVar.idn
    myVar.titlen
    myVar.onLoad = function (success)
    if (success)
    for( var key in this )
    //content is the variable name for the text object where the
    output text will be displayed
    content = this[key];
    else
    trace (" Error loading variables ");

    thanks for the fast response.
    Its working but i want to display more than one results and I
    am using:
    myVar.onLoad = function(success)
    if (success)
    for( var prop in this )
    trace (prop + ". " + this[prop]);
    //trace(this.idn);
    //trace(this.titlen);
    else
    trace(" Error loading variables ");
    when i run the above code i get:
    apos;s World Cup campaignidn. 7
    apos;s conversionidn. 2
    titlen. Bath still sitting pretty
    idn. 1
    onLoad. [type Function]
    id. 1
    how can i choose which details to display?

  • Load variables from XML into Flash

    I was wondering how to load variables from an XML document to
    a Flash file? I am familiar with the code to do it for a text file,
    but was wondering how to do it for XML.
    Many thanks in advance!
    JJ

    Thanks for the recommendation on the site. What I am trying
    to do is load varaibles from an XML file into text boxes in my
    flash movie.
    Here is my loading:
    var my_xml = new XML();
    my_xml.ignoreWhite = true;
    my_xml.onLoad = function(success){
    if (success) {
    gotoAndStop("slide01");
    my_xml.load("narration.xml");
    this is what I have on my frame with the text boxes (the text
    boxes are also have the variable name in the variable area)
    var narration = my_xml.picture01;
    var my_title = my_xml.my_title;
    var my_date = my_xml.my_date;
    should I do my_date.text = my_xml.my_date; instead?
    my xml doc looks like this
    <?xml version="1.0" encoding="iso-8859-1"?>
    <picture01>This is the text for picture
    01</picture01>
    <picture02>This is the text for picture
    02</picture02>
    <my_title>Las Vegas</my_title>
    <my_date>October</my_date>
    Any help on this would be GREATLY appreciated!
    Text
    my_date.text = my_xml.my_date;

  • Load Variables

    how i can load variables from a text file on JSP page?

    how i can load variables from a text file on JSP page?Give it up. JSP is transformed into Java and, in Java, you can't add variables at run time. And a good thing too, it's an inherently risky thing to do (suppose a typo in your text file overrode an important program variable).
    So we load this kind of configuration data into a Map structure, usually a Properties object. Then you can safely access stuff by name with getString() etc.. It's not noticably harder than using a variable anyway.
    JSP isn't PHP or ASP, you need to change your thinking somewhat.

  • Accesing externally loaded variables

    i would greatly appreciate a pointer or two as i am having a
    painful transition to AS2.0
    an 8k zip test is at: www.cyan-animatica.com/v2/exttest.zip
    //(wasn`t there an option back in macromedia days to attach a
    file?)
    i am having a poblem accesing externally loaded variables :
    A.--------------------------------------------------------------------
    the external .txt has folowing content:
    &a1_0=hello&a1_1=bye&a1_2=whatever
    B.--------------------------------------------------------------------
    loaded on the first frame thus:
    var thumbs:LoadVars = new LoadVars();
    thumbs.onLoad = function(success:Boolean):Void {
    if (success) {
    trace("LoadVars loaded successfully: "+this.loaded);
    } else {
    trace("Error");
    thumbs.load("my_externals.txt");
    C.--------------------------------------------------------------------
    if want to access one of 3 loaded variable hardcoding, this
    works just fine:
    trace(_root.thumbs.a1_1) //bye
    BUT i need to do this based on the mc/buton name that calls
    it:
    on (press) {
    var kk:String = _name;
    trace(_root.thumbs.kk);
    i get UNDEFINED...obviously i am mixing datatypes if not
    worse
    pc win 2000
    flash prof for flash8 player[

    thanks for a prompt reply, blemmo.
    you write:<<to ADD vars to the LoadVars object, it has
    to be referenced correctly
    what i want to do is READ vars from LoadVars object and
    referencing is exactly what is killing me
    sorry bout the lack of clarity. the zip would help
    (www.cyan-animatica.com/v2/exttest.zip)
    i am loading 3 variables into an object var thumbs:LoadVars
    from one external .txt file:
    a1_0=hello
    a1_1=bye
    a1_2=whatever
    i want to see the contens of let us say the second variable
    trace(_root.thumbs.a1_1);
    produces bye , perfectly - this is exactly what i want, but i
    want it based on a constructed reference
    so, i have button in an mc named "a1_1", the button script
    is:
    on (press) {
    var kk:String = _name;
    trace(kk); // produces a1_1
    trace(_root.thumbs.kk); //this should be same as
    _root.thumbs.a1_1 and produce the same result, but does not
    i suspect that the problem is that kk is declared as string
    datatype, but no matter what i do i cannot get a result
    thanks for your help

  • Load Variables - Flash 8

    Need help with Loading Variables. My old Flash MX
    actionscript does not work on Flash 8... anybody know why?
    HERE IS WHAT DID WORK ON FLASH MX (loads data from text file,
    flashdata.txt):
    loadVarsText = new loadVars();
    loadVarsText.load("flashdata.txt");
    // assign a function which fires when the data is loaded:
    loadVarsText.onLoad = function(success) {
    if (success) {
    // Now that we know the data is loaded,
    // set the text content of the Text Field
    // with the instance name "scroller" equal to the
    // contents of the variable
    agent1.text = this.agent1;
    agent2.text = this.agent2;
    agent3.text = this.agent3;
    agentemail1.text = this.agentemail1;
    agentemail2.text = this.agentemail2;
    agentemail3.text = this.agentemail3;
    phone.text = this.phone;
    } else {
    trace("not loaded");

    I've no idea what problem you are facing,
    may be you can contact Adobe for Flash support
    http://www.adobe.com/support/programs/flash/?tab:contact=1

Maybe you are looking for

  • Creation of production order report

    Dear, Gurus !!!!! I am working on production order report. Could you give me some idea how to create a production order ,stock overview report and    work center reports. How I see it . Regards, Nitin

  • Bit Rate Conversion

    Okay so at the moment all my songs are at 256 kbps. They all sounds great never had any problems with that but i compressed them down to much smaller sizes even 96kbps and didn't notice a difference through headphones, my speakers on the iMac or my i

  • Help Urgent Toshiba 5005-S504

    I have a Toshiba 5005-S504 and tried updating the bios but  now be4 I tried updating it it turned off quite often I thought it might be the bios too and well I never updated but now when I try turning it on it starts loading windows normally and inte

  • Wrt54gs & network 233.x.x.x

    I have wrt54gs v7, firmware 7.50.5 First question: I need add, to the static route, network 233.15.17.1. But if i enter number 233 to the "Destination LAN IP" filed, have message "IP value out of rage 0...223" How add to the static route network more

  • I downloaded iOS 7 but it won't verify

    I downloaded it a while ago, then did not use my iPad. Now it won't verify because it says I am no longer connected to the Internet when obviously I am writing this. How do I fix this?