[Papervision3D] MovieClip image loader on a plane...
Ohm
qkate at free.fr
Wed Aug 6 02:56:51 PDT 2008
Hi,
I had some problems too, with Loader() and URLRequest(), so instead of that
I did use a UILoader() in the MovieClip...
mc = new MovieClip();
_uiloader = new UILoader();
_uiloader.source = "myURLs";
_uiloader.name = String( i );
mc.addChild( _uiloader );
myArray.push( mc );
Hope it'll help
David Di Biase-3 wrote:
>
> Hi there,
>
> This is a rather simple question but I just can't seem to crack it! I'm
> creating a MovieClip with a background rounded rectangle background. Last
> time I attempted this I remembered tht I should only show the poster once
> the image has loaded, or else I'd have to update the planes material. I'm
> doing that now and the poster appears properly but the loader for some
> reason isn't showing. Here's the code:
>
> for (i = 0; i < posters.length; i++) {
> var posterMc:MovieClip = new MovieClip();
> posterMc.name = "poster" + i;
> // Add the shadow layer
> posterMc.graphics.beginFill(0x2A2A2A);
> posterMc.graphics.drawRoundRect(5, 5, 290, 350, 15,
> 15);
> posterMc.graphics.endFill();
> // Add the upper layer
> posterMc.graphics.beginFill(0x232323);
> posterMc.graphics.drawRoundRect(0, 0, 285, 345, 15,
> 15);
> posterMc.graphics.endFill();
> var ldr:Loader = new Loader();
> var imageRequest:URLRequest = new URLRequest("posters/" +
> posters[i]);
> ldr.height = 340;
> ldr.width = 280;
> ldr.load(imageRequest);
> ldr.contentLoaderInfo.addEventListener(Event.COMPLETE,
> posterLoadingWrap(i));
> posterMc.addChild(ldr);
> posterArray.push({ref: null, mcRef: posterMc});
> }
>
> function posterLoadingWrap(i) {
> return function(e:Event):void { createPoster(i); }
> }
>
> function createPoster(i) {
> var posterMm:MovieMaterial = new
> MovieMaterial(posterArray[i].mcRef, true);
> posterMm.oneSide = false;
> posterMm.smooth = true;
> var poster:Plane = new Plane(posterMm, 290, 350, 1, 1);
> poster.x += ((292 * count) + 10) - offsetX;
> poster.y -= ((353 * rows) - 100) - offsetX;
> trace(i + " [x: " + ((292 * count) + 10) + ", y: " +
> ((353 * rows) - 100) + ", count: " + count + ", rows: " + rows + "]");
> scene.addChild(poster);
> if (count > 3) { count = 1; rows++; } else { count++; }
> if (rows > 2) { rows = 1; }
> }
>
> I'm not sure if it's just me doing something incorrectly in the code,
> which
> I've looked over at least a million times!
>
> :-) Thanks!
>
> Dave
>
> _______________________________________________
> Papervision3D mailing list
> Papervision3D at osflash.org
> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>
>
--
View this message in context: http://www.nabble.com/MovieClip-image-loader-on-a-plane...-tp18794149p18847851.html
Sent from the Papervision3D mailing list archive at Nabble.com.
More information about the Papervision3D
mailing list