Extraction of several classes of a SWF using contentLoaderInfo.applicationDomain.getDefinition

I build a Flash 10 channel mixer/remixer.  Users can select a 'song' to load from an xml based on the drop-down list at the top of the application area.  In the document class, there is a function that takes the item selected from the drop-down list box and load in an external swf file, which is used just like a library for the 10 sounds of a song in particular.   I then extracted from each of these sounds by their class name ("Track 1", "Track 2", "Track3", etc.) and send them to their respective objects of 'MixerChannel '.  As you can see, the following code in the "initHandler' block is quite long and redundant.  Is there any other way/shortcuts that I can use to reduce the code a bit?

initHandler(evt:Event):void private function

{

var sndClass: Class = Class (this.loaderInfo.applicationDomain.getDefinition("Track1"));

newSound = new sndClass();

Mixer1.TRACK_1.setTracks (newSound);

var sndClass: Class = Class (this.loaderInfo.applicationDomain.getDefinition("Track2"));

newSound = new sndClass();

Mixer1.TRACK_2.setTracks (newSound);

var sndClass: Class = Class (this.loaderInfo.applicationDomain.getDefinition("Track3"));

newSound = new sndClass();

Mixer1.TRACK_3.setTracks (newSound);

etc...

}

In addition, this part seems a little strange to me because I still redeclarant 'sndClass ':

var sndClass: Class = Class (...)

I did it by accident, but it does not work.  In fact, if I change almost anything, it does not!

Any help or advice on this would be greatly appreciated!

Thank you

Matt

Oops, that was a mistake.  use:

Define maxtracks, use:

private void initHandler(evt:Event):void {}
for (var i: uint = 1; i<>
setTracksF ("Track" + i.toString (), i);
}
}

private void setTracksF (s:String, i: uint) {}
var sndClass: Class = Class (this.loaderInfo.applicationDomain.getDefinition ();
newSound = new sndClass();
Mixer1 ["TRACK_" + i.ToString ()] .setTracks (newSound);
}

Tags: Adobe Animate

