[Papervision3D] What am I doing wrong?
Pelle Christensen
pelle.christensen at gmail.com
Thu Jan 11 04:23:47 EST 2007
New compile error, when using the:
[Embed(source="world.png")]
public var WorldTexture:Class;
(And using new WorldTexture for the BitmapAssetMaterial)
Is there any special constarints for the image I'm using?
ReferenceError: Error #1065: Variable Main_WorldTexture0 is not defined.
at global/flash.utils::getDefinitionByName()
at
org.papervision3d.materials::BitmapAssetMaterial/org.papervision3d.materials:BitmapAssetMaterial::createBitmap
()
at org.papervision3d.materials::BitmapMaterial/set texture()
at org.papervision3d.materials::BitmapMaterial$iinit()
at org.papervision3d.materials::BitmapAssetMaterial$iinit()
at Main/::init3D()
at Main$iinit()
I've checked my compile settings, and I'm using Mxmlc.exe
On 1/11/07, Carlos Ulloa <c4rl054321 at gmail.com> wrote:
>
> I use FlashDevelop and compile in the Flash IDE.
>
> C4RL05
> // noventaynueve.com
> // papervision3d.org
>
>
> On 10/01/07, John Grden <neoriley at gmail.com> wrote:
> >
> > I use FlashDevelop with mxmlc.exe compiler
> >
> > On 1/10/07, Pelle Christensen < pelle.christensen at gmail.com > wrote:
> > >
> > > Okey, now it makes more sense. Think I'll study the documentation a
> > > bit deeper them. Thanks :)
> > >
> > > Btw: which software/setup do you use to be able to use .fla files ?
> > >
> > > /Pelle
> > >
> > > On 1/10/07, John Grden <neoriley at gmail.com> wrote:
> > > >
> > > > ah, see, that helps!
> > > >
> > > > ok, If you look at the notes in BitmapAssetMaterial, they describe
> > > > that it's used with a swf that's been published with the FLash IDE and has a
> > > > bitmap in the library with a linkageID. You pass the linkageID and
> > > > BitmapAssetMaterial does the rest.
> > > >
> > > > However, if you're trying to load a bitmap externally at runtime in
> > > > AS3, that's done this way:
> > > >
> > > > import flash.display.Loader;
> > > > import flash.utils.URLRequest;
> > > > import flash.events.Event;
> > > > import org.papervision3d.materials.BitmapMaterial;
> > > >
> > > > private function loadBitmap(file:String):void
> > > > {
> > > > var request:URLRequest = new URLRequest(file);
> > > > var bitmap:Loader = new Loader();
> > > >
> > > > bitmap.contentLoaderInfo.addEventListener (Event.COMPLETE,
> > > > loadBitmapCompleteHandler);
> > > > try {
> > > > bitmap.load(request);
> > > > } catch (error:Error) {
> > > > //log.error("Unable to load URL", error);
> > > > }
> > > > }
> > > >
> > > > private function loadBitmapCompleteHandler(e:Event):void
> > > > {
> > > > var loader:Loader = Loader(e.target.loader);
> > > > var bitmap:Bitmap = Bitmap(loader.content);
> > > >
> > > > bitmapMaterial = new BitmapMaterial(bitmap.bitmapData,
> > > > {lineColor:0x00ff00, lineAlpha:0, fillColor:0x000000, fillAlpha:0});
> > > > bitmapMaterial.oneSide = true;
> > > > }
> > > >
> > > > I took this out of a current demo, so I haven't tested that all the
> > > > imports are there etc, but you get the right idea ;)
> > > >
> > > > On 1/10/07, Pelle Christensen <pelle.christensen at gmail.com> wrote:
> > > > >
> > > > > The Main.as from HelloAse has been changed in one place Line 61
> > > > >
> > > > > //var material :BitmapAssetMaterial = new BitmapAssetMaterial(
> > > > > "Bitmap" );
> > > > > var material :BitmapAssetMaterial = new
> > > > > BitmapAssetMaterial(" world.png");
> > > > > //var material :BitmapAssetMaterial = new
> > > > > BitmapAssetMaterial("c:/world.png");
> > > > >
> > > > > I've tried both relative and absolute paths, but still get the
> > > > > same error.
> > > > >
> > > > > I suscpect that, my understanding of how to handle the example
> > > > > files is somewhat faulty, and building projects in FlashDevelop is also new
> > > > > to me.
> > > > >
> > > > > /Pelle
> > > > >
> > > > > 'scene' will be scoped to the default namespace; Main internal. It
> > > > > will not be visible outside of this package.
> > > > >
> > > > > On 1/10/07, John Grden <neoriley at gmail.com> wrote:
> > > > > >
> > > > > > can you post the code for us to see?
> > > > > >
> > > > > > On 1/10/07, Pelle Christensen < pelle.christensen at gmail.com>
> > > > > > wrote:
> > > > > >
> > > > > > > Hi
> > > > > > >
> > > > > > > My name is Pelle, and I've been on the mailinglist for about a
> > > > > > > week.
> > > > > > >
> > > > > > > I have picked up the files from the repository and have tried
> > > > > > > to build the examples, but i get the following error (HelloAse example)
> > > > > > >
> > > > > > > ReferenceError: Error #1065: Variable png is not defined.
> > > > > > > at global/flash.utils::getDefinitionByName()
> > > > > > > at
> > > > > > > org.papervision3d.materials::BitmapAssetMaterial/org.papervision3d.materials:BitmapAssetMaterial::createBitmap()
> > > > > > > at org.papervision3d.materials::BitmapMaterial/settexture()
> > > > > > > at org.papervision3d.materials::BitmapMaterial$iinit()
> > > > > > > at org.papervision3d.materials::BitmapAssetMaterial$iinit
> > > > > > > ()
> > > > > > > at Main/::init3D()
> > > > > > > at Main$iinit()
> > > > > > >
> > > > > > > I've tried to put the image in the same folder, and even
> > > > > > > supplied an absolute path, but it dosen't help.
> > > > > > >
> > > > > > > Ps: Using flashdevelop with a setup for AS3
> > > > > > >
> > > > > > > Can anybody help?
> > > > > > >
> > > > > > > --
> > > > > > > Med venlig hilsen / Best regards
> > > > > > > Pelle Klit Christensen
> > > > > > >
> > > > > > > Phone (+045) 26 88 11 89
> > > > > > > www.gamecraft.dk
> > > > > > > _______________________________________________
> > > > > > > Papervision3D mailing list
> > > > > > > Papervision3D at osflash.org
> > > > > > > http://osflash.org/mailman/listinfo/papervision3d_osflash.org
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > [ JPG ]
> > > > > > _______________________________________________
> > > > > > Papervision3D mailing list
> > > > > > Papervision3D at osflash.org
> > > > > > http://osflash.org/mailman/listinfo/papervision3d_osflash.org
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Med venlig hilsen / Best regards
> > > > > Pelle Klit Christensen
> > > > >
> > > > > Phone (+045) 26 88 11 89
> > > > > www.gamecraft.dk
> > > > >
> > > > > _______________________________________________
> > > > > Papervision3D mailing list
> > > > > Papervision3D at osflash.org
> > > > > http://osflash.org/mailman/listinfo/papervision3d_osflash.org
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > [ JPG ]
> > > >
> > > > _______________________________________________
> > > > Papervision3D mailing list
> > > > Papervision3D at osflash.org
> > > > http://osflash.org/mailman/listinfo/papervision3d_osflash.org
> > > >
> > > >
> > > >
> > >
> > >
> > > --
> > > Med venlig hilsen / Best regards
> > > Pelle Klit Christensen
> > >
> > > Phone (+045) 26 88 11 89
> > > www.gamecraft.dk
> > >
> > > _______________________________________________
> > > Papervision3D mailing list
> > > Papervision3D at osflash.org
> > > http://osflash.org/mailman/listinfo/papervision3d_osflash.org
> > >
> > >
> > >
> >
> >
> > --
> > [ JPG ]
> >
> > _______________________________________________
> > Papervision3D mailing list
> > Papervision3D at osflash.org
> > http://osflash.org/mailman/listinfo/papervision3d_osflash.org
> >
> >
> >
>
> _______________________________________________
> Papervision3D mailing list
> Papervision3D at osflash.org
> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>
>
>
--
Med venlig hilsen / Best regards
Pelle Klit Christensen
Phone (+045) 26 88 11 89
www.gamecraft.dk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/papervision3d_osflash.org/attachments/20070111/4189f755/attachment-0001.htm
More information about the Papervision3D
mailing list