A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Coercion Failed Errors Passing Third Party Data Types Swf to Swf

  1. #1
    Junior Member
    Join Date
    Oct 2014
    Posts
    1

    Question Coercion Failed Errors Passing Third Party Data Types Swf to Swf

    I am making a game where each screen is loaded in as a separate swf. I am loading the swf using Greensock's LoaderMax, but I don't think that is what is causing the issue. After I load in the swf I can set properties of the child swf like String and MovieClip. However, I have a third party library in the library path, the same exact swc for both projects. However, when I try to pass non-system variables it gives an error basically saying "Coercion failed: cannot convert ThisType to ThisType". If they are the same data type, why is the compiler trying to coerce them? I must be missing something here...

    The Error:
    Code:
    TypeError: Error #1034: Type Coercion failed: cannot convert package::ThisType@7ffecfe4ba1 to package.ThisType.
    at mJackStateMachine/onAskForClient()
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    Here is the (simplified) complete handler. It breaks when I try to pass the var a_thisTypeVar of type ThisType between swfs:

    Code:
    function CompleteHandler(e:LoaderEvent) {
    childSwf = LoaderMax.getContent("LoginStateSwf").rawContent;
    stage.addChild(childSwf);
    childSwf.start(_thisTypeVar)
    }
    Please help! How to I pass vars from third party libraries between swfs. I should be able to do this, right?

  2. #2
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    Maybe attach your *.fla

    or at least allow debugging to find which line number is throwing the error

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center