[mtasc] Extending movieclip

tom/formrausch tom at formrausch.com
Mon Nov 21 10:28:29 CET 2005


Anyone?


On 19.11.2005, at 20:37, tom/formrausch wrote:

> Hi everybody,
>
> as I googled maybe the whole net and didn't find a solution that  
> works for me,  maybe you guys can help me.
>
> My current project is structured like this:
>
> The UI is prebuild in a fla – multiple layers with all the GUI  
> right in place, like you do with Interface Builder on
> the Mac. Every MovieClip has a propertyname.
> Different "Windows"/Views are in container movieclips so I can fade  
> parts of the app easily in and out.
> No Actionscript is in the fla.
>
> The fla looks somethink like this:
>
> _root
> |
> |– MenuView
>     |
>     |– Button 1
>     |– Button 2
> |
> |– LoginView
>     |
>     |– UsernameTextField
>     |– PasswordTextField
>     |– LoginButton
> |
> |– ForumListView
>     |
>     |– ListBox
>     |– […]
>     |– SomeButton
> |
> |– and so on
>
> So I'm using -swf to get the prebuild swf (with all the UI in it).
>
> My problem is, that I'm havily subclassing MovieClip to
> build the application logic, but I can't figure out how to properly  
> do this.
> Before  I build all my apps with MMC and used mtasc to doublecheck  
> (-strict) for errors, but the compile times are killing me.
>
> What do I have to enter in the movieclip–linkage fields inside flash,
> because like "normally" when your're extending a movieclip you
> give flash to packagename of the subclass – like
> com.formrausch.forum.ui.LoginView – but this won't work
> because if this class import other classes I had to supply the  
> include PATH
> for this classes and the fla would be depend on the external libs/ 
> classes.
>
> Hu.. did anybody understand that? ;-)
>
> I've tried everything:
>
> class MenuButton extends MovieClip{
>
> 	public static var symbolName = "__Packages.MenuButton";
> 	public static var symbolOwner = MenuButton;
> 	public static var symbolLinked = Object.registerClass(symbolName,  
> symbolOwner);
> 	
> 	[…]
> with
>
> 	_root.attachMovieClip( MenuButton.LINKAGE, "Button1", 1);
>
> and
>
> 	MenuView.createEmptyMovieClip("Button1", 1);
> 	MenuView.WeingutButton.__proto__ = new MenuButton();
>
>
> How do I "inject" the code in the movieclips?
>
> thank you!
> - tom
>
>
> btw: my Makefile looks like this (maybe this helps):
>
> ---------------------------------------------------------------------- 
> -----------------------------------
> NAME 		= generic
> VERSION 	= 7
>
> PROD_OBJECTS 	= Application.as PreloaderDelegate.as MenuButton.as
> DEV_OBJECTS 	= $(PROD_OBJECTS) logging_helper.as
>
> all: developement
>
> development:
> 	mtasc \
> 	-cp lib/override/ \
> 	-cp vendor/ \
> 	-cp lib/core/ \
> 	-cp lib/apis/ \
> 	-cp app/controllers/ \
> 	-cp app/helpers/ \
> 	-swf lib/swf/Library.swf \
> 	-out deploy/$(NAME).swf \
> 	-main \
> 	-version $(VERSION) \
> 	-trace logging_helper.log \
> 	$(DEV_OBJECTS)
>
>
> production:
> 	make clean
> 	mtasc \
> 	-cp lib/override/ \
> 	-cp vendor/ \
> 	-cp lib/core/ \
> 	-cp lib/apis/ \
> 	-cp app/controllers/ \
> 	-cp app/helpers/ \
> 	-swf lib/swf/Library.swf \
> 	-out deploy/$(NAME).swf \
> 	-main \
> 	-version $(VERSION) \
> 	-trace no \
> 	-exclude config/production \
> 	$(PROD_OBJECTS)
> 		
> 		
> clean:
> 	rm -Rf deploy/* log/*		
> 	
> 	
> console:
> 	open -a SAFlashPlayer scripts/console.swf
> 	
> run:
> 	make development
> 	open -a Safari.app deploy/$(NAME).swf
> 	
> set_up:
> 	make console
> 	make run
> ---------------------------------------------------------------------- 
> -------------------------------------------






More information about the mtasc mailing list