Similar Questions

  • .Swf using external Audio connection

    Because flash loop external mps file correctly, there is always a pause in the loop. The work around is to load the AIFF or WAV file in the .fla and let the Flash to compress the audio file, then the loop works without a break. The problem is that when I have many loops of music, that it takes a long time to publish and test, if in AS 2 I would publish .swfs compressed the raw audio file, which gave the audio file, a link. Then I would load the .swf in the main .swf and access the binding file responsible for .swfs. The code looked like this:

    _root.createEmptyMovieClip ("soundsMC", _root.soundsMC.getNextHighestDepth ());
    instructionsContainer = _root.soundsMC.createEmptyMovieClip ("instructionsContainer", _root.soundsMC.getNextHighestDepth ());
    instructions = new Sound (instructionsContainer);
    instructions.attachSound ('theme instructions');

    It worked perfectly. But this method does not work in AS3.

    That's what I tried AS3:

    by moving just code I got it to work. I changed this line:
    var FishHoleOldMusicMCClass: Class = libMedia.loaderInfo.applicationDomain.getDefinition ("FishHoleOldMusicMC") in the classroom;

    To do this:
    var FishHoleOldMusicMCClass: Class = loader.contentLoaderInfo.applicationDomain.getDefinition ("FishHoleOldMusicMC") in the classroom;

    This is the code:

    public function initView (): void {}
    loader = new Loader ();
    targetStage.addChild (loader);
    loader.contentLoaderInfo.addEventListener (Event.INIT, loarderLoaded);
    Loader.Load (new URLRequest("sound/fishhole_old.swf"));
    }
    //
    private function loarderLoaded (event: Event): void {}
    trace ("loarderLoaded");
    loader.contentLoaderInfo.removeEventListener (Event.INIT, loarderLoaded);
    var FishHoleOldMusicMCClass: Class = loader.contentLoaderInfo.applicationDomain.getDefinition ("FishHoleOldMusicMC") in the classroom;
    music of var = new FishHoleOldMusicMCClass();
    Music.Play (0, 1000);
    }

  • How to create several classes of cascade?

    Goal: Create the button to start and stop the service.

    Situation: One button works.

    However, whenever I click on another button, the button does not work.

    Question: how to create several classes of cascade?

    or something wrong in my code?

    Mini code:

    Calls a CPP QML.

    ApplicationUI::ApplicationUI (bb::cascades:Application * app): QObject (app)

    {
    QmlDocument * qml = QmlDocument::create("asset:///main.qml").parent(this);

    CameraWrapper * wrapper = new CameraWrapper();

    QML-> setContextProperty ('wrapper', wrapper);

    AbstractPane * root = qml->() createRootObject;
    App-> setScene (root);
    }

    And then, QML calls another RPC.

    import bb.cascades 1.0

    {Page}
    {Of container
    layout: {DockLayout}
    }
    Button {}
    text: qsTr ("Start")
    onClicked: {}
    wrapper.startRec ();
    }
    }
    Button {}
    text: qsTr ("Stop")
    onClicked: {}
    wrapper.stopRec ();
    }
    }
    }
    }

    The main CPP:

    #include "cam.hpp".

    using namespace bb::cascades;

    {CameraWrapper::CameraWrapper()}

    int CameraWrapper::startRec() {}

    This button works.

    }

    int CameraWrapper::stopRec() {}

    This button does not work.

    }

    The main.hpp

    Class CameraWrapper: public QObject
    {
    Q_OBJECT
    public:
    CameraWrapper();
    Virtual ~ CameraWrapper() {}

    Q_INVOKABLE
    int startRec();
    int stopRec();
    };

    Thank you for your attention,

    Finally, we use the thread to solve the problem.

    Solution:

    loopWrapper (void * test) {void *}
    CameraWrapper * a = (CameraWrapper *) test;
    a-> startRec();
    return null;
    }

    setFlagWrapper (void * test) {void *}
    CameraWrapper * b = (CameraWrapper *) test;
    b-> setFlagFalse)
    return null;
    }

    void * CameraWrapper::setFlagFalse (void * arg) {}
    exit_application = false;
    fprintf (stderr, "Flag changed to false\n");
    return arg;
    }

    void CameraWrapper::runLoop() {}
    pthread_create (& thread_a, NULL, & loopWrapper, (void *) this);
    }

    void CameraWrapper::runSetFlag() {}
    pthread_create (& thread_b, NULL, & setFlagWrapper, (void *) this);

  • Trouble woring with several classes.

    Hello.

    Do you know where I can find out who is the straight dope on the use of the classes?

    I'm having a few problems at the moment with several classes - but I think that the main problems is that I don't really know how to work with multiple classes.

    Right now I have 4 classes:

    ProjectOne

    ProjectOneText

    ProjectOneVideos

    StageElements

    I have all this in the same file called "asFiles". I can get a single class (ProjectOneText) to load via the ProjectOne class. But I can't get 2 classes to load in the ProjectOne class.

    It is another question, I tried to sort all day.

    I probably got it all wrong... but that's why I need help.

    I appreciate any help you can give me!

    Try to comment out this line and see the results

  • DV7 - 7333cl: how to extract usable data from a bad drive using 22 pins adapter usb to SATA on the new HD

    Greetings HP Forum,

    Recently, I replaced a bad hard drive on my laptop. I need now step by step procedure to extract usable data from the wrong drive using 22 pins adapter usb to SATA on the new HD.

    NOTE: I can't not all data that especially if some of the software downloaded on the replaced disk can be altered. Should I first download Internet Antivirus to protect my new hard drive? I'm not an expert, or even close to this when you work on the back of the laptop, so I'll have to step by step how to download and to partition the data recoverable and software, etc..

    Thanks in advance for your help... I greatly appreciate it!

    See you soon!

    Wes

    It is not complex. Attach the drive to the adapter and connect it to any other computer with good antivirus and antispyware installed. I use Malwarebytes and Avast. When you connect the adapter with the drive connected to the usb port, the drive will appear and it will be assigned a letter maybe E:\ or F:\ or something else. Immediately, he analyzes with the antivirus and anti-spyware. Quarantine or delete any virus or malware it finds. Then, it's just a matter of navigate the disk and copy and paste the contents of the host computer in a directory for this purpose. Obviously, you can copy from documents word, photos, music files, but you cannot copy the applications like Microsoft Word, iTunes. Photoshop.  You may need to take ownership of the files on the old hard drive, but Windows will guide you through this. Don't know what else I can answer.

  • How to ETL extract data from database Oracle 11.1 using Cognos Data Manager 10.1

    Hello

    I need to run the IBM Cognos Data Manager 10.1 version ETL tool for extracting data from the Oracle11.1 database.

    My understanding is that, from the point of view of database, the best way would to have a stored procedure that will provide a reference cursor in the ETL client tool.

    However, a database procedure the ETL tool running seems not to be possible in this version of the data manager.

    If someone has done this before? What is the best way for this snippet to do?

    Thank you

    Emilija

    Annabelle says:

    My reading of original question: "What is the best way for this snippet to do?"

    Sorry - is NOT helping.

    The BEST way to extract data from a table is to use a SELECT statement.

    You said you want to do.

    So just repeat your original question instead of those that ask you to answer will not move forward us.

  • Apply several Classes

    2014 CC of Dreamweaver, you can choose from the menu set class > apply several Classes. The set class is an option in 2015 of Dreamweaver, but multiple Classes to apply is not. I'm trying to follow the steps of a book for an assignment. In 2014, I'd choose apply several Classes and then in the dialog box I verify the container class, and then click OK. How to do this step even in 2015?

    Sorry, he's on a CC2015

    You can return to an earlier version of this project.

    1. log-in to the creative cloud desktop application.

    2. click on applications > applications.

    Then, go to previous Versions

  • How to convert my raw Filws extracted from my new Nikon d750 camera using Photoshop elements 11?

    How to convert my raw Filws extracted from my new Nikon d750 camera using Photoshop elements 11? How to convert my

    The D750 is not yet supported. It may be a few weeks before Adobe proposes an update to the latest versions of Photoshop/Elements. Perhaps in October/November.

    They generally provide a pre-release version of a few weeks in advance (any day now, I hope), but as far as I KNOW, they do not usually work on Photoshop Elements.

  • How to use several classes of children?

    OK, I'm lost.

    In the image of an example of the expedition with LabVIEW, I can see how the circle example. I want to be able to do is to use more than 1 child in the same way. What I have to reproduce the code for the other child, or can I somehow have more than 1 child use the same wire?

    Use an array where each element of the array is an instance of the child, that you need.

    Call your methods inside a auto-indexe for the loop.

    Ben

  • Extraction of several lines using CONNECT BY

    Hello

    It's the structure of the table:

    CREATE TABLE XX_SHIFT_EXCEPTIONS
    (
    PLANT_SHIFT_EXC_ID     NUMBER(18) NOT NULL,
    START_DATE  DATE NOT NULL ,
    END_DATE              DATE NOT NULL ,
    EXC_START_TIME        NUMBER(18) NOT NULL ,
    EXC_DURATION                   NUMBER(18),      
    EXC_END_TIME           NUMBER(18) NOT NULL);
    
    INSERT INTO XX_SHIFT_EXCEPTIONS
    VALUES
    (1,'27-NOV-2015','30-NOV-2015',1200,480,2000);
    
    INSERT INTO XX_SHIFT_EXCEPTIONS
    VALUES
    (2,'28-NOV-2015','28-NOV-2015',1200,480,2000);
    
    INSERT INTO XX_SHIFT_EXCEPTIONS
    VALUES
    (3,'27-NOV-2015','28-NOV-2015',1200,480,2000);
    

    I want my result to look like this:

    START_DATE END_DATE EXC_START_TIME EXC_END_TIME PLANT_SHIFT_EXC_ID

    1 27 NOVEMBER 2015 27 NOVEMBER 2015 1200 2000

    1 NOVEMBER 28 NOVEMBER 28, 2015 2015 1200 2000

    1 NOVEMBER 29 NOVEMBER 29, 2015 2015 1200 2000

    1 NOVEMBER 30 NOVEMBER 30, 2015 2015 1200 2000

    2 NOVEMBER 28 NOVEMBER 28, 2015 2015 1200 2000

    3 27 NOVEMBER 2015 27 NOVEMBER 2015 1200 2000

    3 NOVEMBER 28, 2015 28 NOVEMBER 2015 1200 2000

    I tried the below:

    SELECT  PLANT_SHIFT_EXC_ID,START_DATE+LEVEL-1 START_DATE,START_DATE+LEVEL-1 END_DATE,EXC_START_TIME,EXC_END_TIME
    from
    (SELECT * FROM XX_SHIFT_EXCEPTIONS
    WHERE TRUNC(END_DATE)!=TRUNC(START_DATE)) SHIFT1
    CONNECT BY LEVEL<=(END_DATE-START_DATE+1)
    UNION ALL
    SELECT PLANT_SHIFT_EXC_ID,START_DATE,END_DATE,EXC_START_TIME,EXC_END_TIME
    FROM XX_SHIFT_EXCEPTIONS WHERE END_DATE=START_DATE
    order by 1,2;
    

    But the result set is not wait for him as for factory shift 1, I get 11 lines instead of 4 rows

    Help, please. Thank you.

    so, something like this:

    WITH XX_SHIFT_EXCEPTIONS (plant_shift_exc_id, start_date, end_date, exc_start_time, exc_duration, exc_end_time)

    AS (SELECT 1, to_date (27 November 2015 "," MON-DD-YYYY ""), to_date (November 30, 2015 "," MON-DD-YYYY'"), 1 200 480, 2000 FROM dual UNION ALL)

    SELECT To_date 2 (November 28, 2015 "," MON-DD-YYYY ""), to_date (November 28, 2015 "," DD-MON-YYYY ' "), 1 200 480, 2000 FROM dual UNION ALL

    SELECT 3, to_date (27 November 2015 "," MON-DD-YYYY ""), to_date (November 28, 2015 "," MON-DD-YYYY'"), 1 200 480, 2000 DOUBLE)

    SELECT PLANT_SHIFT_EXC_ID, START_DATE + LEVEL 1 START_DATE, END_DATE START_DATE + LEVEL 1, EXC_START_TIME, EXC_END_TIME

    OF XX_SHIFT_EXCEPTIONS

    CONNECT BY LEVEL<= (end_date="" -="">

    AND PRIOR plant_shift_exc_id = plant_shift_exc_id

    and prior sys_guid() is not null

    /

    HTH

  • Identify several Classes in particles classifier

    Hey guys!

    So, I do this VI that differentiates a nut and a washer and a screw. I use the classification of particles for the same. The problem lies here. I want the program to respond only to a particular type of object, even when there are several objects in the image. The IMAQ classify VI alone gives me a unique class of an image where objects of all 3 classes!

    Can someone help me find a way around this problem? I enclose an excerpt from my VI below, as well as the VI.

    Yes, sorry, I found the solution. A lot of my embarrassment, it was there before me. All I had to do was the result of matches of the wizard of vision and the search for the string in the table.

  • Synchronization of several diagrams on two databases using goldengate

    I want to assure you that only two installations of goldengate in servers (one for each) is sufficient to synchronize several patterns on both databases. If it is possible, where and how can I store files of track? Are there any other special advice for the steps?

    Hi PrazSam,

    Yes. Only two cases of Oracle GoldenGate, I mean to each server (source

    and target) a single instance of GG is more than enough for replication or

    synchronization of multiple schemas. Trail of files is stored in the hard disk

    drive under the directory dirdat that goes into the OGG_HOME.

    You can use a single process extracts, pump and replicate to configure

    replication of multiple schemas. Else an excerpt dedicated or separate, pump

    and replicat process for each schema. But the path of the file name for each

    process should be different. Many cannot write extraction process in the

    files even trail.

    Thank you

    Veera

    On Fri Sep 4, 2015 11:51, community-admin

  • Open to several Classes of javaFX is impossible

    Hello!
    I want to open several screens of javafx, each of them is a class with an example from the book.
    But im having problems in doing this.

    Only, I can do a project for each screen?

    Here is the screenshot:
    http://ImageShack.us/photo/my-images/526/duvidajavafx.jpg/

    I've tried several things, none has worked so far.

    Here is a summary of what your code is doing:
    1. you create an instance of the Pagina16 class.
    2. you will get back the class Pagina16, which is currently null and scene recording it ss in your main class (which will always be null)
    3. you start JavaFX.
    4. control between the start of the hand method.
    5. you call step primary setScene to assign the ss (which is always set to null).
    6 display. you the scene.

    I'm a little unclear as to what is the point of the Pagina16 class. Also, you try to use the stage of the Pagina16 before it has been initialized (which is zero). Even if you had called code Pagina16 startup to initialize this scene, the fact remains that a scene can be shared between two steps. If you try to do what I think you are, it would work better like this:

    public class Main extends Application {
    
        /**
         * Since we need to create two scenes that contain the same elements, we will need some sort of factory method.
         * For simplicity, I am just using a static method that returns a new scene.
         */
        static Scene createScene() {
            //Create the root node.
            Group root = new Group();
    
            //Create the new scene.
            Scene scene = new Scene(root, 550, 250, Color.LIGHTBLUE);
    
            //Curva Cúbica
            CubicCurve cubiccurve = CubicCurveBuilder.create()
                    .startX(50).startY(75)
                    .controlX1(80).controlY1(-25)
                    .controlX2(110).controlY2(175)
                    .endX(140).endY(75)
                    .strokeType(StrokeType.CENTERED).strokeWidth(1)
                    .stroke(Color.BLACK)
                    .strokeWidth(3)
                    .fill(Color.WHITE)
                    .build();
            root.getChildren().add(cubiccurve);
    
            // Sorvete
            Path path = new Path();
            MoveTo moveTo = new MoveTo();
            moveTo.setX(50);
            moveTo.setY(150);
    
            QuadCurveTo quadCurveTo = new QuadCurveTo();
            quadCurveTo.setX(150);
            quadCurveTo.setY(150);
            quadCurveTo.setControlX(100);
            quadCurveTo.setControlY(50);
    
            LineTo lineTo1 = new LineTo();
            lineTo1.setX(50);
            lineTo1.setY(150);
    
            LineTo lineTo2 = new LineTo();
            lineTo2.setX(100);
            lineTo2.setY(275);
    
            LineTo lineTo3 = new LineTo();
            lineTo3.setX(150);
            lineTo3.setY(150);
            path.getElements().add(moveTo);
            path.getElements().add(quadCurveTo);
            path.getElements().add(lineTo1);
            path.getElements().add(lineTo2);
            path.getElements().add(lineTo3);
            path.setTranslateY(30);
            path.setStrokeWidth(3);
            path.setStroke(Color.CHOCOLATE);
    
            root.getChildren().add(path);
    
            //QuadCurva Create a Smile
    
            //Outer Donut
    
            //Donut Hole
    
            //Make a Donut
    
            //Add Drop Shadow
    
            //move Slightly Down
    
            //Now that we have created the scene, return it.
            return scene;
        }
    
        public static void main(String[] args) {
            //Initialize JavaFX and run the rest of the start up code.
            Application.launch(args);
        }
    
        @Override
        public void start(Stage primaryStage) {
            //Set the primary stage to use a scene created from the factory method.
            primaryStage.setScene(createScene());
    
            //Create a second stage.
            Stage anotherStage = new Stage();
    
            //Set it to use a scene created by the factory as well.
            anotherStage.setScene(createScene());
    
            //Make both stages appear.
            primaryStage.show();
            anotherStage.show();
        }
    
    }
    
  • Generic limits for several classes

    I have a class called shape and 5 subclass called square, Triangle, circle, Rhombus and Rectangle. I want to do a generic class that is bounded. I want to type T to accept a square, Triangle, circle and their respective subtypes. I don't want T to be able to accept a diamond or a Rectangle.

    How do I do that?

    I tried this, but it doesn't seem to work properly.
    public class GenericShapes < T extends square, Triangle, circle >

    Published by: SquareBox on March 25, 2011 10:08

    SquareBox wrote:

    I know semi – you can do that. Is there a real reason why you would need that?

    Suppose you need to process orders. You have called superclass for all products of the company. The company sells computer parts. You want to make a list of all parts of the computer that are sold. The company also makes the cheese. You want to make a list of all the objects of cheese that are sold. You do not want parts of computer in the list of cheese and you don't want cheese in the list of computer parts.

    If this analogy is accurate, then there must be something on these 3 shapes that go together what they have in common that the other 2 do not share. In other words, they are examples of a certain type which are not the other 2. This is precisely the case for another interface - if marker or normal - that identifies this type. This interface may or may not extend to form, depending on whether it is a property of the 'form is', or something completely different. For example, if it is RotationalSymmetry90Degrees, it must extend the form. If it is StuffMyGrandmaLikes, it should not.

    Then share what property these 3 forms that the other 2 are not?

    You are new to the company, and the boss says you need to use these existing classes. You can't change them because it will screw everything up. It will tell you you need to do a generic class that excludes all types of monitors, devices, hard disks, ect... but without cheese. To make it more difficult that you are NOT authorized to create a superclass called ComputerParts. The boss wants to inherit everything from product. Product may be the only supertype in the program.

    I'm not going to dig deep enough into the analogy to understand if you say that you can't create another interface for the forms 3 to implement. If it is in fact what you say, it is an artificial constraint, then I don't know what you're instructor is on everything he's trying to teach you, and what are the other artificial constraints may be present, so I'm out.

    What would you do to fix this? In addition to tell your boss that he is a nut.

    In the real world, tell him he's wrong. In artificial medium such as coursework, this would depend on a lot more details that I don't know and am not interested.

    I tried several approaches. I want to just do something like this but T can range from diamond. I don't know how to write syntax for this. I'm sure it's possible

    Why do you have to be sure that it is possible? Just because you want to be it?

  • Several classes of documents?

    Hey guys,.

    I'm just getting into flash and I would like to know how run you several as3 since the main .fla file files?

    Is it possible to use more than one document class file?

    Thank you

    Chris

    I believe that you can have only one class of document set for a file, but you can import all other file of class/.as you need.

Maybe you are looking for