Management of the custom event sent by loading SWF fails

I loaded and SWF using SWFLoader. Not a component, but just a regular Flash AS3 SWF. I can access its properties and functions but when I listen to a custom, event distributes, I get the error:

Error #1034: Type coercion failed: cannot convert com.subhumanmedia.classes::SoundCueEvent@911ad61 to com.subhumanmedia.classes.SoundCueEvent.

Here's the event:
package com.subhumanmedia.classes
{
import flash.events.Event;
SerializableAttribute public class SoundCueEvent extends Event
{
public static const = "cueSound" CUE_SOUND:String

private var soundCueObjectInstance:Object;

public void SoundCueEvent (type: String, bubbles: Boolean, cancelable: Boolean, soundCueObject:Object)
{
parameter soundCueObject:
soundCueObject.cueSoundURL is the string with the name of file to play
soundCueObject.cueSoundStartTime is the number giving the millisecond offset to read from
//
Super (type, bubbles, cancelable);
soundCueObjectInstance = soundCueObject;
}
public function get soundCueObject (): Object
{
Return soundCueObjectInstance;
}
override public function clone (): event
{
return new SoundCueEvent (type, bubbles, cancelable, soundCueObjectInstance);
}
}
}

Here is the statement in the loaded SWF, the event:
dispatchEvent (new SoundCueEvent (SoundCueEvent.CUE_SOUND, true, false, soundCues [cueCounter]));


soundCues is an attay soundCueObjects.

Here is the definition of the listener in my main class:
slide.slideGraphic.swfObject.content.addEventListener (SoundCueEvent.CUE_SOUND, cueSoundHandler);

And here's the Manager:
private void cueSoundHandler(e:SoundCueEvent):void
{
trace (e);
}

If I change the type of parameter of the event Manager, it does not take a mistake, but I can't yet ride a SoundCueEvent event in order to obtain tracking information.

Now both the right loaded SWF and main class get the definition of the event from a compiled SWC, but I tried several other ways to do it without any better result.

I don't know even what causes the error and am totally baffled by how to solve it. Can anyone help?

It is equivalent to the problem of shared code described in the presentation of the modules on my blog.

Alex Harui

Flex SDK Developer

Adobe Systems Inc..

Blog: http://blogs.adobe.com/aharui

Tags: Flex

