away3d / away3d-core-fp11

Away3D engine for Flash Player 11
http://www.away3d.com
Other
640 stars 273 forks source link

VideoTexture () causes crash when called #663

Open SethMorgan opened 10 years ago

SethMorgan commented 10 years ago

Using the latest swc as well as the source code for causes the following error when new is called on a VideoTexture:

Error #1034: Type Coercion failed: cannot convert to away3d.materials.utils.IVideoPlayer.

The offending code appears to be the following line

_player = player || new SimpleVideoPlayer();

as changing this line to

_player = (player) ? player : new SimpleVideoPlayer();

causes the error to go away.

Not sure if this makes any difference but this is being compiled on my end using flashDevelop.

gonchar commented 10 years ago

it seems like you pass a wrong object to the VideoTexture constructor. btw, if it solves the problem, which compiler do you use, ASC2.0? as I remember, it had problems with such ternary operation.