The Miner as a swc in an Air application

91 views
Skip to first unread message

Murray Furtado

unread,
Nov 12, 2012, 5:25:15 AM11/12/12
to soci...@googlegroups.com
Hi I'm trying to embed the Miner in an air app. However if I copy the code from your turorial I get a runtime error:

Error: addChild() is not available in this class. Instead, use addElement() or modify the skin, if you have one.
    at spark.components.supportClasses::SkinnableComponent/addChild()[E:\dev\4.5.1\frameworks\projects\spark\src\spark\components\supportClasses\SkinnableComponent.as:1123]

If I then refactor this to use  this.addElement(IVisualElement(new TheMiner())); I get the following error:

[trace] TheMiner : Starting TheMiner 1.4.01
[Fault] exception, information=TypeError: Error #1034: Type Coercion failed: cannot convert com.sociodox.theminer::TheMiner@223c881 to mx.core.IVisualElement.
at IndigoAir/OnAddedToStage()[C:\LGIM\Development\Flex Development\indigo\indigo-air\src\IndigoAir.mxml:68]

Is there any way to resolve this in an Air app, or do I have to use the preloadSWF approach?
Reply all
Reply to author
Forward
0 new messages