Similar Questions

  • When the Manager of the custom function in a configuration of link file gets error?

    The question she get error when the Manager of the custom function in a config file in the plan to include the link.
    When she went to join the custom function Manager in the debugger, everything is OK.

    <? XML version = "1.0" encoding = "utf-8"? >
    < configuration >
    < custom function platform = "DotNet".
    library-path="G:\RB1\Include\CustomFunctions.dll".
    Class="Viking.CustomFunctions.CustomFunctions"/ >
    < / configuration >

    THS, category and path is correct.
    So is there any problem for < custom function platform = "DotNet"?

    OPA version 10.2

    OPA error message translated from the Germany into English: Exception has been thrown by the target of a call

    In general, you should not give the full path of the custom function, it should be rather in relation to the project include file.

    for example:

    and then make sure that the CustomFunctions.dll file is copied into the project folder until the project is built.

    In addition, if you use 10.2 for a new project, the mechanism that you use is now replaced. An extension of the custom function is the new thing, and it will look much nicer when it is used in the rules. Refer to the section 'Write a Custom function Extension' in aid of developer for more information.

  • Custom with the custom event handling/propagation class

    Hello

    I m trying to figure out, how we could extend a custom class so that other classes could enter the headphones to this custom class

    and will be informed by raising an event in this custom class.

    I can´t find any documentation about it. The post of oracle on the management of the event to

    http://docs.Oracle.com/JavaFX/2/events/jfxpub-events.htm

    doing business only about the event target and the string of events.

    But to my understanding, I need to know how this custom class could be extended to be an EventSource?

    I could extend my node, scene or window class to get all the things in the event by legacy, but I think that

    that is not the right way? Not everything is a node

    As indicated in the article

    If your control or element of your control is not a subclass of Window , Scene , or Node , you need to implement the EventTarget interface for this control or element.

    I must apply EventTarget and its method

    @Override
        public EventDispatchChain buildEventDispatchChain(EventDispatchChain edc) {
            throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
        }
    

    But it is a target? And the source?

    I m a bit confused.

    Help would be great for a beginner, some shooting events

    THX

    Inge

    Would what type of event you like fire? Perhaps using the framework of the event in javafx.event is more you need. What if all you want to do is to inform listeners that some State has changed, you should consider using javafx.beans.Observable or one of the classes implementing this interface.

  • Help in the management of the field events

    Hi all

    I have a form that contains a list field and a set of navigation on top buttons. I replaced the navigationClick method to handle the click on the trackpad / touch events as shown in the method below:

    protected boolean navigationClick (int status, int time) {}
    TODO self-generating method stub
    Dialog.Inform ("clicked list");
    Returns true;
    }

    When you click on the list or touched the output is as below:

    For the button, I used the setChangeListener as in the code below:

    logoutButton.setChangeListener (new FieldChangeListener() {}
                
    ' Public Sub fieldChanged (field field, int context) {}
    TODO self-generating method stub
    Dialog.Inform ("button clicked");
    }
    });

    Now that the focus is on the button and I click the button use the trackpad, the navigationClick method is called and not the fieldChanged method. The output is as below:

    Am I missing out on something? When the button is clicked by using the tracpad I would the fieldChanged method is called. Kindly help me with this. Thanks in advance.

    Kind regards

    S.A.Norton Stanley

    crush you on the screen or on the listfield navigationclick?
    events are handled from top to bottom, and the screen becomes the first event.
    This means that if you manage the click on the screen, the button never receives.

    You can consult getLeafFieldWithFocus to be correct, or crush navigationClick only for your listfield.

  • What is the custom event that fires?

    Hello

    What is customized event triggered in the OPA.

    I heard that, at the time of the training online OPA in last week.

    A custom event is a way to write a rule that will send a signal. When executing time event listeners can be attached to the motor of the OPA, and a custom event can be used as a way to signal that something should happen.

    For Documentation on writing a raiseevent rule see rules of use to trigger external software applications in modeling of political Oracle Help.

    For Documentation on the event listeners, see events and event handlers and example: handle the events of modules with an inference event listener in Oracle policy Automation Developer Help.

  • Problem with the ENTER_FRAME event from a loaded mc

    I have a UILoader on the main timeline, then I have to load an external mc with an event ENTER_FRAME inside. When I insert something else, I found that the ENTER_FRAME event still works. Why he is not credited with the mc?

    This is as3.  all streams, intervals and events which are not dependent on the interaction of the mouse are running.

    If you publish to fp 10, you can use the class loader and unloadAndStop().  otherwise, you must stop explicitly all fumes, etc. before unloading.

  • Event Bubbling: Relay of the custom events

    Background:
    The bubbling in the action script 3 event causes an event to travel from the responsible subject through all its objects from parent to the root application. The event then moves back down to the original object.

    Goal: keep the data, the controller and the loosely coupled views
    1. When display objects are instantiated, they send an event by saying that they need certain information. The event has the type of information they need.
    2. the purpose of data capture this event, determines if it it has in memory. If it isn't, it retrieves information from a web service and pushes the result in a table.
    3. once the result in memory, it takes an event that contains the index of the result table.
    4. the view captures the result, out of the index and use it to link to the correct array element

    Result: The display is automatically updated every time that the data object is called by the web service with an update.

    In this scenario, nor the view or the data can be parents of each other, but each must be able to respond to the events of each and other. The reason is so that I can have multiple views generated dynamically, using the same data.

    Question:
    If the data (model) and the views are children of the same application, how does one maintain loose coupling between them?

    Current solution:
    The only thing I could get to is having the object application or controller catch all custom events and then their reconsignment to the children. The problem is that it is messy.

    I could also design a handler class that would have the forwarding of events to the right of the child hierarchy. I could include a private string variable that would capture the name of the object responsible for when my custom event was known as the class handler could do dynamic mapping.

    Is there a better solution?

    Thanks - I posted the question on something awful and someone suggested that I use a microwave recommended architecture on Adobe Labs called Cairngorm , I'll go through the documentation and give it a test drive this week.

  • Cannot target the main stage of dynamically loaded swf...

    A part of the Flash application. I'm working on right now is the following-

    Main stage load an external swf using the following function:

    function loadAsset(evt:String):void{
     var assetName:String = evt;
     if (assetName != null){
      var assetLdr:Loader = new Loader();  
      var assetURL:String = assetName;  
      var assetURLReq:URLRequest = new URLRequest(assetURL);  
      assetLdr.load(assetURLReq);  
      assetLdr.contentLoaderInfo.addEventListener( Event.INIT , loaded)  
      assetLdr.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, displayAssetLoaderProgress);   
      function loaded(event:Event):void {  
       var targetLoader:Loader = Loader(event.target.loader);  
       assetWindow.addChild(targetLoader);
      }
     }
    }
    

    The external swf file loaded, load another external swf to itself using the following function:

    function loadQuiz(evt:String):void{    
     var quizName:String = evt; 
     if (quizName != null){ 
      var quizLdr:Loader = new Loader(); 
      var quizURL:String = quizName; 
      var quizURLReq:URLRequest = new URLRequest(quizURL); 
      quizLdr.load(quizURLReq); 
      quizLdr.contentLoaderInfo.addEventListener( Event.INIT , loaded)        
      quizLdr.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, displayQuizLoaderProgress);  
      function loaded(event:Event):void { 
       var targetLoader:Loader = Loader(event.target.loader); 
       quizWindow.assetLoader.addChild(targetLoader);      
      }
     }
    }


    Everything loads fine, but at the level of quizWindow.assetLoader.addChild (targetLoader), I want to send a message/fill in an area of dynamic text on the main stage. I've been 'parenting' my brain and I'm not sure of how to communicate with that level.

    can anyone show me the correct path or the method based on the above, or have a suggestion?


    See you soon,.
    ~ Chipleh

    You make me feel nostalgic...

  • To access the MovieClip instances in a loaded SWF file

    The situation as follows:

    loadedSWF.swf (published with Flash Player 8 AS2 or AS3 of Alpha Flash Player 9), contains on the symbols of the stage with the instance names: clipA, clipB, clipC, etc... No ActionScript is included in the file.

    In a Flex Builder 2.0 project, a component that extends mx.core.UIComponent load loadedSWF.swf:

    script
    var request: URLRequest = new URLRequest ("loadedSWF.swf");
    loaded var: Loader = new Loader();
    Loaded.Load (request);
    addChildAt(loaded,0);


    loadedSWF.swf successfully is displayed in the component's display list, but MovieClip instances that it contains are inaccessible.

    Its existence is verified:

    script
    trace (getChildAt (0)) / / result: [object Loader]
    trace (getChildAt (0) .root) / / result: [object _system_mx_managers_SystemManager]

    However, even if .root getChildAt (0) returns a mx.managers.SystemManager and mx.managers.SystemManager supports the numChildren property, trace (getChildAt (0).root.numChildren) survey error: 1119: access of the numChildren property possibly not defined through a reference with static type flash.display:DisplayObject.. Other methods like getChildAt(), etc. are also impossible to call. Direct access with getChildAt (0).root.clipA also throws an error, etc...

    Is it possible to access instances of the MovieClip on the stage of the loaded SWF file of a component that loads? I would appreciate any advice on this issue.

    a.Neko


    Note:
    The goal is to be able to load multiple clips into a component in a single loading of SWF file, then to instantiate the separately if necessary with addChild() and addChildAt() methods.

    Solution found:

    (Checked for loadedSWF.swf published with Adobe Flash Professional 9 Alpha Public)

    script (excerpt from Flex 2.0 AS3 component class)

    protected var clip: MovieClip = new MovieClip();

    protected final void requestSWF(value:String):void {}
    var request: URLRequest = new URLRequest (value);
    var asked: Loader = new Loader();
    requested.contentLoaderInfo.addEventListener (Event.COMPLETE, this.onRequestSWFComplete);
    requested. Load (request);
    return;
    };

    protected final void onRequestSWFComplete(event:Event):void {}
    event.stopPropagation ();
    This.clip = event.target.content.clipA; conversion of a local variable.
    this.addChild (this.clip);
    return;
    };

    this.requestSWF ("loadedSWF.swf");

    Result: clipA is added separately to the display of the component list.

    a.Neko

  • After the transition from XP to Windows 7, the custom-printing size selection box has failed.

    I always was able to use my C5180 Photosmart to print pictures of custom size on my old computer with XP.  After getting a new computer with Windows 7, the custom size box says "the custom paper that you have just set will become unavailable for selection until you have left and returned in the preferences to print/properties." (I did too many times to count!) All except 'Cancel' choices are grayed out.  This feature still works on my old computer, even if the box selection and formulation are different.  I have checked and checked the drivers and we have tried many other solutions.  I have worked in this market for a week or two and see that many other people have similar problems.  I would like to buy a new hp printer, but see that even with the new hp printers people have problems with paper sizes custom, which is very important to me - I print a lot of cards of various sizes, mainly of 6.5 X 10 inches.  Of course, no support is available for this printer "obsolete". (It may be "obsolete", but it works fine with XP). I also can't get any definitive information on this feature in the new hp printers and have noted that some people have problems with this feature on the new printers also.

    Thank you so much Shane R. for your expert advice.

    Can I try your solution in the future, but right now I'm satisfied by another solution, I realized with the help of a thematically response on a Windows 7 forum.

    First of all, I'm pretty positive, I used the correct driver because I downloaded the most recent, verified and recontroler, etc.  And, fortunately, most of the features all-in-one is working well.  Because of this, I hate to try drivers for another model - as I have solve my problem. I could end up with another problem - as no function of scan or something.

    Here is how I was able to get custom formats:

    'Start' to 'control panel' for 'Hardware and Sound' ('View drivers and printers')

    Click on the printer

    Choose "Print server properties" at the top of the screen

    Click 'create a new form.

    Give form a new name, for example 7-10 card and put the name into the box just above

    Complete custom down, for example, print size 7 x 10

    Click 'save form '.

    Click "close".

    The custom name and size is then appeared in the photo program I feel for and I was able to use it.

    Thank you, again. (Where can I provide Bravo?)

  • Plugin container keeps constantly appearing and disappearing in my task manager, causing the major downturn and preventing loading videos. Help?

    When you go to many websites, including N4G.com and Royalroadl.com, my browser will slow down suddenly, and container plugin firefox will Flash quickly on and off tension in my task manager, too fast to turn it off manually.
    The only way to solve this problem, so far, has been to stop the page from loading before a certain point.

    This also prevents many videos loading and the major slowdown. He has only started to happen after I have updated to the latest version of Firefox, and disabling all plug-ins and extensions did not resolve the issue.

    My current version is 40.0.3.
    Someone knows how to easily return to the most recent version without problems?

    Edit: Both, I found the solution!

    I went into the plug-ins for Firefox, went into the menu Options for the Shockwave Flash plug-in and disabled Protected Mode.

    For some stupid reason, Protected Mode was the thing causing videos blocked and slowdown.

    Spread this solution for anyone with similar problems, please!

  • ItemClickEvent with the custom event

    Forget it

    Forget it

  • Calling a function in the main sequence of a loaded swf file

    I know this is probably a very basic question, but I loaded a SWF file in another film. Now, I want to call a function in the main SWF file. Is it possible to do? Otherwise, I have a custom class where I could put the function, but I was not able to understand how to call it from the SWF loaded either. Can I somehow associate the class with the main movie, or...?

    Nevermind - I did something very stupid and was not calling the function as a method of a clip. I was just calling checkTarget (event) and not event.currentTarget.checkTarget (event); that seems to work.

  • referencing the main timeline from a loaded swf file

    I just poked around google as both of these forums, but the only answer I see that was a success, is kglad, and for some reason that its messages are not, I just see ":" and then the guy say thank you! Not uber useful.

    In any case, I'm just trying to understand how to reference an image tag on my main timeline to a swf loaded (through my imageLoader). Does anyone have a link or can tell me what I should look for in? dispatchers of the event?

    to reference the main timeline of the SWF loading from the main timeline of the swf file that is loaded, use:

    MovieClip (this.parent.parent)

  • Back to the original timeline of a loaded SWF file

    I'll have one dressed in real problem to the main timline after loading in a SWF file. I created an empty Clip on the main timeline with the code

    _root.loadMovie ("it.swf");

    It works very well, at the end of the child SWF file, I added the code

    _root.gotoAndPlay ("in");

    I have a flag marked "in" on the main timeline that it should return too, I tried to use _global and _level0 instrad of root and they don't work either.

    Ant ideas? This would make my Christmas

    If you have this code inside means of empty magazine,
    You can specify as this.loadMovie ("it.swf");
    Here, this will refer the empty movieclip...

