VideoMaterial + Away3D 4.1 = :-(

Software: Away3D 4.x

Lucid, Member
Posted: 24 November 2012 05:10 PM   Total Posts: 93

Adding this single line:
var vt:VideoTexture = new VideoTexture(‘2048.mov’,2048,1024,true,true)
causes the following issues in Away3D 4.1:

TypeError: Error #1034: Type Coercion failed: cannot convert to away3d.materials.utils.IVideoPlayer.
at away3d.textures::VideoTexture()[/Users/robbateman/Documents/Adobe Flash Builder 4.7/away3d-core-fp11/src/away3d/textures/VideoTexture.as:34]
at portal/init3D()[/Users/villmer/Documents/Adobe Flash Builder 4.7/portal/src/portal.mxml:47]
at portal/init()[/Users/villmer/Documents/Adobe Flash Builder 4.7/portal/src/portal.mxml:34]
at portal/___portal_Application1_applicationComplete()[/Users/villmer/Documents/Adobe Flash Builder 4.7/portal/src/portal.mxml:7]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()[E:dev4.yframeworksprojectsframeworksrcmxcoreUIComponent.as:13152]
at mx.managers::SystemManager/preloader_preloaderDoneHandler()[E:dev4.yframeworksprojectsframeworksrcmxmanagersSystemManager.as:2676]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.preloaders::Preloader/displayClassCompleteHandler()[E:dev4.yframeworksprojectsframeworksrcmxpreloadersPreloader.as:582]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.preloaders::SparkDownloadProgressBar/initCompleteHandler()[E:dev4.yframeworksprojectsframeworksrcmxpreloadersSparkDownloadProgressBar.as:1087]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.preloaders::Preloader/dispatchAppEndEvent()[E:dev4.yframeworksprojectsframeworksrcmxpreloadersPreloader.as:380]
at mx.preloaders::Preloader/appCreationCompleteHandler()[E:dev4.yframeworksprojectsframeworksrcmxpreloadersPreloader.as:590]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()[E:dev4.yframeworksprojectsframeworksrcmxcoreUIComponent.as:13152]
at mx.core::UIComponent/set initialized()[E:dev4.yframeworksprojectsframeworksrcmxcoreUIComponent.as:1818]
at mx.managers::LayoutManager/doPhasedInstantiation()[E:dev4.yframeworksprojectsframeworksrcmxmanagersLayoutManager.as:842]
at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:dev4.yframeworksprojectsframeworksrcmxmanagersLayoutManager.as:1180]

   

Ben, Newbie
Posted: 23 January 2013 04:48 PM   Total Posts: 5   [ # 1 ]

Hi there!
I have the same problem… Is there a workaround for this? Or some guidelines to write a new version of the VideoTexture?
Thank you!

   

Avatar
GoroMatsumoto, Sr. Member
Posted: 03 February 2013 11:38 AM   Total Posts: 166   [ # 2 ]

I run into same.
My workaround is below.

yourClass.as

var _player:SimpleVideoPlayer = new SimpleVideoPlayer();
var 
_videoTexture:VideoTexture = new VideoTexturevideoFile512512falsefalse_player ); 

and modify:
VideoTexture.as (line34)

_player player;// || new SimpleVideoPlayer(); 

Maybe there will not be problem until next beta ver.
cheers.

   

julespong, Member
Posted: 27 February 2013 01:59 AM   Total Posts: 53   [ # 3 ]

nevermind.

   

Lexcuk, Newbie
Posted: 28 February 2013 08:01 AM   Total Posts: 17   [ # 4 ]

videomaterial away3d-core-fp11_4_1_0_Alpha.swc

//http://swf-flash.blogspot.com/2013/01/videomaterial-away3d-41.html

         
material = new TextureMaterial(bitmapTexture = new BitmapTexture(new BitmapData(512512true0xFFFF0000)), falsetrue);
         
planeMesh.material material;
         
addEventListener(Event.ENTER_FRAMEenterFrameHandler);
      
}


      
private function enterFrameHandler(e:Event):void {
         
//
         
var bitmapData:BitmapData bitmapTexture.bitmapData;
         
bitmapData.lock();
         
bitmapData.fillRect(bitmapData.rect0);
         
//bitmapData.draw(_video, _matrix, null, null, bitmapData.rect, _smoothing);
         
bitmapData.draw(simpleVideoPlayer.container);
         
bitmapData.unlock();
         
bitmapTexture.invalidateContent();
         
         
         
view.render();
      
   
   
‹‹ LineSegment update

X

Away3D Forum

Member Login

Username

Password

Remember_me



X