How to load and replace random swf in the same charger on stage?

Hi... it's very simple, but for some reason any escapes me: using AS3 how a swf file can load another swf to replace itself in the charger still on the stage, while at the same time calling a function of randomization in the first frame of the main timeline, to randomize the next swf?

At the end of each swf (called "koan_ # .swf"), it is the following old AS2 code... it has been used to choose randomly, and then play a SWF of koan table:

_root.index ++

If (_root.index > _root.koan.length - 1) {}

_root.index = 0;

_root. KOAN.shuffle ();

}

_root.koan_loader_mc.loadMovie (_root. KOAN [_root.index]);

This code on the first frame of the main timeline loads a koan random swf file correctly, but after that the koan plays I'd like to load a new swf random koan.

function shuffle(a:Array):Array {}

var len:Number is. Length-1;

for (var ivar:Number = len; ivar > = 0; ivar-) {}

var p:Number = Math.floor (Math.random () *(ivar+1));

var t = a [ivar];

a [ivar] = a [p];

a [p] = t;

}

return a;

};

var: index: uint = 0;

var koan_loader:Loader = new Loader();

koan var: Array = ['swfs/koans/koan_1.swf","swfs/koans/koan_2.swf', 'swfs/koans/koan_3.swf', 'swfs/koans/koan_4.swf', 'swfs/koans/koan_5.swf', 'swfs/koans/koan_6.swf', 'swfs/koans/koan_7.swf', 'swfs/koans/koan_8.swf', 'swfs/koans/koan_9.swf', 'swfs/koans/koan_10.swf', 'swfs/koans/koan_11.swf', 'swfs/koans/koan_12.swf'];

KOAN = shuffle (koan);

koan_loader. Load (new URLRequest (koan [index]));

MovieClip (this).koan_loader_mc.addChild (koan_loader);

Thank you very much.  I tried several variations of updated AS2 code but am at my wits end.

-Very well, bloody forums join the file for some reason, so here is the code:

Copy and paste this code into a text file and save it as InterfaceEvent.as

package {}

import flash.events.Event;

SerializableAttribute public class InterfaceEvent extends Event {}

public static const = "koanFinished" KOAN_FINISHED:String

public void InterfaceEvent (type: String, bubbles: Boolean = false, cancelable: Boolean = false, int index = - 1, item: Object = null) {}

Super (type, bubbles, cancelable);

This.index = index;

This.Item = item;

}

public var int index = - 1;

public var point: Object = null;

override public function clone (): Event {}

return new InterfaceEvent (this.type, this.bubbles, this.cancelable, this.index, this.item);

}

}

}

Tags: Adobe Animate

