More information about the Underscore mailing list

[_] AS3 help

Oliver Humpage oliver at watershed.co.uk
Mon Feb 7 20:01:03 GMT 2011

Dear lovely helpful list,

This is from a friend of a friend... I hope it makes sense, not an AS3  
person myself. I understand there's a small budget available if it  
needs a load of work. Please reply to Maisie (maisiefe at live.com)  
directly if you can help.

Thanks,

Oliver.

> From: Maisie Ferne Evans <maisiefe at live.com>
> Date: 7 February 2011 19:17:25 GMT
> To: <oliver at watershed.co.uk>
> Subject: AS3 help
>
> Essentially we're trying to load an instant of a movie clip from the  
> library from a button click into another blank movie clip with  
> targeted objects.
> Attached is the code that we have to try and embed this code into...
>
>
> package {
> 	import com.greensock.transform.*;
> 	import com.greensock.events.TransformEvent;
> 	import flash.geom.*;
> 	import flash.events.*;
> 	import flash.display.MovieClip;
> 	import fl.controls.*;
> 	import fl.controls.Button
> 	
> 	public class Selector {
> 		private static var _manager:TransformManager;
> 		private static var _main:MovieClip;
> 		
> 		
> 		public static function init($mc:MovieClip):void {
> 			_main = $mc;
> 			_manager = new TransformManager({targetObjects:[_main.mc1,  
> _main.mc2, _main.mc3, _main.mc4, _main.text_ti, _main.text_ab],
> 											bounds:new Rectangle(60, 100, 881, 540),
> 											forceSelectionToFront:true,
> 											allowDelete:true});
> 			
> 			setupListeners();
> 			
> 		}
> 		
> 		private static function setupListeners():void {
> 			var propNames:Array = ["scaleFromCenter", "constrainScale",  
> "allowDelete", "forceSelectionToFront", "lockPosition",  
> "lockRotation", "lockScale", "autoDeselect", "lineColor",  
> "handleSize", "allowMultiSelect"];
> 			for (var i:uint = 0; i < propNames.length; i++) {
> 				_main[propNames[i]].addEventListener(Event.CHANGE, onChange);
> 				_manager.addIgnoredObject(_main[propNames[i]]); //To make sure  
> that when an item is selected and the user clicks on one of the form  
> elements, the item isn't deselected.
> 			}
> 		}
> 		
> 		private static function onChange($e:Event):void {
> 			if ($e.target is CheckBox) {
> 				_manager[$e.target.name] = $e.target.selected;
> 				
> 			} else if ($e.target.name == "lineColor") {
> 				_manager.lineColor = $e.target.selectedColor;
> 				
> 			} else if ($e.target.name == "handleSize") {
> 				_manager.handleSize = $e.target.value;
> 				
> 			}
> 		}
> 	
> 	}
> 	
> }
>
>
> Thanks again,
> Maisie
>
> ---
> Maisie Ferne Evans
> maisiefe at live.com
> flickr.com/missmaisie
> savingmaisie.blogspot.com
>
> "Time flies, eh? Coming here from the future, landing on my  
> sandwiches. Little bastards."
>
>
>