[Papervision3D] Help! Having trouble with InteractiveBitmapFileMaterial. Bug?

Papalias Kwnstantinos p_kwnstantinos at yahoo.gr
Wed Sep 12 11:41:41 PDT 2007


Hi,

from the error : Desktop/checkLoaded(). Expected 0, got 1.
You understand that the function checkLoaded expects 0 arguments and got 1 which is the FileLoadEvent!
if you see at first you have a function createContent(e:FileLoadEvent):void, so you should also have 
function checkLoaded(e:FileLoadEvent):void  in the second class.

K.

----- Original Message ----
From: Noah Aronsson-Brown <noah at rdai.com>
To: papervision3D at osflash.org
Sent: Wednesday, September 12, 2007 9:12:46 PM
Subject: [Papervision3D] Help! Having trouble with InteractiveBitmapFileMaterial. Bug?


So i'm making a viewer based on the Papercloud example only i'm dynamically
loading jpgs with InteractiveBitmapFileMaterial instead of using
InteractiveMovieAssetMaterial.

Everything works fine except the first jpg out of 12 doesn't show up and has
a Magenta (error color?) wireframe instead of white. It does show up as
loaded in my output window however, and traces as a valid DO3D. here is the
relevant code.

        public function loadContent():void 
        {
            num++;            
            xPoint += xOrder;
            material = new InteractiveBitmapFileMaterial( "Content");
            material.addEventListener(FileLoadEvent.LOAD_COMPLETE, createContent);
            material.texture = "contents/content"+num+".jpg";
        }
                
        public function createContent(e:FileLoadEvent):void
        {
            material.doubleSided = true;
            material.lineColor = 0xFFFFFF;
            //material.updateBitmap();
            
            var plane :Plane = new Plane( material, contentWidth, contentHeight, 2, 2
);
        ...etc...

So I try and figure out what's going on by adding an explicit
material.loaded check in between the loadContent() and the createContent.
like this:

        public function loadContent():void 
        {
            num++;            
            xPoint += xOrder;
            material = new InteractiveBitmapFileMaterial( "Content");
            material.addEventListener(FileLoadEvent.LOAD_COMPLETE, checkLoaded);
            material.texture = "contents/content"+num+".jpg";
        }
        
        public function checkLoaded():void
        {
            if (material.loaded)
            {
                trace(material.name+" has loaded.");
                createContent();
            }
        }
        
        public function createContent():void
        {
            material.doubleSided = true;
            material.lineColor = 0xFFFFFF;
            //material.updateBitmap();
            
            var plane :Plane = new Plane( material, contentWidth, contentHeight, 2, 2
);
        ...etc...

Now the compiler throws a big error:

Papervision3D Beta 1.7 (20.08.07)

DisplayObject3D: null
DisplayObject3D: null
DisplayObject3D: null
DisplayObject3D: null
BitmapFileMaterial: Loading bitmap from Content
BitmapFileMaterial: Loading bitmap from contents/content1.jpg
ArgumentError: Error #1063: Argument count mismatch on
Desktop/checkLoaded(). Expected 0, got 1.
    at
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at org.papervision3d.materials::BitmapFileMaterial/::loadComplete()
    at
org.papervision3d.materials::BitmapFileMaterial/::loadBitmapCompleteHandler()

Can anyone tell me what's going on? Am I doing something wrong here, or
could there be a bug in the 
BitmapFileMaterial class?

Thanks in advance!

.n
-- 
View this message in context: http://www.nabble.com/Help%21-Having-trouble-with-InteractiveBitmapFileMaterial.-Bug--tf4431201.html#a12641312
Sent from the Papervision3D mailing list archive at Nabble.com.


_______________________________________________
Papervision3D mailing list
Papervision3D at osflash.org
http://osflash.org/mailman/listinfo/papervision3d_osflash.org







      
___________________________________________________________ 
Χρησιμοποιείτε Yahoo!; 
Βαρεθήκατε τα ενοχλητικά μηνύματα (spam); Το Yahoo! Mail 
διαθέτει την καλύτερη δυνατή προστασία κατά των ενοχλητικών 
μηνυμάτων http://login.yahoo.com/config/mail?.intl=gr 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/papervision3d_osflash.org/attachments/20070912/31449c16/attachment.html 


More information about the Papervision3D mailing list