1 Replies - 2388 Views - Last Post: 18 December 2009 - 07:32 PM

#1 Peteman  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 04-December 09

Flash Papervision addFrameScript problem

Posted 18 December 2009 - 10:55 AM

Hi. I'm having trouble with this bit of code. It works okay when I load it in the .fla class section, but I want some animation in the background and I want to center the animation along with the Collada files. However, the moment I add any Actionscript code to the .fla file (and I mean any, like // or just press enter or spacebar) it gives me this error: 1180:

Call to a possibly undefined method addFrameScript.

Can anyone help me? All the solutions I've found refer to problems with extending Sprite, not BasicView.

------


package  
{
	import flash.events.Event;
	import org.papervision3d.materials.BitmapFileMaterial;
	import org.papervision3d.materials.utils.MaterialsList;
	import org.papervision3d.objects.DisplayObject3D;
	import org.papervision3d.objects.parsers.Collada;
	import org.papervision3d.view.BasicView;

	public class Main2 extends BasicView 
	{
		protected var cow:Collada;
		protected var materialList:MaterialsList;
		protected var bitmapFileMaterial:BitmapFileMaterial;
				
		protected var testInt:int = 0;
		protected var turnLeft:Boolean = true;
		protected const ROTATE_MAX:int = 45;

		
		
		public function Main2() 
		{
			super();
			createChildren();
			startRendering();
		}
		public function createChildren():void 
		{
			//Setup the materials manually (sometimes the dae handles this without issue)
			materialList 		= new MaterialsList();
			bitmapFileMaterial 	= new BitmapFileMaterial("daeModel/DLP.png");

			
			materialList.addMaterial(bitmapFileMaterial,"all");
			
			//Create the new Collada Object with materialList
			cow = new Collada("daeModel/DLP.dae",materialList);


			//Set some properties
			cow.scale = 0.1;
			cow.pitch(0);
			cow.roll(0.0);
			cow.yaw(00);
			cow.moveDown(-20);
			//cow.X = 0;


					
			
			//Add to scene
			scene.addChild(cow);
		
		}
		
		override protected function onRenderTick(event:Event = null):void 
		{
			super.onRenderTick(event);

			//Rotate
			//xValue=90;
			
			
			//cow.yaw(1);
			
			if (turnLeft)
			{
				cow.yaw(10);
				testInt++;
				if (testInt>ROTATE_MAX)
					turnLeft=false;
			}
			else
			{
				cow.yaw(-10);
				testInt--;
				if (testInt<(-ROTATE_MAX))
					turnLeft = true;
					
			}
				
			

			
			//cow.roll(10);
			
			//cow.pitch(1);
			//cow.moveDown(10);

			
			
		}
	}
}



Is This A Good Question/Topic? 0
  • +

Replies To: Flash Papervision addFrameScript problem

#2 Peteman  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 04-December 09

Re: Flash Papervision addFrameScript problem

Posted 18 December 2009 - 07:32 PM

Never mind. I realized my problem was that I was supposed to edit things in the Main file,
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1