Similar Questions

  • Still 2 WT8-B-102 - loading and using a mouse at the same time

    Hello

    I have a Tablet yet 2 WT8-B-102. Anyone know, please, what would happen if I tried to load / use on current electric at the same time that the use of an external mouse?

    I have an adapter that plugs into the micro-usb port and has two connectors USB (life-size). I have attached a USB mouse and one USB key to another and worked well. However, if I plug in a USB mouse and the plug of the charger on the other USB connector (via a USB cable at each end full size) what happens? Would like to fry my tablet, because (in my opinion) I would like to put something in the (electricity) Tablet at the same time as I was taking something (the mouse) via the same micro-USB? The Tablet could not bear, or would I ask it to do too?

    I know this sounds a bit garbled but I did my best to explain what I'm asking, and if someone who can understand what I'm going to talk can help, please, it would be so awesome.

    Thanks for reading.

    Alison

    My blade of ebay 1 megabytes/s usb adapter worked litle, for keyboard and mause but it wont charge the tablet.

  • How to load and you unsubscribe contacts of the group e-mail to the E10?

    I know how to load new contacts and worldwide unsubscribe them but I'm trying to figure out how to unsubscribe them only to the Group an email because we have several brands. Someone knows how to do this in E10? Thank you

    Hi Rebecca

    One way I've seen to do would be to put everyone in a list shared during the download.

    Then, build a small program that has a stage for them to unsubscribe from the campaign. Add the list shared in the program and this will be done.

  • How to get and replace a key on the Satellite A100-522?

    Hey, Toshiba.

    I have a Toshiba Satellite A100-522 model No. PSAA2E-01C01EED and one of my shift keys
    has broken below, so I can't use it (the small plastic bar to balance the key is broken
    If the key "blockages". Can I send it for repair to the warranty, and Ive talked to the
    seller, but I don't have the time to send it for repair (no laptop replacement in the meantime).

    Is it possible to get a new key and replace it myself? I know that some other laptop producers do the same thing,
    rather than use a lot of time on repairs, if they are too simple.

    Concerning

    John Reyes

    [email protected]

    Hello

    Well, it's very easy to replace the keys.
    Please check this thread:
    http://forums.computers.Toshiba-Europe.com/forums/thread.jspa?threadID=20727&MessageID=76283

    But if the key is broken you will need to replace the entire keyboard.
    To remove the keyboard, you have to remove the cover plastic thinking above the F keys.
    Under this coverage, you will find 2 crews secure the keyboard
    Remove the two screws and remove the cable from the flat keyboard which is connected to the motherboard.

  • How to find and replace this text in the url

    I have a NCLOB column with a text with the url between the two as shown below:
    ========================================================================
    This text is intended to testign. This text is intended to testign.
    < a PL/SQL and SQL < U PL/SQL and SQL / < u > < / a >
    Required text is also aimed at testign. This text is intended to testign.
    < a http://forums.oracle.com > < oracle metalink U > < / u > < / a >
    This text is intended to testign. This text is intended to testign. This text is intended to testign. This text is intended to testign. This text is intended to testign. This text is intended to testign. This text is intended to testign. This text is intended to testign.
    ========================================================================
    Requirement:
    ========
    It is necessary to implement find and replace functionality.
    I just need to check if the search text is present in the url or not?
    Suppose that if research of orcale.com, given that research should therefore be successful otherwise search for his part of the url must be unsuccessful.
    Here, I can give you the indicator, as always the url is located between the anchor tags * (< < /A >). *

    Tahnks in advance.
    SELECT REGEXP_SUBSTR('testhttp://forums.oracle.comoracle.comhttp://ora.com', '((.*?oracle\.com.*))') FROM dual
    
  • How to find and replace a URL in the content

    See the following page:

    http://democraticpartyofgeorgia.org/events/index.cfm?fuseaction=week & SM = 9 & SD = 9 & SY = 2007

    He pushes the margins way because some people type in long URLS in their description of the event (see the meeting September 10). I would like to be able to analyze the event description and replace that long url with a hyperlink where the long url is in the attribute href, but which is related is something link 'see link'. Is it possible to do? I can search for the instance of "" http:// ' of course, but can't seem to find a way to tell where the ends of the link... "

    Look at the ActivateURL udf to
    http://www.cflib.org/UDF.cfm/activateurl

    It's really more a question on a very long word of packaging. The URL is not packing, and it's what drives your margin. You need the column to encapsulate your column is a bit more liquid.

    Use the wrap() function CF.

    You can also go the road CSS, but the best solution I found only works on IE.

  • Can't seem to load and listen to music at the same time

    So I got my Droid X for a week now. A great phone. But I'm having a problem. Basically, I want to listen to music while it is connected to a computer via a USB cable to charge. "' Charge mode I guess put the phone in" only "would set the phone to use only the USB cable for power and not mount the sd card to access on the computer. However, this is not the case. I always get a message"your sd card is busy" when I do that. Any ideas? I don't want my phone to die while I'm listening. Battery life seems to be a constant problem win this phone that would be very nice if I could charge it for use.

    Just put the phone in 'PC' for USB Mode, plug it into your computer and you should be able to load and play music on the phone or the phone with the PC is turned off.    I throw my phone all the time that when I am traveling with Windows 7 on my laptop or Vista on my desktop when you work at home.   PC Mode is a shared reading where SD card is accessible by the PC and the phone and at the same time while allowing phone to load.

  • How to load under vi in Panel at the same location using base LV 8.6

    I have several screens to display on the button clicks so I want to load the sub VI Panel in the same place using the package base of LV 8.6.I could find solutions using Insert VI, but which is available in full development Package.Is it in any other way to do it.

    Thank you it worked... but I have a question, I have attached two SCREWS get channel config is the VI I want to display in the Panel of sup, but scrollbars donot work

  • How to drag and drop multiple movieclips at the same time

    Hello world

    I'm a new actonscript 3 and adobe flash CC user and I am building an application but I have been stuck for several days. I have looked everywhere and tried everything I could think of, but I can't yet find a solution to my problem that I thought were pretty basic.

    Basically, let's say I have a rectangle and a circle on the stage. Once I did of the movieclips and assigned an instance name to each of them, I want to be able to perform a drag and drop the Rectangle so that both the rectangle and the circle become movable at the same time.

    For now, I have a mouse down events listener associated with the instance of rectangle, a method startDrag assigned to the rectangle instance and another assigned to the circle. But in this configuration, when I click on and drag the rectangle, only the circle is mobile (only the last line in the code is taken into account).

    I don't know if what I'm trying to achieve is feasible, but any help will be greatly appreciated, thank you!

    The startDrag() method can only work for one object at a time, so in your case the Treaty the last of them, designated the task.  This approach is to temporarily to plant the two objects in a container and then drag the container.

    rectangle.addEventListener (MouseEvent.MOUSE_DOWN, fl_ClickToDrag);  When I click on the rectangle

    var dragMC:MovieClip = new MovieClip();
    addChild (dragMC);

    function fl_ClickToDrag(event:MouseEvent):void

    {
    dragMC.addChild (rectangle);        move objects in the container
    dragMC.addChild (circle);
    dragMC.startDrag ();
    }

    stage.addEventListener (MouseEvent.MOUSE_UP, fl_ReleaseToDrop); When I release the mouse button

    function fl_ReleaseToDrop(event:MouseEvent):void

    {
    dragMC.stopDrag ();
    Rectangle.x += dragMC.x;         Adjust the positions of the objects to their new location
    Rectangle.y += dragMC.y;
    Circle.x += dragMC.x;
    Circle.y += dragMC.y
    addChild (rectangle);                 move back to the scene objects
    addChild (circle);
    dragMC.x = dragMC.y = 0;       reset the benchmark for the dragMC
    }

    All this stuff of repositioning in the Drop function is necessary because when you drag the container, the positions of the content are still on their original coordinates inside the container.  So when you drop them they will resume their x / y positions in their new parent, meaning they go back where they were.  Reposition them where they have been trained to take into account the change in the position of the dragMC.

  • is it possible to load and send php variables at the same time?

    Hello, with this line:
    Request.Method = URLRequestMethod.GET; You can get php variables.
    and with request.method = URLRequestMethod.POST you can send variables.

    But is it possible to do this at the same time?


    they send and receive data in order. IE, data are sent (if there are any) and then the data is received (if there is).

  • How many pods and layouts have open at the same time?

    Hello

    I plan on using Acrobat Connect Pro for virtual brainstorming session...

    I'll take a set of slides with about 60 slides and chop into 8 sections, about 7-8 slides in each, which will be in a new layout. Approximately 10 layouts page altogether.

    To delay the loading time when moving from one layout to another, I want to know if I can keep all 8 pods of open content in each layout, so that when I pass, it simply brings the pod that is already loaded, instead of closing the previous and loading each of them when I change page layouts. That's what going on throughout the slow session by having all these contents on screen (hidden behind the active pod)? Or I'm at something here?

    Thanks for your comments.

    -Matt

    Matt,

    I think that you have determined that this provision only one can be active at a given time. Thus, on the issue of pods.

    I would do it exactly as you have described. The original provision can show longer load times, due to the amount of content that needs to be loaded, but alternate between layouts should be very fast, as all the content is already loaded on each individual computer, it's just a question of brining to the correct forward presentation. With 7-8 slides per presentation, I don't think I would worry a lot on first load either time.

    Of course, always do tests on multiple computers to get an idea of how things will be in the live session, but I'd run with the idea of 'hide' the pods keep minimized transition time.

  • iPhone 7: how to charge and listen to music at the same time...

    The new iPhone is great! But a quick question that I can't find the answer to... In the car, I use the TomTom app and listen to the music on my phone. Because it must be reloaded when I use TomTom, I have a cable for music and one for the load. The new iPhone means that I can't load and listen to music at the same time? Or will there be some accessory available?

    Thank you!

    You can read what is known on the Apple site.

  • How to load and loading movies.

    Guy

    I want to know how to load and unload a movieclip.

    Like for example I have a map of the uk in my swf and when no matter what body, click on map(say_london).the current map should disappear and new larger version of the london must be loaded on another swf and need to get first (orginal card) when he clicks back button.

    Please help me

    Thank you

    Madhu Nevarsin Magar

    Nepal

    Take a look at the class Loader or component UILoader to load a SWF file.

  • Satellite A30 921: how to remove and replace the memory?

    Hi, can someone help me how to remove and replace the memory of satellite A30 921. and also, please give a detailed instruction.

    Thank you in advance.

    Hello

    There is not much to explain. On the low side in the Middle it is placed to cover memory (fixed with two screws). Remove the cover and you will see 2 slots there. I put t know how much memory you here but like Stefan says you can use max 2 GB of RAM (2 x 1024Mo PC2700 - PA3313U-1M1G). How to remove the memory modules, which you can see on http://www.hardwaresecrets.com/article/189/5

    Good bye

  • Laptop HP Touchsmart 15-D020: how to remove and replace the keyboard on laptop HP Touchsmart 15-D020NR

    I spilt a drink on my keyboard and now I can not turn off the caps lock and a number of keys does not work. I need instructions on how to remove and replace the keyboard frame. Thank you.

    On your page of support-look for Maintenance and Service of Guide in the manuals.

    http://support.HP.com/us-en/product/HP-15-D000-TouchSmart-notebook-PC-series/6627588/model/6761859/manuals

Maybe you are looking for

  • Enabling WEP on Satellite A100

    You just bought an A100. Hoping to run wireless. Guide suggests that validates the WEP function but does not say how and I don't see it in any application?... or would that part of installing broadband?

  • Sharing feature works not properly

    I cannot Hare a web page through the sharing feature. After choosing e.g. iMessage, nothing happens outside of the toolbar button gets grayed out, as well as a few other functions. See photos. This could be the cause?

  • HP Probook 440 G3: Problem installing Win7 Pro on Probook 440 G3 - drivers not found

    The product was delivered with Win 10 installed but I need to run Win7 Pro. I photographed the disk before working on it and can restore to Win 10 without problem. However, when you start the process with a USB or DVD, I am able to choose the country

  • all of the icons the desktop or default in the same program

    Help, I used 'open with' for a single program and now all the desktops icons show the same default program icon.  I can't open any program of my desktop icons.  I have to go the the program directory and click on the appropriate icon.  How can I get

  • accidentally tried to move the contents of drive c on external hard drive

    so... I thought that I could free up space by moving everything to an external hard drive.  I tried to move everything on the c:\ drive.  Oops.  He started, but then I think he moved to some files necessary for windows to run, then it stopped working