found a fix
[Embed(source="mySWF.swf", mimeType="application/octet-stream")]
private var mySWF:Class;
private var loader:Loader;
[class + int away code]
addAwdEmbed();
private function addAwdEmbed():void
{
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.INIT,loadedswf);
loader.loadBytes(new mySWF());
}
private function loadedswf(e:Event):void {
var mc:MovieClip = MovieClip(loader.content);
var amat:AnimatedBitmapMaterial = new AnimatedBitmapMaterial(mc);
amat.play();
var sphere:Sphere = new Sphere({material:amat, segmentsH:10,
segmentsW:10, radius:2500});
this.view.scene.addChild(sphere);
}
hope it helps :)
I will try to see how Ican add a catch in the material and let it do that stuff
automatically
Fabrice
On Apr 30, 2010, at 10:00 PM, savagelook wrote:
> Just to make sure I am understanding you correctly, you are thinking
> that a workaround might be to embed a movieclip within the SWF that
> you plan to embed. Then you would use that embedded movieclip as the
> source of the AnimatedBitmapMaterial, right?
>
> Is this a bug in the way Away3D processes embedded SWFs, or is it a
> limitation of embedded SWFs in general?
>
> On Apr 30, 3:45 pm, Fabrice3D <[email protected]> wrote:
>> Actually yes.
>>
>> I know what the problem is:
>> seams an embedded swf as movieclip does not have the notion of frames, which
>> is required by the material code.
>>
>> traces 0 frames.
>>
>> I still do not have a fix on this one, but was planning add a little
>> workaround in meanwhile.
>> where instead of having on swf as movieclip, where you could have in swf a
>> movieclip on stage with an instance name set.
>> you could then store more mc's in that swf and just pass the instance name
>> to the material...
>>
>> Fabrice
>>
>> On Apr 30, 2010, at 6:25 PM, savagelook wrote:
>>
>>
>>
>>> any word on this one?
>>
>>> On Apr 28, 4:58 pm, savagelook <[email protected]> wrote:
>>>> Sorry for the typos in my last response, the "new" at the beginning of
>>>> the declarations is supposed to be a "var"
>>
>>>> I've also tried the following with no success:
>>
>>>> var mc:MovieClip = new MovieClip();
>>>> mc.addChild(new mySwf());
>>>> var sphere:Sphere = new Sphere({material:new
>>>> AnimatedBitmapMaterial(mc)});
>>
>>>> On Apr 28, 8:55 am, savagelook <[email protected]> wrote:
>>
>>>>> Yes, I am doing the same as Sylvain. The swf I'm loading I am now
>>>>> using as a MovieMaterial and it works fine. I'm trying to increase
>>>>> performance by using an AnimatedBitmapMaterial since I don't need
>>>>> interaction with the swf. Also, I am using Away3d 3.4.
>>
>>>>> // this works fine
>>>>> new sphere:Sphere = new Sphere({material:new MovieMaterial(new
>>>>> mySwf())});
>>
>>>>> // none of these work, I've also tried all combos of init vars as well
>>>>> new sphere:Sphere = new Sphere({material:new
>>>>> AnimatedBitmapMaterial(new mySwf())});
>>
>>>>> new sphere:Sphere = new Sphere({material:new
>>>>> AnimatedBitmapMaterial(new mySwf() as MovieClip)});
>>
>>>>> var abm:AnimatedBitmapMaterial = new AnimatedBitmapMaterial(new
>>>>> mySwf());
>>>>> new sphere:Sphere = new Sphere({material:abm});
>>
>>>>> On Apr 28, 5:56 am, Sylvain Godbert <[email protected]> wrote:
>>
>>>>>> Hi Fabrice,
>>
>>>>>> If I change
>>
>>>>>> var animatedBitmapMaterial:AnimatedBitmapMaterial = new
>>>>>> AnimatedBitmapMaterial(new _TextureAnim(),{autoplay:true,
>>>>>> loop:false});
>>
>>>>>> by
>>
>>>>>> var movieMaterial:MovieMaterial= new MovieMaterial(new _TextureAnim(),
>>>>>> {smooth:true, precision:5});
>>
>>>>>> that works just fine .Therefore, I think there is no problem with the
>>>>>> anim I am loading
>>
>>>>>> Sylvain
>>
>>>>>> On 28 avr, 09:58, Fabrice3D <[email protected]> wrote:
>>
>>>>>>> I'm gonna look at it asap.
>>>>>>> finishing a 3.4 project where I use it extensively with zero problems,
>>>>>>> so issue should be small in 3.5 since there are no major changes made
>>>>>>> in there.
>>
>>>>>>> can you in meanwhile make sure that the swf is not holding any code
>>>>>>> that would prevent a frame to frame parsing.
>>>>>>> or make sure its not an embed issue?
>>>>>>> try addChild the mc to see if it works properly.
>>
>>>>>>> if it does show up and plays normally, try see if bits of delay fixes
>>>>>>> the issue...
>>
>>>>>>> Fabrice
>>
>>>>>>> On Apr 28, 2010, at 1:14 AM, savagelook wrote:
>>
>>>>>>>> same problem here, how do we fix this?
>>
>>>>>>>> On Apr 27, 1:19 pm, Sylvain Godbert <[email protected]> wrote:
>>>>>>>>> Hi,
>>
>>>>>>>>> I am trying to get the AnimatedBitmapMaterial material working but I
>>>>>>>>> am facing some issues. Here is my code :
>>
>>>>>>>>> [Embed(source="/assets/anim.swf")] private var _TextureAnim:Class;
>>
>>>>>>>>> private function ExempleAnimatedBitmapMaterial():void
>>>>>>>>> {
>>>>>>>>> _Scene = new Scene3D();
>>
>>>>>>>>> _Camera3D = new Camera3D();
>>>>>>>>> _Camera3D.zoom=2;
>>>>>>>>> _Camera3D.z = 1000;
>>>>>>>>> _Camera3D.focus=2000;
>>>>>>>>> _Camera3D.lookAt( new Number3D(0, 0, 0) );
>>
>>>>>>>>> _View = new View3D({x: stage.stageWidth*.5, y : stage.stageHeight*.
>>>>>>>>> 5});
>>>>>>>>> _View.scene = _Scene;
>>>>>>>>> _View.camera = _Camera3D;
>>>>>>>>> addChild(_View);
>>
>>>>>>>>> var animatedBitmapMaterial:AnimatedBitmapMaterial= new
>>>>>>>>> AnimatedBitmapMaterial(new _TextureAnim(),{autoplay:true,
>>>>>>>>> loop:false});
>>
>>>>>>>>> var plane:Plane = new Plane();
>>>>>>>>> plane.pitch(90);
>>>>>>>>> plane.material = animatedBitmapMaterial;
>>
>>>>>>>>> _View.scene.addChild(plane);
>>
>>>>>>>>> }
>>
>>>>>>>>> ...
>>
>>>>>>>>> private function onEnterFrame(event:Event):void
>>>>>>>>> {
>>>>>>>>> _View.render();
>>
>>>>>>>>> }
>>
>>>>>>>>> Problem is that _View.render() brings up a pop up with an error
>>>>>>>>> message saying that a null reference is being used. Am I using it in
>>>>>>>>> a wrong way ?
>>
>>>>>>>>> Sylvain
>>
>>>>>>>>> --
>>>>>>>>> Subscription
>>>>>>>>> settings:http://groups.google.com/group/away3d-dev/subscribe?hl=en