A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: [CS3] assigning the same custom class to multiple movie clips.

  1. #1
    Member
    Join Date
    May 2007
    Posts
    44

    resolved [CS3] assigning the same custom class to multiple movie clips.

    i have multiple movie clips (multiple instance).
    i would like to assign a custom class to all of them,
    but flash says i need different class names under linkage property for each instance.

    Does that mean I need 3 as file for each of my movielip instance although they are all the same?
    Code:
    package{
    
    	import flash.display.MovieClip;
    	import flash.events.Event;
    	import flash.events.MouseEvent;
    	
    	public class F1 extends MovieClip {
    
    		public function F1() {
    			
    		this.addEventListener(MouseEvent.MOUSE_OVER,flowerOver);
    		}
    		
    	
    		private function flowerOver(e:MouseEvent):void{
    			trace("over");
    		
    		}
    	}	
    	
    }
    please help me.

    thanks

  2. #2
    Senior Member Kirill M.'s Avatar
    Join Date
    May 2002
    Location
    Toronto, Canada
    Posts
    711
    Not sure what you're doing. Maybe you created an as2 fla but trying to use an AS3 class in it. But if you create an as3 fla the linkage property should be inactive and you shouldn't be able to use it at all. It should have Class and Base class properties available. You should set the base class to F1 and set Class property to whatever for your 3 clips. In as2 you would set the Class property to F1 and set the linkage property to whatever.

  3. #3
    Member
    Join Date
    May 2007
    Posts
    44
    i assigned my class name to the base class section, and it worked.
    thanks anyway.

  4. #4
    Member
    Join Date
    May 2007
    Posts
    44
    i assigned my class name to the base class section, and it worked.
    thanks anyway.

  5. #5
    Senior Member Kirill M.'s Avatar
    Join Date
    May 2002
    Location
    Toronto, Canada
    Posts
    711
    Not sure why it's "thanks anyway" considering that's what I told you to do. Should be "thanks"

  6. #6
    Member
    Join Date
    May 2007
    Posts
    44
    sorry, i meant to post on someone else`s replay on another thread.
    you are the man.
    thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center