recovery of the external class variables

I created a class loader that retrieves variables from an external text file. I call the loader class and everything works fine but I can't figure out how to get and use variables in the main class. Can someone help me please?

Call main class:

function createInfoText (): void {}

var loadTxt:LoadTxt = new LoadTxt("text_files/mainTxt.txt");

}

Class LoadTxt:

package app.gui

{

flash.net import. *;

import flash.events. *;

public class LoadTxt

{

private var externalTxt:String;

public var loader: URLLoader = new URLLoader();

public void LoadTxt (external)

{

externalTxt = external;

init();

}

function init (): void {}

loadExternalText();

}

function loadExternalText (): void {}

loader.addEventListener (Event.COMPLETE, handlerComplete);

loader.dataFormat = URLLoaderDataFormat.VARIABLES;

Case of load data

Loader.Load (new URLRequest (externalTxt));

function handlerComplete(evt:Event):void {}

var loader: URLLoader = URLLoader (evt.target);

trace (Loader.Data) //this works OK

}

}

}

}

I know I have to get the data that is held in the var 'loadTxt' but I'm brain-dead!

Thank you

Here are a few things to think about...  The LoadTxt class must have loaded the file until the master file can try to access it.  If the LoadTxt class should be a way to tell the main file, it is ready.  What you could do in your handlerComplete function is hurry up an event for this purpose and have an event listener assigned to the instance of LoadTxt, so that the data can be extracted from it when it's ready.

You can use the custom LoadTxt class event class to pass data in the event that hurry you, if you won't read about the creation/use supported the transmission of parameters.

Tags: Adobe Animate

