Accessing scenes in dynamically loaded MovieClip?

Dear experts,
I have used ming 0.4.2 to produce a simple SWF with one
stroke per frame and grouped handfulls of frames into scenes - all
of them labeled for easy tracing. If I look at the resulting raw
file I can see the scene labels near the end as what seems to be a
simple list of offset/label pairs. If I compile the latest swftools
(almost 0.9.0 - needs minor Makefile adjustments) I can use swfdump
to see that there is in fact a SCENEDESCRIPTION tag there (earlier
versions do not recognize tag 056).
However, when I load this into my flex program the movieclip
claims that there is only a single unlabeled scene containing all
the frames - presumably indicating that is has ignored the scene
description.
How can I persuade it to do the right thing?
Note that in order to be able to control the playback of the
movieclip (gotoAndStop etc) I have had to use
This
Trick.
For various other reasons, my app requires flash 9 r124 or
later. I have tried flash 10 with the same results.
All advice appreciated.

Update: I just saw there was a new release of swftools and
the new swfdump knows about the 0x056 tag which dumps nicely as you
can see at the end of this message.
So, the file certainly verifies OK. Maybe I've missed
something very obvious? (Beyond the somewhat vague: "you shouldn't
use scenes" that seems to be a hint here and there.)

Similar Messages

  • Get content of dynamically loaded movieclip

    Hey,
    After trying to no avail to get the totalframes of a dynamically loaded .swf in AS3 I've regressed to AS2.
    Now I can add the clip and get the totalframes of the content, no problem.
    THe problem is I cannot resize the content at all.
    I have no idea how to target the loaded content.
    Here's the code I'm using:
    var myXML:XML = new XML();
    var path:String;
    var mcl:MovieClipLoader = new MovieClipLoader();
    var mclm:MovieClipLoader = new MovieClipLoader();
    var mclL:Object = new Object();
    var frames:Number;
    var i:Number = 0;
    var mc:MovieClip = new MovieClip
    myXML.ignoreWhite=true;
    myXML.load("content.xml");
    holder_mc._alpha = 0;
    myXML.onLoad = function(xmlLoaded){
    menu();
    load();
    mclL.onLoadComplete = function() {
              frames = (MovieClip(holder_mc)._totalframes);
              if (frames == 1) {
                   image();
              else if (frames > 1) {
                   clip();
    load = function(){
         clearInterval(timer);
         path = myXML.firstChild.childNodes[i].childNodes[1].childNodes[0].nodeValue;
         mcl.loadClip(path, holder_mc);
         var tFiles:Number = myXML.firstChild.childNodes.length;
         if (i < tFiles){
              i++;
         else if (i == (tFiles)){
              i=0;
              load();
         mcl.addListener(mclL);     
    image = function() {     
         seconds=1000;
         holder_mc._alpha = 100;
         timer = setInterval(load, seconds);
    clip = function() {     
         holder_mc._alpha = 100;
         ftimer = setInterval(checkFrames, 100);
    checkFrames = function() {
              frame = (MovieClip(holder_mc)._currentframe);
              if (frame==(frames-1)){
                   clearInterval(ftimer);
                   load();
    menu = function(){
         var tFiles:Number = myXML.firstChild.childNodes.length;
         for (me=0; me < tFiles; me++){
         path = myXML.firstChild.childNodes[i].childNodes[1].childNodes[0].nodeValue;
         i++;
         _root.attachMovie("circle", "circle"+me, me, {_x:(me*30), _y:330});
         mclm.loadClip(path, ("circle"+me));     
    I need to resize the content both for the main holder_mc as well as for the menu elements.

    Thank you for the response.
    Unfortunately that didn't work.
    Even if I try to trace either target._width or holder_mc._width where you suggested I get 0 values.
    The only values I did manage to get was when I put the trace in the load() function but they were out of sync with the images being loaded.
    I even tried it on a simpler model:
    var myXML:XML = new XML();
    var path:String;
    var mcl:MovieClipLoader = new MovieClipLoader();
    var mclL:Object = new Object();
    var frames:Number;
    var i:Number = 0;
    var tFiles:Number;
    myXML.ignoreWhite=true;
    myXML.load("content.xml");
    myXML.onLoad = function(xmlLoaded){
    path = myXML.firstChild.childNodes[i].childNodes[1].childNodes[0].nodeValue;
    tFiles = myXML.firstChild.childNodes.length;
    loader();
    loader = function() {
         mcl.loadClip(path, holder_mc);
         mcl.addListener(mclL);
    mclL.onLoadComplete = function(target:MovieClip) {
         trace(target._width);
         trace(holder_mc._height);
    ..and I still get 0 values.

  • Add event listeners to dynamically loaded symbols?

    Hi,
    I'm trying to dynamically load different MovieClips based on user input. Several of those clips have embedded url link symbols. How can I add event listeners to the url links if the dynamically loaded MovieClip does not have an instance name? Seems like I can (right?) apply an instance name when the clip is loading, but the event listener doesn't compile because the name is not there yet, so that seems out.
    Am I on right track?

    Are you saying that you will instnatiate this symbol several times and each time url for this link is going to be different?
    There are at list two ways to deal with it.
    1. Inside symbol you can dispatch a custom event once it is clicked:
    myLink.addeventListener(MouseEvent.CLICK, onClick);
    function onClick(e:MouseEvent):void {
         dispatchEvent(new Event("linkClick"));
    Wherever you instantiate the symbol (perhaps on timeline):
    var symbolInstance:MySymbol = new MySymbol();
    symbolInstance.addEventListener("linkClick", onLinkClick);
    function onLinkClick(e:Event):void {
         // do whatever
    Second way would be to pass url value into symbol instance itself and deal with with it on a symbol level. I personally prefere way 1.

  • Dynamically Load Thumbnails To Horizontal Movieclip?

    I'd like to dynamically load thumbnails into a horizontal movieclip at the bottom of an image gallery to then allow me to load an image by clicking the thumbnails. I found a tutorial to help me load the thumbnails to the stage but I am not sure how to load them into the thumbs movieclip. Here is the code I am using:
    var imageLoader:Loader;
    var xml:XML;
    var xmlList:XMLList;
    var xmlLoader:URLLoader = new URLLoader();
    xmlLoader.load(new URLRequest("xml/murals.xml"));
    xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
    function xmlLoaded(event:Event):void
        xml = XML(event.target.data);
        xmlList = xml.children();
        for(var i:int = 0; i < xmlList.length(); i++)
            imageLoader = new Loader();
            imageLoader.load(new URLRequest(xmlList[i].attribute("thumb")));
            imageLoader.x = i * 175 + 25;     // <----- Also, I don't seem to understand how to space the thumbnails using this code.
            imageLoader.y = 5;
            addChild(imageLoader);
    Thanks in advance!
    -Dan

    I wasn't sure if I should make a new discussion for this or not so I'm just going to post it here.
    Alright. I finally found a tutorial that works for what I am trying to do. The thumbs load on a grid and when I click on the thumb they load in the loader. Now I am having trouble removing them. The tutorial has the remove function on the loaded large image so when you click that it removes itself. I would like so that when you click on the a thumb the current image will unload and the thumb that is clicked on will load but can't figure out how to get it to do that. I figured I'd just add a CLICK listener for the "removeFull" function to the "callFull" function but I think it cancels itself out.
    Here is the code I am using: (the code to load and unload is toward the bottom)
    stop();
    var columns:Number = 2;
    var my_x:Number = 25;
    var my_y:Number = 75;
    var my_thumb_width:Number = 65;
    var my_thumb_height:Number = 65;
    var my_images:XMLList;
    var my_total:Number;
    var container_mc:MovieClip;
    var x_counter:Number = 0;
    var y_counter:Number = 0;
    var myXMLLoader:URLLoader = new URLLoader();
    myXMLLoader.load(new URLRequest("xml/gallery.xml"));
    myXMLLoader.addEventListener(Event.COMPLETE, processXML);
    function processXML (e:Event):void{
        var myXML:XML = new XML(e.target.data);
        my_images = myXML.IMAGE;
        my_total = my_images.length();
        createContainer();
        callThumbs();
    function createContainer():void{
        container_mc = new MovieClip();
        container_mc.x = my_x;
        container_mc.y = my_y;
        addChild(container_mc);
    //The large image loads when the thumb is clicked on.
        container_mc.addEventListener(MouseEvent.CLICK, callFull);
        container_mc.buttonMode = true;
    function callThumbs():void{
        for (var i:Number = 0; i < my_total; i++){
            var thumb_url = my_images[i].@THUMB;;
            var thumb_loader = new Loader();
            thumb_loader.load(new URLRequest(thumb_url));
            thumb_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, thumbLoaded);
            thumb_loader.name = i;
            thumb_loader.x = (my_thumb_width+25)*x_counter;
            thumb_loader.y = (my_thumb_height+25)*y_counter;
            if (x_counter+1 < columns){
                x_counter++;
            } else {
                x_counter = 0;
                y_counter++;
    function thumbLoaded(e:Event):void{
        var my_thumb:Loader = Loader(e.target.loader);
        container_mc.addChild(my_thumb);
    //This function loads the large image.
    function callFull(e:MouseEvent):void{
        var full_loader:Loader = new Loader();
        var full_url = my_images[e.target.name].@FULL;
        full_loader.load(new URLRequest(full_url));
        full_loader.contentLoaderInfo.addEventListener(Event.INIT, fullLoaded);
    //This function centers the large image in the gallery loader.
    function fullLoaded(e:Event):void{
        var my_loader:Loader = Loader(e.target.loader);
        MovieClip(parent.parent).gallery.addChild(my_loader);
        my_loader.x = (MovieClip(parent.parent).gallery.width - my_loader.width)/2;
        my_loader.y = (MovieClip(parent.parent).gallery.height - my_loader.height)/2;
    //The large image unloads when it is clicked on.
        my_loader.addEventListener(MouseEvent.CLICK,removeFull);
    //This function removes the loaded image from the gallery loader.
    function removeFull(e:MouseEvent):void{
        var my_loader:Loader = Loader (e.currentTarget);
        my_loader.unload();
        removeChild(my_loader);

  • Accessing dynamically created movieclips

    I have an application that I am adding movieclips to a
    container movieclip through a for loop and repeatedly calling
    myClip.addChild(theNewClip). Now I have a dozen clips in my
    container and it seems like the only way to access the clip is to
    use the getChildByName() method and cast it into a temporary clip
    so I can get at the its properties.
    Is this the best and/or only way to do this? Does the old AS2
    myContainer["theName"].property not work with dynamically created
    movieclips? It doesn't seem to work for me anymore.
    Anyway I am getting the clips now, but I was hoping someone
    could show me a better way to access a dynamically created movie
    clip.

    In AS3, this is probably not much better, but you can
    generically loop through all movie clips:

  • URLClassLoader + dynamically loading signed jar files

    I have an applet that does not know all of the jar files it will need to load at startup.
    I would like to dynamically load these signed jar files using the URLClassLoader, however it does not recognize these jar files as being signed and I get java.security.AccessControlException: access denied errors.
    Any suggestions?
    Thanks!

    Try this classloader for loading the jars, it should to the trick:
    import java.net.URL;
    import java.net.URLClassLoader;
    import java.net.URLStreamHandlerFactory;
    import java.security.AllPermission;
    import java.security.CodeSource;
    import java.security.PermissionCollection;
    import java.security.Permissions;
    public class AllPermissionsClassLoader extends URLClassLoader {
        public AllPermissionsClassLoader (URL[] urls) {
            super(urls);
        public AllPermissionsClassLoader (URL[] urls, ClassLoader parent) {
            super(urls, parent);
            System.out.println(parent);
        public AllPermissionsClassLoader (URL[] urls, ClassLoader parent, URLStreamHandlerFactory factory) {
            super(urls, parent, factory);
        protected PermissionCollection getPermissions (CodeSource codesource) {
            Permissions permissions = new Permissions();
            permissions.add(new AllPermission());
            return permissions;
    }

  • Help accessing methods in classes load with forName()

    Hi all,
    I am dynamically loading classes at runtime by using Class.forName() and .newInstance(). Is there any way I can access the methods of those classes after they are dynamically loaded? It doesnt seem that they are available for use.
    Any help would be appreciated.
    Ryan

    To clarify, are you asking how to invoke a method on an Object without knowing its class? In any case you should use the reflection api that are avaliable.
    Ex: cl = Class.forName(); Method[] methods = cl.getMethods(); for(int i = methods.length; i-- > 0;) System.out.println(methods[i-1].getName());
    or
    methods[i-1].invoke(cl.newInstance(), new Object[]{});

  • Dynamic loading of a class at runtime with known inheritance

    Hi,
    I am trying to dynamically load a class during runtime where I know that the class implements a particular interface 'AInterface'. Also, this class may be linked to other classes in the same package as that class, with their implementations/extensions given in their particular definitions.
    The class is found by using a JFileChooser to select the class that implements 'AInterface', and loaded up.
    Because the name of the class can be practically anything, my current approach only works for certain classes under the package 'Foo' with classname 'Bar'. Some names have been changed to keep it abstract.
    private AInterface loadAInterface(URL url) throws Exception {
         URL[] urls = { url };
         // Create a new class loader with the directory
         URLClassLoader cl = new URLClassLoader(urls);
         // Load in the class
         Class<?> cls = cl.loadClass("Foo.Bar");
         return (AInterface) cls.newInstance();
    }As you can see, all that is being returned is the interface of the class so that the interface methods can be accessed. My problem is that I don't know what the class or package is called, I just know that the class implements AInterface. Also note that with this approach, the class itself isn't selected in the JFileChooser, rather the folder containing Foo/Bar.class is.

    ejp wrote:
    The class is found by using a JFileChooser to select the class that implements 'AInterface', and loaded up.
    Also note that with this approach, the class itself isn't selected in the JFileChooser, rather the folder containing Foo/Bar.class is.These two statements are mutually contradictory...My apologies, I worded that wrong. My current approach (the one given in the code) selects the root package folder. However, what I want to be able to do, is to simply select a single class file. The current code just makes some assumptions so that I can at least see results in the program.
    As you said, if the root of the package hierarchy is known, then this could be achieved. The problem is that the user either selects the package root or the AInterface class, but not both.
    Is there a way to get package details from a .class file to be used in the actual loading of the class?

  • Can I call a dynamically loaded subvi from a subvi inside a library?

    I have an application that uses a .lvlib, this library has many subvi's.  From my executable, I can dynamically load subvi's within the library using the "open reference.vi" and passing in just the name as long as the subvi's being called are listed in the "always included" list of my build specification.  What I want to do now is load an external subvi (external to the library) using the same method.  But when I try to do this, LabVIEW cannot find the external subvi even when it is included as part of the executable.  It seems the Paths are getting messed up.  Here is what is happening:
    Lets say I have Mylibrary.lvlib as my library in the following path C:\MyProject\Mylibrary.lvlib,
    and internal.vi as my subvi within the library in the following path C:\MyProject\MySubVis\internal.vi,
    and external.vi as my subvi outside of my library in the following path C:\MyProject\external.vi
    This is all in the same project.
    I'm using the "Open VI Reference.vi" from internal.vi to call external.vi, and I'm including both internal.vi and external.vi in my executable (MyEXE.exe for illustration purposes).  When I run this part of my code I get an error and LabVIEW reports the path of my external subvi as: C:\MyProject\MyEXE.exe\MySubVis\external.vi which is really the path for my library subvi.  Why?
    Either way, when I hard code what is supposed to be the correct path to my external subvi:  C:\MyProject\MyEXE.exe\external.vi, LabVIEW can't seem to find the file, its' almost like an access scope problem because I'm trying to access something outside of the library.  Is there such thing?  If the file is part of my exe why can't LabVIEW find it???  How can I call my external.vi BY NAME from my internal.vi??
    Any help is appreciated.

    Your hardcoded path is incorrect. How do you have the build configured? Are you using the new executable structure or the pre-8.2 structure.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Dynamically loading a class that is part of a larger loaded package

    I am dynamically loading a class that is part of a large package, much of which is loaded at startup. The code directly references protected variables in the parts of the package that is loaded by the default class loader. Attempting to access these protected variables gives an access error when the class is dynamically loaded that doesnt occur when the class is loaded at startup.
    Is there a way to make this work?

    To answer my own question -- no
    A reference from http://access1.sun.com/techarticles/DR-article.html says:
    The use of Dynamic Class Reloading can introduce problems when classes that are being dynamically reloaded make calls to non-public methods of helper classes that are in the same package. Such calls are likely to cause a java.lang.IllegalAccesserror to be thrown. This is because a class that is dynamically reloaded is loaded by a different classloader than the one used to load the helper classes. Classes that appear to be in the same package are effectively in different packages when loaded by different classloaders. If class com.myapp.MyServlet is loaded by one classloader and an instance of it tries to call a non-public method of an instance of class com.myapp.Helper loaded by a different classloader, the call will fail because the two classes are in different packages.
    So not being able to access non-private variables in this scenario is the way it works.

  • Dynamically loading client proxy no longer works

    I've got several instances where we need to dynamically load/initialize a WebService client proxy using a URL classloader all within an Applet. The need for the classloader and dynamic loading is due to the seperate jars holding different system modules. One main module can't possible know which submodules are also installed and have WebServices running.
    Instead, the main module reads the location of a class to load and uses a URL classloader to load that class. The loaded class knows about it's own client proxy to use and tries to load the appropriate jar and class. The proxy is successfully found and loaded using the classloader, but pukes during initialization. It appears the RuntimeModeler can't find the generated IsAvailable class even though it exists in the same signed jar that just got loaded and which contains the very client proxy that is trying to initialize itself.
    This process worked fine using 1.5, but no longer works after migrating to 1.6. Am I missing something obvious?
    Classloader: java.net.FactoryURLClassLoader@863cc1
    WebAppMgr.getServiceProxy -> b4 initialize
    class: com.irista.warehouse.webservice.wmscoredata.server.data.IsAvailable could not be found
         at com.sun.xml.internal.ws.modeler.RuntimeModeler.getClass(Unknown Source)
         at com.sun.xml.internal.ws.modeler.RuntimeModeler.processDocWrappedMethod(Unknown Source)
         at com.sun.xml.internal.ws.modeler.RuntimeModeler.processMethod(Unknown Source)
         at com.sun.xml.internal.ws.modeler.RuntimeModeler.processClass(Unknown Source)
         at com.sun.xml.internal.ws.modeler.RuntimeModeler.buildRuntimeModel(Unknown Source)
         at com.sun.xml.internal.ws.client.ServiceContextBuilder.processAnnotations(Unknown Source)
         at com.sun.xml.internal.ws.client.ServiceContextBuilder.completeServiceContext(Unknown Source)
         at com.sun.xml.internal.ws.client.WSServiceDelegate.processServiceContext(Unknown Source)
         at com.sun.xml.internal.ws.client.WSServiceDelegate.createEndpointIFBaseProxy(Unknown Source)
         at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(Unknown Source)
         at javax.xml.ws.Service.getPort(Unknown Source)
         at com.irista.warehouse.webservice.wmscoredata.server.data.WmsCoreDataWS.getWarehouseCoreDataWSPort(WmsCoreDataWS.java:50)
         at com.irista.warehouse.webservice.wmscoredata.client.WmsCoreDataSvcProxy.initialize(WmsCoreDataSvcProxy.java:92)
         at com.irista.ui.webapp.framework.WebAppManager.getServiceProxy(WebAppManager.java:760)
         at com.irista.warehouse.webapps.scheduling.CycleCountParameterPanel.getCycleCountSets(CycleCountParameterPanel.java:309)
         at com.irista.warehouse.webapps.scheduling.CycleCountParameterPanel.refreshAction(CycleCountParameterPanel.java:236)
         at com.irista.warehouse.webapps.scheduling.CycleCountParameterPanel.preDisplay(CycleCountParameterPanel.java:225)
         at com.irista.warehouse.webapps.scheduling.CycleCountParameterPanel.initialize(CycleCountParameterPanel.java:149)
         at com.irista.foundation.webapps.scheduling.TaskTypeParameterPanel.createParameterPanel(TaskTypeParameterPanel.java:473)
         at com.irista.foundation.webapps.scheduling.TaskTypeParameterPanel.refreshAction(TaskTypeParameterPanel.java:147)
         at com.irista.foundation.webapps.scheduling.TaskTypeParameterPanel.preDisplay(TaskTypeParameterPanel.java:331)
         at com.irista.ui.webapp.framework.TabbedAppletPane.changePanel(TabbedAppletPane.java:311)
         at com.irista.ui.webapp.framework.TabbedAppletPane$TabbedChangeListener.stateChanged(TabbedAppletPane.java:385)
         at javax.swing.JTabbedPane.fireStateChanged(Unknown Source)
         at javax.swing.JTabbedPane$ModelListener.stateChanged(Unknown Source)
         at javax.swing.DefaultSingleSelectionModel.fireStateChanged(Unknown Source)
         at javax.swing.DefaultSingleSelectionModel.setSelectedIndex(Unknown Source)
         at javax.swing.JTabbedPane.setSelectedIndexImpl(Unknown Source)
         at javax.swing.JTabbedPane.setSelectedIndex(Unknown Source)
         at javax.swing.plaf.basic.BasicTabbedPaneUI$Handler.mousePressed(Unknown Source)
         at java.awt.AWTEventMulticaster.mousePressed(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at javax.swing.JComponent.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)

    Are you running SP2 R2? This worked for me as well until I upgraded to SCCM 2007 SP2 R2. I am focusing on the "~Doing Account Cleanup" errors in the ccm.log which should happen every 30 days, not every 20 minutes. Those errors have to be related to client push problems. Also, thanks for the reboot suggestion. I realize anytime a computer object is added to a domain security group that has is a member of a local group on the client, that a reboot is necessary on client systems in order to receive a new Kerberos access token but in the case of my test systems, I have explicitly added the computer account to the local administrators group so a reboot is not required. I have a test site in a completely different forest and it behaves almost the same way (doesn't run the "~Doing Account Cleanup" every 20 minutes) but still fails to install the client using the site server's computer account. Must be me!!!   

  • Remote debugging an executable with dynamically loaded subpanel VIs

    All,
    A colleague of mine is attempting to perform remote debugging of an executable he has inherited. It includes subpanels that show dynamically loaded VIs. When connecting with the remote debugger, the main executable shows fine, but the dynamically loaded VIs are not showing their front panels. They appear ok on the remote PC where the executable is running, but they don't appear on his laptop from where he is running the debugger.
    I don't have access to LabVIEW currently, and he cannot get this to work, so I thought I'd ask the community this generic question:
    "Is it possible to remotely debug a LabVIEW executable with subpanels that show dynamically loaded subVIs?"
    Technically he can see and probe the block diagram of the main executable, but the subpanels are blank where the dynamcally loaded subVI front panel should show, making it impossible to interact with the program.
    Thoric (CLA, CLED, CTD and LabVIEW Champion)

    Thanks Josh. Does this issue have a CAR number I can tag?
    Thoric (CLA, CLED, CTD and LabVIEW Champion)

  • Dynamically create movieclips

    I want to be able to dynamically create movieclips in flash based on a midi file.
    So I converted the midi file to an .xml file first. I traced the number of events going on and the time of when an event starts or ends.
    So to keep track of those times, I put them in an array.(keytimer[i])
    The timer goes up 1microsecond at a time, for as long as the song is; in this case 190080 microseconds.
    The thing I want is when the timer equals a number in this array(keytimer[i]), and only when the attribute is 'NoteOn', then it should create a movieclip.
    I tried doing it like this; but he doesnt recognise the array:
    if (current==keytimer[i]) {
    trace("yes");
    Any help is more than welcome
    Flash file:
    var xmlLoader:URLLoader = new URLLoader();xmlLoader.addEventListener(Event.COMPLETE, showXML);xmlLoader.load(new URLRequest("for_elise_by_beethoven.xml"));function showXML(e:Event):void { XML.ignoreWhitespace=true; var songs:XML=new XML(e.target.data); trace(songs.Track.Event.length()); var i:Number; var keytimer:Array = new Array(); for (i=0; i < songs.Track.Event.length(); i++) { keytimer[i] =(" Time of the key: "+ songs.Track.Event[i].Absolute.text()); if (current==keytimer[i]) { trace("yes"); } //trace(keytimer[i]); //trace(" NoteOn: "+ songs.Track.Event[i].NoteOn.@Note); //trace(" NoteOff: "+ songs.Track.Event[i].NoteOff.@Note); //trace(" "); } var myTimer:Timer=new Timer(1,190000); myTimer.addEventListener(TimerEvent.TIMER,doStuff); var current:Number=0; myTimer.start(); function doStuff(event:TimerEvent):void { current++; trace("current: "+ current); trace("keytimer: "+ keytimer[i]); //trace("keytimer: "+ keytimer[i]); /*if (current==keytimer[i]) { trace("yes"); }*/  }}
    The current xml file: (name: for_elise_by_beethoven.xml)
    <?xml version="1.0" encoding="ISO-8859-1"?><!DOCTYPE MIDIFile PUBLIC  "-//Recordare//DTD MusicXML 0.9 MIDI//EN"  "http://www.musicxml.org/dtds/midixml.dtd"><MIDIFile><Format>1</Format><TrackCount>4</TrackCount><TicksPerBeat>960</TicksPerBeat><TimestampType>Absolute</TimestampType><Track Number="0">  <Event>    <Absolute>0</Absolute>    <SequencerSpecific>05 0f 12 00 00 7f 7f 00</SequencerSpecific>  </Event>  <Event>    <Absolute>0</Absolute>    <SequencerSpecific>05 0f 1c 32 30 30 35 2e 31 32 2e 30 32</SequencerSpecific>  </Event>  <Event>    <Absolute>0</Absolute>    <TrackName>Track 0</TrackName>  </Event>  <Event>    <Absolute>0</Absolute>    <SetTempo Value="857143"/>  </Event>  <Event>    <Absolute>0</Absolute>    <EndOfTrack/>  </Event></Track><Track Number="1">  <Event>    <Absolute>0</Absolute>    <ProgramChange Channel="1" Number="0"/>  </Event>  <Event>    <Absolute>0</Absolute>    <SequencerSpecific>05 0f 09 40 48</SequencerSpecific>  </Event>  <Event>    <Absolute>0</Absolute>    <CopyrightNotice>2006 by forelise.com</CopyrightNotice>  </Event>  <Event>    <Absolute>0</Absolute>    <InstrumentName>Piano</InstrumentName>  </Event>  <Event>    <Absolute>0</Absolute>    <TrackName>Für Elise</TrackName>  </Event>  <Event>    <Absolute>0</Absolute>    <SequencerSpecific>05 0f 06 47 65 6e 65 72 61 6c 20 4d 49 44 49</SequencerSpecific>  </Event>  <Event>    <Absolute>0</Absolute>    <TimeSignature Numerator="3" LogDenominator="3" MIDIClocksPerMetronomeClick="12" ThirtySecondsPer24Clocks="8"/>  </Event>  <Event>    <Absolute>0</Absolute>    <MIDIChannelPrefix Value="00"/>  </Event>  <Event>    <Absolute>960</Absolute>    <NoteOn Channel="1" Note="76" Velocity="71"/>  </Event>  <Event>    <Absolute>1200</Absolute>    <NoteOff Channel="1" Note="76" Velocity="0"/>  </Event>  <Event>    <Absolute>1200</Absolute>    <NoteOn Channel="1" Note="75" Velocity="38"/>  </Event>  <Event>    <Absolute>1440</Absolute>    <NoteOff Channel="1" Note="75" Velocity="0"/>  </Event>  <Event>    <Absolute>1440</Absolute>    <NoteOn Channel="1" Note="76" Velocity="57"/>  </Event>  <Event>    <Absolute>1680</Absolute>    <NoteOff Channel="1" Note="76" Velocity="0"/>  </Event>  <Event>    <Absolute>1680</Absolute>    <NoteOn Channel="1" Note="75" Velocity="70"/>  </Event>  <Event>    <Absolute>1920</Absolute>    <NoteOff Channel="1" Note="75" Velocity="0"/>  </Event>  <Event>    <Absolute>1920</Absolute>    <NoteOn Channel="1" Note="76" Velocity="76"/>  </Event>  <Event>    <Absolute>2160</Absolute>    <NoteOff Channel="1" Note="76" Velocity="0"/>  </Event>  <Event>    <Absolute>2160</Absolute>    <NoteOn Channel="1" Note="71" Velocity="76"/>  </Event>  <Event>    <Absolute>2400</Absolute>    <NoteOff Channel="1" Note="71" Velocity="0"/>  </Event>  <Event>    <Absolute>2400</Absolute>    <NoteOn Channel="1" Note="74" Velocity="76"/>  </Event>  <Event>    <Absolute>2640</Absolute>    <NoteOff Channel="1" Note="74" Velocity="0"/>  </Event>  <Event>    <Absolute>2640</Absolute>    <NoteOn Channel="1" Note="72" Velocity="83"/>  </Event>  <Event>    <Absolute>2880</Absolute>    <NoteOff Channel="1" Note="72" Velocity="0"/>  </Event>  <Event>    <Absolute>2880</Absolute>    <NoteOn Channel="1" Note="69" Velocity="89"/>  </Event>  <Event>    <Absolute>2880</Absolute>    <SequencerSpecific>05 0f 0f 02</SequencerSpecific>  </Event>  <Event>    <Absolute>2880</Absolute>    <NoteOn Channel="1" Note="45" Velocity="64"/>  </Event>  <Event>    <Absolute>3120</Absolute>    <NoteOff Channel="1" Note="45" Velocity="0"/>  </Event>  <Event>    <Absolute>3120</Absolute>    <NoteOn Channel="1" Note="52" Velocity="64"/>  </Event>  <Event>    <Absolute>3360</Absolute>    <NoteOff Channel="1" Note="52" Velocity="0"/>  </Event>  <Event>    <Absolute>3360</Absolute>    <NoteOn Channel="1" Note="57" Velocity="70"/>  </Event>  <Event>    <Absolute>3600</Absolute>    <NoteOff Channel="1" Note="69" Velocity="0"/>  </Event>  <Event>    <Absolute>3600</Absolute>    <NoteOff Channel="1" Note="57" Velocity="0"/>  </Event>  <Event>    <Absolute>3600</Absolute>    <NoteOn Channel="1" Note="60" Velocity="76"/>  </Event>  <Event>    <Absolute>3840</Absolute>    <NoteOff Channel="1" Note="60" Velocity="0"/>  </Event>  <Event>    <Absolute>3840</Absolute>    <NoteOn Channel="1" Note="64" Velocity="76"/>  </Event>  <Event>    <Absolute>4080</Absolute>    <NoteOff Channel="1" Note="64" Velocity="0"/>  </Event>  <Event>    <Absolute>4080</Absolute>    <NoteOn Channel="1" Note="69" Velocity="76"/>  </Event>  <Event>    <Absolute>4320</Absolute>    <NoteOff Channel="1" Note="69" Velocity="0"/>  </Event>  <Event>    <Absolute>4320</Absolute>    <NoteOn Channel="1" Note="71" Velocity="83"/>  </Event>  <Event>    <Absolute>4320</Absolute>    <SequencerSpecific>05 0f 0f 02</SequencerSpecific>  </Event>  <Event>    <Absolute>4320</Absolute>    <NoteOn Channel="1" Note="40" Velocity="64"/>  </Event>  <Event>    <Absolute>4560</Absolute>    <NoteOff Channel="1" Note="40" Velocity="0"/>  </Event>  <Event>    <Absolute>4560</Absolute>    <NoteOn Channel="1" Note="52" Velocity="64"/>  </Event>  <Event>    <Absolute>4800</Absolute>    <NoteOff Channel="1" Note="52" Velocity="0"/>  </Event>  <Event>    <Absolute>4800</Absolute>    <NoteOn Channel="1" Note="56" Velocity="70"/>  </Event>  <Event>    <Absolute>5040</Absolute>    <NoteOff Channel="1" Note="71" Velocity="0"/>  </Event>  <Event>    <Absolute>5040</Absolute>    <NoteOff Channel="1" Note="56" Velocity="0"/>  </Event>  <Event>    <Absolute>5040</Absolute>    <NoteOn Channel="1" Note="64" Velocity="76"/>  </Event>  <Event>    <Absolute>5280</Absolute>    <NoteOff Channel="1" Note="64" Velocity="0"/>  </Event>  <Event>    <Absolute>5280</Absolute>    <NoteOn Channel="1" Note="68" Velocity="76"/>  </Event>  <Event>    <Absolute>5520</Absolute>    <NoteOff Channel="1" Note="68" Velocity="0"/>  </Event>  <Event>    <Absolute>5520</Absolute>    <NoteOn Channel="1" Note="71" Velocity="76"/>  </Event>  <Event>    <Absolute>5760</Absolute>    <NoteOff Channel="1" Note="71" Velocity="0"/>  </Event>  <Event>    <Absolute>5760</Absolute>    <NoteOn Channel="1" Note="72" Velocity="83"/>  </Event>  <Event>    <Absolute>5760</Absolute>    <NoteOn Channel="1" Note="45" Velocity="64"/>  </Event>  <Event>    <Absolute>6000</Absolute>    <NoteOff Channel="1" Note="45" Velocity="0"/>  </Event>  <Event>    <Absolute>6000</Absolute>    <NoteOn Channel="1" Note="52" Velocity="70"/>  </Event>  <Event>    <Absolute>6240</Absolute>    <NoteOff Channel="1" Note="52" Velocity="0"/>  </Event>  <Event>    <Absolute>6240</Absolute>    <NoteOn Channel="1" Note="57" Velocity="76"/>  </Event>  <Event>    <Absolute>6480</Absolute>    <NoteOff Channel="1" Note="72" Velocity="0"/>  </Event>  <Event>    <Absolute>6480</Absolute>    <NoteOff Channel="1" Note="57" Velocity="0"/>  </Event>  <Event>    <Absolute>6480</Absolute>    <NoteOn Channel="1" Note="64" Velocity="76"/>  </Event>  <Event>    <Absolute>6720</Absolute>    <NoteOff Channel="1" Note="64" Velocity="0"/>  </Event>  <Event>    <Absolute>6720</Absolute>    <NoteOn Channel="1" Note="76" Velocity="76"/>  </Event>  <Event>    <Absolute>6960</Absolute>    <NoteOff Channel="1" Note="76" Velocity="0"/>  </Event>  <Event>    <Absolute>6960</Absolute>    <NoteOn Channel="1" Note="75" Velocity="64"/>  </Event>  <Event>    <Absolute>7200</Absolute>    <NoteOff Channel="1" Note="75" Velocity="0"/>  </Event>  <Event>    <Absolute>7200</Absolute>    <NoteOn Channel="1" Note="76" Velocity="76"/>  </Event>  <Event>    <Absolute>7440</Absolute>    <NoteOff Channel="1" Note="76" Velocity="0"/>  </Event>  <Event>    <Absolute>7440</Absolute>    <NoteOn Channel="1" Note="75" Velocity="70"/>  </Event>  <Event>    <Absolute>7680</Absolute>    <NoteOff Channel="1" Note="75" Velocity="0"/>  </Event>  <Event>    <Absolute>7680</Absolute>    <NoteOn Channel="1" Note="76" Velocity="76"/>  </Event>  <Event>    <Absolute>7920</Absolute>    <NoteOff Channel="1" Note="76" Velocity="0"/>  </Event>  <Event>    <Absolute>7920</Absolute>    <NoteOn Channel="1" Note="71" Velocity="76"/>  </Event>  <Event>    <Absolute>8160</Absolute>    <NoteOff Channel="1" Note="71" Velocity="0"/>  </Event>  <Event>    <Absolute>8160</Absolute>    <NoteOn Channel="1" Note="74" Velocity="76"/>  </Event>  <Event>    <Absolute>8400</Absolute>    <NoteOff Channel="1" Note="74" Velocity="0"/>  </Event>  <Event>    <Absolute>8400</Absolute>    <NoteOn Channel="1" Note="72" Velocity="76"/>  </Event>  <Event>    <Absolute>8640</Absolute>    <NoteOff Channel="1" Note="72" Velocity="0"/>  </Event>  <Event>    <Absolute>8640</Absolute>    <NoteOn Channel="1" Note="69" Velocity="83"/>  </Event>  <Event>    <Absolute>8640</Absolute>    <SequencerSpecific>05 0f 0f 02</SequencerSpecific>  </Event>  <Event>    <Absolute>8640</Absolute>    <NoteOn Channel="1" Note="45" Velocity="57"/>  </Event>  <Event>    <Absolute>8880</Absolute>    <NoteOff Channel="1" Note="45" Velocity="0"/>  </Event>  <Event>    <Absolute>8880</Absolute>    <NoteOn Channel="1" Note="52" Velocity="64"/>  </Event>  <Event>    <Absolute>9120</Absolute>    <NoteOff Channel="1" Note="52" Velocity="0"/>  </Event>  <Event>    <Absolute>9120</Absolute>    <NoteOn Channel="1" Note="57" Velocity="70"/>  </Event>  <Event>    <Absolute>9360</Absolute>    <NoteOff Channel="1" Note="69" Velocity="0"/>  </Event>  <Event>    <Absolute>9360</Absolute>    <NoteOff Channel="1" Note="57" Velocity="0"/>  </Event>  <Event>    <Absolute>9360</Absolute>    <NoteOn Channel="1" Note="60" Velocity="76"/>  </Event>  <Event>    <Absolute>9600</Absolute>    <NoteOff Channel="1" Note="60" Velocity="0"/>  </Event>  <Event>    <Absolute>9600</Absolute>    <NoteOn Channel="1" Note="64" Velocity="76"/>  </Event>  <Event>    <Absolute>9840</Absolute>    <NoteOff Channel="1" Note="64" Velocity="0"/>  </Event>  <Event>    <Absolute>9840</Absolute>    <NoteOn Channel="1" Note="69" Velocity="76"/>  </Event>  <Event>    <Absolute>10080</Absolute>    <NoteOff Channel="1" Note="69" Velocity="0"/>  </Event>  <Event>    <Absolute>10080</Absolute>    <NoteOn Channel="1" Note="71" Velocity="83"/>  </Event> 
              ...ETC...
      <Event>    <Absolute>185040</Absolute>    <NoteOff Channel="1" Note="56" Velocity="0"/>  </Event>  <Event>    <Absolute>185040</Absolute>    <NoteOn Channel="1" Note="64" Velocity="51"/>  </Event>  <Event>    <Absolute>185280</Absolute>    <NoteOff Channel="1" Note="64" Velocity="0"/>  </Event>  <Event>    <Absolute>185280</Absolute>    <NoteOn Channel="1" Note="72" Velocity="51"/>  </Event>  <Event>    <Absolute>185520</Absolute>    <NoteOff Channel="1" Note="72" Velocity="0"/>  </Event>  <Event>    <Absolute>185520</Absolute>    <NoteOn Channel="1" Note="71" Velocity="51"/>  </Event>  <Event>    <Absolute>185733</Absolute>    <ControlChange Channel="1" Control="64" Value="127"/>  </Event>  <Event>    <Absolute>185760</Absolute>    <NoteOff Channel="1" Note="71" Velocity="0"/>  </Event>  <Event>    <Absolute>185760</Absolute>    <SequencerSpecific>05 0f 0e</SequencerSpecific>  </Event>  <Event>    <Absolute>185760</Absolute>    <NoteOn Channel="1" Note="60" Velocity="45"/>  </Event>  <Event>    <Absolute>185760</Absolute>    <NoteOn Channel="1" Note="69" Velocity="45"/>  </Event>  <Event>    <Absolute>185760</Absolute>    <NoteOn Channel="1" Note="45" Velocity="45"/>  </Event>  <Event>    <Absolute>185760</Absolute>    <NoteOn Channel="1" Note="33" Velocity="45"/>  </Event>  <Event>    <Absolute>187200</Absolute>    <NoteOff Channel="1" Note="45" Velocity="0"/>  </Event>  <Event>    <Absolute>187200</Absolute>    <NoteOff Channel="1" Note="33" Velocity="0"/>  </Event>  <Event>    <Absolute>187200</Absolute>    <NoteOff Channel="1" Note="60" Velocity="0"/>  </Event>  <Event>    <Absolute>187200</Absolute>    <NoteOff Channel="1" Note="69" Velocity="0"/>  </Event>  <Event>    <Absolute>190048</Absolute>    <ControlChange Channel="1" Control="64" Value="0"/>  </Event>  <Event>    <Absolute>190080</Absolute>    <SequencerSpecific>05 0f 0a</SequencerSpecific>  </Event>  <Event>    <Absolute>190080</Absolute>    <EndOfTrack/>  </Event></Track><Track Number="2">  <Event>    <Absolute>0</Absolute>    <SequencerSpecific>05 0f 09 00 40</SequencerSpecific>  </Event>  <Event>    <Absolute>0</Absolute>    <SequencerSpecific>05 0f 06 47 65 6e 65 72 61 6c 20 4d 49 44 49</SequencerSpecific>  </Event>  <Event>    <Absolute>0</Absolute>    <TrackName>http://www.forelise.com/</TrackName>  </Event>  <Event>    <Absolute>0</Absolute>    <TimeSignature Numerator="3" LogDenominator="3" MIDIClocksPerMetronomeClick="12" ThirtySecondsPer24Clocks="8"/>  </Event>  <Event>    <Absolute>0</Absolute>    <ProgramChange Channel="2" Number="0"/>  </Event>  <Event>    <Absolute>0</Absolute>    <MIDIChannelPrefix Value="01"/>  </Event>  <Event>    <Absolute>0</Absolute>    <EndOfTrack/>  </Event></Track><Track Number="3">  <Event>    <Absolute>0</Absolute>    <SequencerSpecific>05 0f 09 00 40</SequencerSpecific>  </Event>  <Event>    <Absolute>0</Absolute>    <SequencerSpecific>05 0f 06 47 65 6e 65 72 61 6c 20 4d 49 44 49</SequencerSpecific>  </Event>  <Event>    <Absolute>0</Absolute>    <TrackName>Composed by Ludwig van Beethoven</TrackName>  </Event>  <Event>    <Absolute>0</Absolute>    <TimeSignature Numerator="3" LogDenominator="3" MIDIClocksPerMetronomeClick="12" ThirtySecondsPer24Clocks="8"/>  </Event>  <Event>    <Absolute>0</Absolute>    <ProgramChange Channel="3" Number="0"/>  </Event>  <Event>    <Absolute>0</Absolute>    <MIDIChannelPrefix Value="02"/>  </Event>  <Event>    <Absolute>0</Absolute>    <EndOfTrack/>  </Event></Track></MIDIFile>

    var current:int=0;
    myTimer.start();
    function doStuff(event:TimerEvent):void {
    current++;
    trace("current: "+ current);
    trace("keytimer: "+ keytimer[i]);
    //trace("keytimer: "+ keytimer[i]);
    if (current==int(keytimer[i)]) {
    trace("yes");

  • How to dynamically load images into Flash

    I have a movie clip on the stage that I want to dynamically
    load images into (that constantly change), how would I go about
    doing this? Thanks.

    Use the Loader class to load in images.
    Then use addChild to add the Loader class into your MovieClip
    on the stage.
    As far as &amp;quot;constantly change&amp;quot; what
    do you mean by that? You could use setInterval, ther enterFrame
    event, or any other means to trigger a new image to be loaded into
    the Loader instance.
    Finally, you can use the Tween class to create some nice
    effects for the images (fade it, blur in, photo blend, masks,
    etc)

  • Get width and height of a dynamically loaded image once it's done loading?!

    hello : :
    well... i'm taking my first shots at flex after programming
    in flash for a year now. it's been fun and i've been picking up on
    things pretty well (or so i think), but i come across something
    today that i used to be able to do in my as2 programming and don't
    know how to do in as3...
    in flex, i'm loading an image into an image control (by using
    "myImgControl.load(urlString)"). i have a "complete" parameter on
    the image control that calls a function just fine after the image
    is loaded, but if i try and check the hight and width of the loaded
    image once it loads, it comes back as zero. how can i get the
    height and width of the image after it's loaded?!
    in flash/as2 i used to do this little trick/work-around i
    found in a forum (kirupa.com, i think) to find out the width and
    height once the loaded image listener checked the loading process
    and came back "complete"... in the code below, "imgLoader" is the
    movieClip the image was loaded using
    imgLoaderListener.loadClip(urlString, imgLoader).
    quote:
    iTot = imgLoader.getBytesTotal();
    iLoad = imgLoader.getBytesLoaded();
    if (iLoad == iTot && iTot > 4) {
    imgH = imgLoader._height;
    imgW = imgLoader._width;
    that all make sense?!
    basically, it's as simple as this: i need to find something
    similar to the above for as3 that will tell me the width and height
    of a dynamically loaded image after it's done loading...
    so there ya have it. i appreciate any help any of you can
    throw my way! thank you so much for even reading this!
    : : michael

    I assume you have probably already figured this out, but just
    in case, there should be an event to listen for after which you can
    get the height and width information successfully. I can't remember
    the exact name, however. Experiment and see which one works
    time-wise.

Maybe you are looking for

  • ITunes does not recognize 5th Generation video iPod in WinXp

    PROBLEM: 5G iPod not recognized in iTunes (shows as removable hard drive in My Computer) via USB on HP Pavilion Notebook running WinXP. Latest error states insufficient power to run hi speed USB device on this computer. HP support replies that instal

  • Overwrite image information box display

    I want to insert a mouse over image into my Project. I think I'm on the right track...Insert>HTML>Forms>Image Button (Ok maybe the image button is not on the right track but it's a start). I'm getting an informational box that says: Overwrite "C:\Pro

  • To Find transaction code for maintenance view J_1BT001WV

    Hi Gurus, I have to find transaction code for maintenance view J_1BT001WV. Plz tell me how can i do it. regards Rajesh

  • Web Service Session Closing

    Hello everyone, In our webservices we are using a dummy user which logs on and requests webservice data as different applications. (ie from .net app) The problem arises here that there are too many sessions are staying open in the system after multip

  • MalformedRequest - Enterprise Portal

    When provisioning UME Groups from GRC 5.3 AC CUP SP11 to the same java instance where GRC is installed, I periodically notice that the Group does not get provisioned. The CUP request is processed without any header errors but when I review the detail