Maybe you are looking for

  • I cannot connect to my iMac and have keyboard problems.

    I got my Imac since 2009.  Currently, I have the installed El Capitan OS but I still have the original Drive on OS X that comes with it.  I'm the only person who uses it to my account is the only one on this subject.  I have installation log on passw

  • Cannot copy in the browser without using CNTR C

    When I use the copy and paste functionality with my mouse, I get an error messages saying I should use CNTR C since the security feature is not set to allow the direct copy; I want to just copy and paste using the mouse. I can adjust the parameters o

  • PSC 2210, scanning, and Mavericks

    Greetings, I am baffled by a problem with my HP PSC 2210 all-in-one device and the latest system of Mac OS X 10.9 (Mavericks).  I was able to print since the upgrade, but I am not able to scan. I have checked the software updates, reinstalled my prin

  • Genuine Win7 Pro Retail: Differences in the coverage of the hologram between original and SP1 DVD?

    Hello I am looking to buy a full commercial copy of Windows 7 (preferring the opportunity to transfer the license if my machine goes down). A seller advertising online is a genuine commercial version of Win7 Pro; However, the DVD have less coverage o

  • Several sessions the client VPN Cisco PIX (v.7.2)

    When we are connect to the PIX from our local supplier (all sessions have an address using a NAT) all sessions are connected, but first of all runs successfully, others are connected only but for example without routing. Thanks for the help in advanc