Similar Questions

  • How to access the static class variable calendar / singleton?

    How can I access a timeline of a static class variable / singleton?

    You can pass any object to display list to your class when instantiating it.  all objects in the display list has a placement property that allows access to the stage and them you can use the correct path/name to your variable.

  • How can I get the external classes to work in AS3? Sample included.

    I'm doing this work, and something basic must be absent.  Its straight out of the Adobe Help file example.

    CS4, Actionscript 3

    Here's what I do:

    1 create a .as file and name it "HelloWorldExample.

    2 put the script below into it and save it.

    3. create a .fla file and save it in the same directory.

    4. in the .fla file, put "HelloWorldExample" in the class of Document properties field

    5 save and run the film.

    I get a white screen.  Nothing.  I tried a few other examples, but I was not able to get ALL of the external .as files to run. It is the simplest.

    Do I need to import them or call them in some way other than step 4?

    I missed something?

    package

    {

    flash.text.engine import. *;

    import flash.display.Sprite;

    SerializableAttribute public class HelloWorldExample extends Sprite

    {

    public void HelloWorldExample()

    {

    var str = "Hello World!" This is Flash Text Engine! « ;

    var format: ElementFormat = new ElementFormat();

    var textElement: TextElement = new TextElement (str, format);

    var textBlock:TextBlock = new TextBlock();

    textBlock.content = textElement;

    var textLine1:TextLine = textBlock.createTextLine (null, 300);

    addChild (textLine1);

    textLine1.x = 30;

    textLine1.y = 30;

    }

    }

    }

    As long as you have your class paths set correctly, it is best to have your .as files in an another loc that your. Fla. What happens if you want to use the same class in different .fla? You will copy in each project file? That kind of defeats, the purpose of the use of classes and then, because if you change it you must change it in various places. Not good. No OOD.

    So: Edit > Preferences > AS3 settings - add paths to the source path, or a path... something like c:\flashclasses\as3

    Inside of your as3 application you assign to your package files. If you use TweenLite need you:

    com

    greensock

    TweenLite classes

    or yours:

    com

    Mydomain

    my classes

    then you would be important as:

    import com.greensock.TweenLite;

    import com.myDomain.myClass;

    Make sense?

  • Failed to load the external class?

    I use the tweener class in this file very well. But when I try to use the sound Manager class, I can't seem to load why? Here is my flash code to follow at the beginning of the class... Any ideas? Thank you... I get type not found...

    import com.richardsongraphics.soundmanager;

    Manager: SoundManager var = new SoundManager();

    =======================================

    package com.richardsongraphics
    {
    import flash.events.Event;
    import flash.events.EventDispatcher;
    import flash.events.IOErrorEvent;
    to import flash.events.ProgressEvent;
    import flash.media.ID3Info;
    import flash.media.Sound;
    import flash.media.SoundChannel;
    import flash.media.SoundLoaderContext;
    import flash.media.SoundTransform;
    import flash.net.URLRequest;
    import flash.system.System;

    Import mx.binding.utils.ChangeWatcher;

    SerializableAttribute public class SoundManager extends EventDispatcher
    {
    / * In this table, we will store generated dynamic properties in the Sound and SoundChannel
    objects so that we can use "remove" to remove objects from memory. Be
    Remember that if you forget to remove and event listener to
    something will not be unloaded from memory. */
    private var dynamicProps:Array = [null, null];

    private var channelWatcher:ChangeWatcher;

    public void SoundManager()
    {
    trace ("Loaded");
    }

    I thjink you import the class with a fake name AS3 is case sensitive and so
    import com.richardsongraphics.soundmanager;

    is not the same as

    import com.richardsongraphics.SoundManager;

    Please check once again if you have used the same line for the import of this class.

  • Installtion of recovery using the external DVD drive

    Hello

    I have a satellite A50 and try to use the recovery disk using a USB DVD drive (internal is damaged), is it possible? and how?

    Thank you

    Hello

    It is possible, but you need an extended drive Toshiba compatible and taken in charge.
    I would recommend asking the service partner for readers supported and ordering of the ASP him. He has information on the supported devices and you'll be sure you get a car 100% taken in charge.

  • Call the TimerEvent class variable

    Hello

    I have a Timer class and I try to call a variable of this class of TimerEvent. But I don't know how to do this. You have an idea?

    function contact(e:MouseEvent):void {}
    var world: URLRequest = new URLRequest ("contact.swf");
    countertime.addEventListener (TimerEvent.TIMER, counter);
    countertime. Start();
    }

    function counter(e:TimerEvent,_ _world:URLRequest_):void { / / red zone did not }
    loadswf. Load (theWorld);
    countertime. Stop();
    }

    How can he get a var of outside a Timer class?

    function contact(e:MouseEvent):void {}

    var world: URLRequest = new URLRequest ("contact.swf");

    var pfEvent:Function = function(oEvent:TimerEvent):void {counter (oEvent, world) ;};}
    countertime.addEventListener (TimerEvent.TIMER, pfEvent);
    countertime. Start();
    }

    function counter(e:TimerEvent,_world:URLRequest):void {/ / red zone didn't work}
    loadswf. Load (World);
    countertime. Stop();
    }

  • Access a MovieClip in the main timeline of an external class

    Hello


    I've been struggling with the same question for a few days now, and I don't know it can be easily solved - I have just found a way that works for my case


    Basically I have a series of clips on the main timeline, the name "S1B1' to 'S5B8' as a result. I would like to add to a table in a separate category called "BeatArray".


    For the moment, I found no referencing the MovieClips from the separate class file that works, and I tried many different methods (including adding MovieClip (root). before each one and various other things).

    It's probably worth noting that the external class has already extends MovieClip.


    Any help is greatly appreciated!


    See you soon

    When you instantiate the outer class passes a reference to the main timeline and assign it within the class and use it in your targeting.

  • Communication with the main movie off external class

    Hello

    Hello, after recognizing that all my problems are as a result of the problem, I just start with AS3, having a litte experience with AS2 and common OOP. So, I try to understand the concept of AS3 on this level.

    My problems are mainly in the defined direction how outwardly objects communicate with the main movie.

    For example:

    (1) can I call a DisplayObject instance out of an external class, if this DisplayObject is defined and added to the display list in the MainMovie?

    2) can MovieClipObjects instance within a table, which works like an instance variable? I think that will cause trouble in the cascade of display list:

    {should be corner braces: class.} MovieClips {i} = new MovieClip();    -> root.class.MovieClips {1} Point separates it levels in the display list, but also object and attribute.

    Thank you

    the debugger does not recognize this error message?

    and if you want to clear the memory occupied by mc when you use:

    var a: Array = [];

    var mc:MovieClip = new MovieClip();

    a [0] = mc;

    use:

    If it was added, remove the mc of the displaylist.  remove all listeners and other references if there is.

    a [0] = null;  or a.shift (), if you do not have null in an array element.  Use a.splice (i, 1), if you used a [i] = mc;

    MC = null;

  • The data stored on the external hard drive recovery

    Hello

    Recently, my PC got corrupted and told me to save my data on an external hard drive before doing a reformat on my PC. In fact, all my data was saved when I update. A few months ago, in may 2014, I backed up my data in the drive C under the section 'My Document ' and also registered in my external hard drive as a backup. Thus, in June, July & the first 2 weeks of August 2014, I updated some data and stored in the 'My documents' file in the C drive. My PC got corrupted last week and told me to do a reformat as a last resort. Before that, I saved all my data (especially my Word & Excel) for my external hard drive to the file 'My Document '. After that the reformatting was made, I downloaded all required applications and try to remove my Excel file, which has the external hard drive, but the data were NOT the updated file, but the file that has been saved 3 months ago!

    So, how can I recover my file up to date which was recorded August 12, 2014, supposedly on my external hard drive, or could it be hidden somewhere in the "C drive"?

    Help, please!

    Thank you!

    Kind regards

    Ros

    Moved from Community Centre of Participation

    Original title: Back up my data on external hard drive

    Hello

    You could try to use Easeus Data Recovery Wizard (free)

    http://www.EASEUS.com/DataRecoveryWizard/free-data-recovery-software.htm

    How to analyze a hard drive reformatted to recover files

    http://www.ehow.com/how_6515288_scan-hard-drive-recover-files.html

  • Can I format my recovery disk if I copied the recovery on an external drive?

    On my Hp computer, I noticed that my recovery was almost full.  So I copied it on an external drive.

    My question is; Can I format my recovery if I copied the recovery on an external drive?

    Hello

    No, you can't.

    And reading this on the recovery partitions:

    It is supposed to have the files it contains, because it contains the files to reinstall the operating system.

    Your recovery Partition was photographed on your hard drive during the production of your computer by the manufacturer for all of these reasons.

    1. If you want to reinstall Windows from in the case of a failure of the system, based on individuals or the keys at startup.

    F10 or Alt + F10 or F11 are a couple of different manufacturers use sequences.

    You will need to ask your manufacturer for proper sequence.

    2. to make the recovery disks on if your drive hard breaks down, so that you can then reinstall the operating system on a new hard drive.

    Also ask them how to make records.

    Your D: Recovery Drive is should not be used for backups, defragmented, etc..

    There are backups on an external hard drive.

    To resolve the problems that have arisen with the recovery D: Partition, you will need to contact the manufacturer of your computer to remove all that has been added to it.

    See you soon.

  • storage system on the external hard drive recovery?

    storage system on the external hard drive recovery?

    When you request support, please provide the name number and produces complete model of the HP computer in question. HP/Compaq made thousands of computer models. Without this information, it can be difficult, even impossible to help you solve your problem.

    The information requested above are at the bottom of your computer or inside the battery compartment. , Please do not include your serial number. Please enter the product/model information consumer HP Online Support page and post it here for our review.

    You do not save the HP system on an external hard drive recovery. You must create your recovery media personal HP for recovery works. HP Recovery can be created using DVD + R discs or a 32 GB USB Flash drive. Please see create recovery discs or record a recovery Image on a Flash USB (Windows 8) drive or create recovery discs or record a recovery Image on a Flash drive (Windows 7) for instructions on creaing your HP recovery media.

    If you have any other questions, feel free to ask.

    Please click the White Star of KUDOS to show your appreciation

  • Recovery of the class factory COM for component with CLSID {3CE74DE4-53D3-4D74-8B83-431B3828BA53} failed due to the following error: 80040154

    When I run pdf reader applications, I get this error:

    Recovery of the class factory COM for component with CLSID {3CE74DE4-53D3-4D74-8B83-431B3828BA53} failed due to the following error: 80040154

    Hello

    1. you remember to make changes to the computer before this problem?

    2 are you able to open files from other Adobe programs?

    Follow these methods.

    Method 1: The problem is that by default, when the PDF program is used as a COM object, then it cannot be activated by the following accounts:

    (a) a Director

    (b) system

    (c) interactive

    How to solve this problem is to change the DCOM settings for the Application'S object.

    Configure DCOM

    a. click Start, type run in the start search field.

    b. type DCOMCNFG , and then press OK. (This will load the "Component Services")

    c. navigate to Component Services, click computers, my computer, DCOM Config application PDF.

    d. right-click and select Properties.

    e. Select the Security tab.

    f. in "Launch and activate permissions" select personalise and press change.

    g. press the Add button to select the "Network Service" account

    f. click on the OK button, and then test your application, it should work fine now.

    Method 2: If this does not help, you can uninstall and reinstall Adobe reader software and check.
    http://Windows.Microsoft.com/en-us/Windows7/uninstall-or-change-a-program

    You can download the latest version of Adobe reader from the following link.
    http://get.Adobe.com/reader/

  • Re: CSS external style; I finished a Web site for the class (html 5 and I forgot to select the external CSS stylesheet; do I have to redo the project in Dreamweaver CS6)

    Hello

    Re: External CSS to model; I finished a Web site for the class (html 5 and I forgot to select the external CSS stylesheet; do I have to redo the project in Dreamweaver CS6)

    In 2015, CC, you can do the following...

    1. turn highlight everything between your

  • created variable on click in edgeActions.js but want to reference in the external js file


    Hi, I created a variable on click in edgeActions.js but want to reference in the external js file. This is where I am so far:

    In my edgeActions.js I have variable st on compositionReady and then use it when I click the icon: questionMarkR1. It works fine... the problem is that I don't know how to reference the variable in my external js file. This first code works of the edgeActions.js:

    Symbol.bindElementAction (compId, NomSymbole, 'document', 'compositionReady', function (sym, e) {})


    sym.setVariable ("questionAsked", false); sets the initial value

    });

    Symbol.bindElementAction (compId, NomSymbole, "${_questionMarkR1} ', 'click', function (sym, e) {})

    var questionAsked = sym.getVariable ("questionAsked");

    Alert (questionAsked);

    If (questionAsked) / / if it is true
    {
    SYM. $("checkButton2") .removeClass ("hidden");
    SYM. $("popUp") .removeClass ("hidden");


    }
    of other fake //if
    {

    SYM. $("pic2a") .removeClass ("hidden");
    SYM. $("pic2b") .removeClass ("hidden");
    SYM. $("pic2c") .removeClass ("hidden");
    SYM. $("pic2d") .removeClass ("hidden");

    SYM. $("closeBox") .removeClass ("hidden");
    }

    });

    This next part does not work because I don't know how to properly reference the variable. That's what I've tried and it doesn't work:

    var questionAsked = sym.getComposition () .getStage () .getVariable ("questionAsked");


    Alert (questionAsked);

    Hello

    Animate edge exposes an API for external scripts, you will need to use in your case:

    For more information about the API to animate edge, see API JavaScript Adobe Edge animate CC

    Use the code below in your external js file:

    var comp = AdobeEdge.getComposition ("EDGE-606063631"); replace 'EDGE-606063631' by your model id, you can find in the .html file

    var point = comp.getStage ();

    var questionAsked = stage.getVariable ("questionAsked");

    Alert (questionAsked);

    HTH,

    Vivekuma

  • When the external program C and Java Class loaded in a schema

    Hi all
    I understand that both an external C program and a Java class are loaded after two of them are called in the PL/SQL environment, once they are published and loaded into shared libraries. Is this correct?

    Best regards
    Val

    An external procedure is never loaded into a schema. Oracle calls the external program.

    A Java class that is part of a Java stored procedure, however, is charged as a PL/SQL procedure is created - at compile time.

    Justin

Maybe you are looking for