</mx:Application>
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
width="800" height="600"
applicationComplete="onApplicationComplete()">
<!--xmlns:camera="components.*">-->
<mx:Script>
<![CDATA[
import com.transmote.flar.FLARManager;
import com.transmote.flar.marker.FLARMarker;
import com.transmote.flar.marker.FLARMarkerEvent;
import com.transmote.flar.utils.geom.FLARPVGeomUtils;
import flash.display.Sprite;
import flash.events.Event;
import org.libspark.flartoolkit.support.pv3d.FLARCamera3D;
import org.papervision3d.lights.PointLight3D;
import org.papervision3d.objects.DisplayObject3D;
import org.papervision3d.objects.parsers.DAE;
import org.papervision3d.render.LazyRenderEngine;
import org.papervision3d.scenes.Scene3D;
import org.papervision3d.view.Viewport3D;
[SWF(width='640', height='480', backgroundColor='#000000',
frameRate='40')]
private var flarManager:FLARManager;
private var scene3D:Scene3D;
private var camera3D:FLARCamera3D;
private var viewport3D:Viewport3D;
private var renderEngine:LazyRenderEngine;
private var pointLight3D:PointLight3D;
private var activeMarker:FLARMarker;
private var modelContainer:DisplayObject3D;
import org.papervision3d.view.stats.StatsView;
private function onApplicationComplete():void
{
// pass the path to the FLARManager xml config file into the
FLARManager constructor.
// FLARManager creates and uses a FLARCameraSource by default.
// the image from the first detected camera will be used for marker
detection.
this.flarManager = new FLARManager("flarConfig.xml");
this.scene3D = new Scene3D();
this.camera3D.z = 100;
this.modelContainer = new DisplayObject3D();
}
this.activeMarker = evt.marker;
}
trace("["+evt.marker.patternId+"] updated");
switch(evt.marker.patternId)
{
}
this.activeMarker = evt.marker;
}
}
this.activeMarker = null;
}
this.renderEngine.render();
}
]]>
</mx:Script>
</mx:Application>
> ...
>
> read more »
TypeError: Error #1034: Type Coercion failed: cannot convert
com.transmote.flar.source::FLARCameraSource@1cd30d79 to
mx.core.IUIComponent.
at mx.core::Container/http://www.adobe.com/2006/flex/mx/
internal::addingChild()[C:\autobuild\galaga\frameworks\projects
\framework\src\mx\core\Container.as:3302]
at mx.core::Container/addChildAt()[C:\autobuild\galaga\frameworks
\projects\framework\src\mx\core\Container.as:2250]
at mx.core::Container/addChild()[C:\autobuild\galaga\frameworks
\projects\framework\src\mx\core\Container.as:2183]
at FlashCard_Dev/onApplicationComplete()[/Users/juliekilby/Documents/
Flex Builder 3/FlashCard_Dev/src/FlashCard_Dev.mxml:50]
at FlashCard_Dev/___FlashCard_Dev_Application1_applicationComplete()[/
Users/juliekilby/Documents/Flex Builder 3/FlashCard_Dev/src/
FlashCard_Dev.mxml:4]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()[C:\autobuild\galaga\frameworks
\projects\framework\src\mx\core\UIComponent.as:9408]
at mx.managers::SystemManager/preloader_preloaderDoneHandler()[C:
\autobuild\galaga\frameworks\projects\framework\src\mx\managers
\SystemManager.as:3136]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.preloaders::Preloader/displayClassCompleteHandler()[C:\autobuild
\galaga\frameworks\projects\framework\src\mx\preloaders\Preloader.as:
435]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.preloaders::DownloadProgressBar/timerHandler()[C:\autobuild
\galaga\frameworks\projects\framework\src\mx\preloaders
\DownloadProgressBar.as:1451]
at mx.preloaders::DownloadProgressBar/initCompleteHandler()[C:
\autobuild\galaga\frameworks\projects\framework\src\mx\preloaders
\DownloadProgressBar.as:1503]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.preloaders::Preloader/dispatchAppEndEvent()[C:\autobuild\galaga
\frameworks\projects\framework\src\mx\preloaders\Preloader.as:291]
at mx.preloaders::Preloader/appCreationCompleteHandler()[C:\autobuild
\galaga\frameworks\projects\framework\src\mx\preloaders\Preloader.as:
443]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()[C:\autobuild\galaga\frameworks
\projects\framework\src\mx\core\UIComponent.as:9408]
at mx.core::UIComponent/set initialized()[C:\autobuild\galaga
\frameworks\projects\framework\src\mx\core\UIComponent.as:1169]
at mx.managers::LayoutManager/doPhasedInstantiation()[C:\autobuild
\galaga\frameworks\projects\framework\src\mx\managers\LayoutManager.as:
718]
at Function/http://adobe.com/AS3/2006/builtin::apply()
at mx.core::UIComponent/callLaterDispatcher2()[C:\autobuild\galaga
\frameworks\projects\framework\src\mx\core\UIComponent.as:8733]
at mx.core::UIComponent/callLaterDispatcher()[C:\autobuild\galaga
\frameworks\projects\framework\src\mx\core\UIComponent.as:8673]
at this line of code - this.addChild(Sprite
(this.flarManager.flarSource));
when i use the code in an AS file in separate project i have this line
it, and removed it when i put it in the MXML file, could this be part
of the problem and if so how can i fix.
public class flashmarkers extends Sprite
> ...
>
> read more »
> ...
>
> read more »
Do you know how i can control where the camera is located on the page,
or can i have it inserted into a panel control and then have more
control over the location?
Thanks for the help
> ...
>
> read more »- Hide quoted text -
>
> - Show quoted text -