List Info

Thread: Class war




Class war
country flaguser name
United Kingdom
2007-09-08 20:02:12
Hello,
In AS 3, I have a bunch on movie clips in an array that I am
 
targetting with a class so that I can have each instance
respond if  
clicked. But I keep getting this error, once for each mc...
5000: The class 'com.inkthing.quest.ClipClass' must subclass
 
'flash.display.MovieClip' since it is linked to a library
symbol of  
that type.
  When I revert the Base Class to flash.display.MovieClip
then I get  
the error- 1046: Type was not found or was not a
compile-time  
constant, for each instance.
Where am I going wrong? (Code of class below.) It is my
first go at  
writing classes in AS 3 so there may be other things
awry...

Thanking you in anticipation

chris


public class ClipClass extends MovieClip {

        public function ClipClass() {
				       addEventListener(Event.ENTER_FRAME,onEnterFrame)
				       }
				       private function onEnterFrame(event,EVENT):void
{
			myMcs.buttonMode = true;
			APCore.initialize();
             var myListener:Object = new Object();
             APCore.addListener(myListener);
              var myMcs:Array = new Array(paws. photo, comp,
lines,  
redeye, camera,
          			   leap, rap, empty, sketch, blue,
          			   advent, piano, strut);
             /*(tunnel,clickPic,baby,sky,kiwi,sus,steps,
                            
redeye,hands,sink,teacher,snakes,
                         crayon, wonder,
music,race,parrot,book);*/
             myMcs._alpha = 0;
             stage.addChild(paws. photo, comp, lines,
redeye, camera,
          			   leap, rap, empty, sketch, blue,
          			   advent, piano, strut);
             var myAlpha:Alpha = new Alpha(clickPic,[0,100],

2000,Sine.easeInOut);
             var myAlpha:Alpha = new Alpha(myMcs,[0,100], 
4000,Sine.easeInOut);
             myAlpha.run();
             trace ("ap");
         }

				
		  public function myFunction():void {
                 myMcs.addEventListener(MouseEvent.CLICK,
onClick);
                 myFunction.run();
                  trace("working!");
                }

                 public function
onClick(event:MouseEvent):void {
                  		polaroid_mc._alpha +=10;
                  		stage.addChild(polaroid_mc);
                  		event.target.x = 67;
                  		event.target.y = 451.4;
                  		event.target.rotation = 320;
			}
			
			stage.addEventListener(MouseEvent.CLICK, reportClick);
			public function reportClick(event:MouseEvent):void {
     trace(event.currentTarget.toString() + "");
			}
	}




_______________________________________________
Flashnewbiechattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.c
om

Re: Class war
country flaguser name
Netherlands
2007-09-10 02:46:12
Hi Chris,
I think ou need to add a few lines to make the movieclip
class  
available to your custom class:

package com.inkthing.quest {
	import flash.display.MovieClip;
	public class ClipClass extends MovieClip {
		//contents of your class
	}
}
HTH,
Willem van den Goorbergh

Op 9-sep-2007, om 3:02 heeft christopher patch het volgende
geschreven:

>
> Hello,
> In AS 3, I have a bunch on movie clips in an array that
I am  
> targetting with a class so that I can have each
instance respond if  
> clicked. But I keep getting this error, once for each
mc...
> 5000: The class 'com.inkthing.quest.ClipClass' must
subclass  
> 'flash.display.MovieClip' since it is linked to a
library symbol of  
> that type.
>  When I revert the Base Class to
flash.display.MovieClip then I get  
> the error- 1046: Type was not found or was not a
compile-time  
> constant, for each instance.
> Where am I going wrong? (Code of class below.) It is my
first go at  
> writing classes in AS 3 so there may be other things
awry...
>
> Thanking you in anticipation
>
> chris




=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
Geografiek is a Dutch, Utrecht-based map and chart design
company.
Willem van den Goorbergh can be contacted by telephone:
(+31) 
30-2719512 or cell phone: (+31)6-26372378
or by fax: (+31)302719687
snail mail: Hooghiemstraplein 89 3514 AX UTRECHT
Visit our website at: http://www.geografiek.nl

=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=


_______________________________________________
Flashnewbiechattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.c
om

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )