[Papervision3D] Papervision Text
Tara Fenton
tfenton at marvel.com
Tue Feb 12 09:02:50 PST 2008
Duh,
I found the problem that had nothing to do with what ever I thought it was.
I had
stage.showDefaultContextMenu = false;
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.displayState = "fullScreen";
once I commented that out the images showed up :)
I will definitely use claudio's suggestions, Thank You!
although I had things set up working already. I should have know it was
something to do with the browser.
Tara Fenton wrote:
>
> If I put var mm:BitmapFileMaterial inside the function loadImage() then my
> test if (mm.loaded) will not execute. My images need to be relative, but I
> am testing absolute paths just to get it working
>
> tmyers wrote:
>>
>> Hi
>>
>> Firstly try declaring var mm:BitmapFileMaterial inside the function
>> loadImage()
>>
>> Not sure if this solves your problem... are your image paths absolute or
>> relative in xml file is the folder structure the same as local.
>>
>>
>>
>>
>>
>>
>>
>> Tara Fenton wrote:
>>>
>>> Hello there again
>>>
>>> I'm so stuck and it is driving me nuts, I'm about 10 pages into reading
>>> all of the posts with the keyword load in it, so I finally came across
>>> my post again..
>>>
>>> Here my problem:
>>>
>>> I'm loading images from an XML file. It works locally, but if I upload
>>> it to the server, the images never appear. The xml loads, I have it
>>> print out to the page and the images are there, because I copy and paste
>>> the output from the page in the browser in a new window and the image
>>> appears. I'm looping through the XML and it is waiting for the load to
>>> complete, etc.
>>>
>>> I've tried
>>> BitmapFileMaterial and BitmapAssetMaterial
>>>
>>> Both work when testing in flash, but nothing on the server.
>>>
>>> Here's some of the code I'm working on....
>>> Where am I going wrong?
>>>
>>> Thanks
>>> Tara
>>>
>>>
>>> var mm:BitmapFileMaterial;
>>> ////////////////////////////////////////////////////////////////////////////////////
>>> //LOAD THE IMAGES AND BUILD THE CAROUSEL
>>> ////////////////////////////////////////////////////////////////////////////////////
>>> function loadImage():void {
>>>
>>> amountInArray = currentAmount;
>>> radius = amountInArray * 80;
>>> anglePer = (Math.PI*2) / amountInArray;
>>> angleX = anglePer;
>>> myRender = amountInArray * 100;
>>>
>>>
>>> mm = new BitmapFileMaterial(currentList [currentImage] [0]);
>>> mm.oneSide = false;
>>>
>>> var p:Plane = new Plane(mm, currentList[currentImage][3]/2,
>>> currentList[currentImage][2]/2);
>>> p.x = Math.cos(currentImage*anglePer) * radius;
>>> p.z = Math.sin(currentImage*anglePer) * radius;
>>> p.rotationY = (-currentImage*anglePer) * (180/Math.PI) + 270;
>>> p.name = "planeName"+currentImage;
>>>
>>> scene.addChild(p);
>>> p.container.filters = [dsf];
>>>
>>> this.addEventListener(Event.ENTER_FRAME, testLoaded);
>>>
>>>
>>> }
>>>
>>> function testLoaded(event:Event) {
>>> trace("testing in effect");
>>> if (mm.loaded) {
>>> trace("hi im loaded");
>>> onImageLoaded();
>>>
>>> }
>>> }
>>>
>>>
>>>
>>>
>>> Tara Fenton wrote:
>>>>
>>>> This code worked well. Thanks!
>>>>
>>>> Any chance you know how to remove movieMaterial? I've been stuck on
>>>> this for a few days now.
>>>>
>>>> Thanks
>>>> Tara
>>>>
>>>> tmyers wrote:
>>>>>
>>>>> Perhaps the code is executing before the image has a chance to load
>>>>> and thats why the moviematerial cannot find the bitmap. I would use a
>>>>> listener in this case, and load the images sequentially as follows...
>>>>>
>>>>> var total_images = 10
>>>>> var curentImage = 0
>>>>>
>>>>> constructor {
>>>>> loadImage();
>>>>> }
>>>>>
>>>>> function loadImage():void {
>>>>> var imageLoader:Loader = new Loader();
>>>>> imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,
>>>>> onImageLoaded);
>>>>> imageLoader.load(new URLRequest(horizontalList [curentImage] [0] ) );
>>>>> }
>>>>>
>>>>> function onImageLoaded(event:Event):void {
>>>>> var imgHolder_mc:MovieClip = new MovieClip;
>>>>> var loader:Loader = Loader(event.target.loader);
>>>>> imgHolder_mc.addChild(loader.content);
>>>>>
>>>>> // add textfield here
>>>>>
>>>>> var mm:MovieMaterial = new MovieMaterial(imgHolder_mc);
>>>>> var plane:Plane = new Plane(mm,_width,_height, 2, 2);
>>>>> ...
>>>>> ...
>>>>>
>>>>> if (currentImage++ <= total_images - 1){
>>>>> loadImage();
>>>>> } else {
>>>>> // all images have loaded so render output
>>>>> }
>>>>> }
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Tara Fenton wrote:
>>>>>>
>>>>>> var imageLoader:Loader;
>>>>>> var imgHolder_mc:MovieClip;
>>>>>>
>>>>>> for (var i:uint=0; i<=horCount-1; i++) {
>>>>>> imageLoader = new Loader();
>>>>>> imageLoader.load(new URLRequest(horizontalList[i][0]));
>>>>>>
>>>>>> imgHolder_mc = new MovieClip();
>>>>>> addChild(imgHolder_mc);
>>>>>>
>>>>>> imgHolder_mc.addChild(imageLoader);
>>>>>>
>>>>>> var mm:MovieMaterial = new MovieMaterial(imgHolder_mc, true);
>>>>>> }
>>>>>>
>>>>>> if I comment the var mm line it loads the images, but I am getting
>>>>>> this error.
>>>>>> ArgumentError: Error #2015: Invalid BitmapData
>>>>>>
>>>>>> Please Advise
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
--
View this message in context: http://www.nabble.com/Papervision-Text-tp15208602p15435544.html
Sent from the Papervision3D mailing list archive at Nabble.com.
More information about the Papervision3D
mailing list