<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments for saumya</title>
	<atom:link href="http://saumyaray.wordpress.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://saumyaray.wordpress.com</link>
	<description>where there is a will, there is a way</description>
	<pubDate>Sun, 18 May 2008 12:00:45 +0000</pubDate>
	<generator>http://wordpress.org/?v=MU</generator>
		<item>
		<title>Comment on 7 wonders of the world !! huh by Sonesh</title>
		<link>http://saumyaray.wordpress.com/2007/07/25/7-wonders-of-world-huh/#comment-2694</link>
		<dc:creator>Sonesh</dc:creator>
		<pubDate>Tue, 13 May 2008 12:07:49 +0000</pubDate>
		<guid isPermaLink="false">http://saumyaray.wordpress.com/2007/07/25/7-wonders-of-world-huh/#comment-2694</guid>
		<description>You can also check it on google:

http://www.google.com/search?sourceid=navclient&#38;ie=UTF-8&#38;rls=RNWN,RNWN:2006-39,RNWN:en&#38;q=Animal+Kingdom+%2d+Tree+of+Life+</description>
		<content:encoded><![CDATA[<p>You can also check it on google:</p>
<p><a href="http://www.google.com/search?sourceid=navclient&amp;ie=UTF-8&amp;rls=RNWN,RNWN:2006-39,RNWN:en&amp;q=Animal+Kingdom+%2d+Tree+of+Life+" rel="nofollow">http://www.google.com/search?sourceid=navclient&amp;ie=UTF-8&amp;rls=RNWN,RNWN:2006-39,RNWN:en&amp;q=Animal+Kingdom+%2d+Tree+of+Life+</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on 7 wonders of the world !! huh by Sonesh</title>
		<link>http://saumyaray.wordpress.com/2007/07/25/7-wonders-of-world-huh/#comment-2693</link>
		<dc:creator>Sonesh</dc:creator>
		<pubDate>Tue, 13 May 2008 12:07:14 +0000</pubDate>
		<guid isPermaLink="false">http://saumyaray.wordpress.com/2007/07/25/7-wonders-of-world-huh/#comment-2693</guid>
		<description>This tree is not in India but from Disney Land's "Animal Kingdom - Tree of Life". So this is wrong circulation and not wonder of nature.</description>
		<content:encoded><![CDATA[<p>This tree is not in India but from Disney Land&#8217;s &#8220;Animal Kingdom - Tree of Life&#8221;. So this is wrong circulation and not wonder of nature.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Flash CS3 component creation : SWC to FLA by Jonathon</title>
		<link>http://saumyaray.wordpress.com/2007/12/11/flash-cs3-component-creation-swc-to-fla/#comment-2680</link>
		<dc:creator>Jonathon</dc:creator>
		<pubDate>Tue, 06 May 2008 12:47:58 +0000</pubDate>
		<guid isPermaLink="false">http://saumyaray.wordpress.com/2007/12/11/flash-cs3-component-creation-swc-to-fla/#comment-2680</guid>
		<description>Here's my code:  

I am trying to add the ability of skinning through AS like:  

window1.setStyle("lBarSkin", leftbarsilver);  

leftbarsilver being a movieclip in the library exported for as.  Any help is greatly appreciated.  Thanks.  

Basically this code builds a windows message window.  

package {
	import fl.controls.ScrollBar;
	import fl.controls.UIScrollBar;
	import fl.controls.ScrollPolicy;
	import fl.controls.ScrollBarDirection;
	import fl.controls.TextInput; //Only for ASDocs
	import fl.core.InvalidationType;
	import fl.core.UIComponent;
	import fl.events.ComponentEvent;
	import fl.events.ScrollEvent;
	import fl.managers.IFocusManager;
	import fl.managers.IFocusManagerComponent;
	import flash.display.DisplayObject;
	import flash.events.Event;
	import flash.events.TextEvent;
	import flash.events.KeyboardEvent;
	import flash.events.MouseEvent;
	import flash.events.FocusEvent;
	import flash.system.IME;
	import flash.text.TextField;
	import flash.text.TextFieldType;
	import flash.text.TextFormat;
	import flash.text.TextLineMetrics;
	import flash.ui.Keyboard;
	
	import flash.display.*;
	import flash.events.*;
	import flash.text.*;
	import flash.xml.*;
	import flash.net.*;
	import flash.filters.*;
	import flash.geom.*;
	import fl.controls.UIScrollBar;
	import fl.core.UIComponent;
	
	import fl.controls.ScrollBar;
	import fl.controls.ScrollPolicy;

	[Event(name="change", type="flash.events.Event")]

	[Event(name="textInput", type="flash.events.TextEvent")]

	[Event(name= "enter", type="fl.events.ComponentEvent")]

	[Event(name="scroll", type="fl.events.ScrollEvent")]

	[Style(name="upSkin", type="Class")]

	[Style(name="disabledSkin", type="Class")]

    [Style(name="textPadding", type="Number", format="Length")]

	[Style(name="embedFonts", type="Boolean")]
	
	[Style(name="lBarSkin", type="Class")]
	[Style(name="rBarSkin", type="Class")]
	[Style(name="tHSkin", type="Class")]
	[Style(name="tLSkin", type="Class")]
	[Style(name="bBarSkin", type="Class")]
	[Style(name="mBodySkin", type="Class")]
	[Style(name="rCSkin", type="Class")]
	[Style(name="lCSkin", type="Class")]
	
	public class XpMessageWindow extends UIComponent {

		protected var _editable:Boolean = true;

		protected var _wordWrap:Boolean = true;

		protected var _verticalScrollPolicy:String = ScrollPolicy.AUTO;
		
		protected var _windowsThemeColor:String = "Blue";
		
		protected var _verticalScrollBar:UIScrollBar;

        protected var _html:Boolean = false;

		protected var _savedHTML:String;

		protected var textHasChanged:Boolean = false;
		
		private var defaultIt:TextFormat = new TextFormat("Arial", 12, 0x006600, false, false, false, "", "", "left", 0, 0, 0, 0);
		
		private static var defaultStyles:Object = {
												upSkin:"TextArea_upSkin",
												disabledSkin:"TextArea_disabledSkin",
												focusRectSkin:null,
												focusRectPadding:null,
												textFormat:"defaultIt", disabledTextFormat:null,
												textPadding:3,
												embedFonts:false
												};
												
		protected static var winDefaultStyles:Object = {
												lBarSkin:"leftbar",
												rBarSkin:"rightbar",
												tHSkin:"toplevelblue",
												tLSkin:"lowlevelblue",
												bBarSkin:"bottombar",
												mBodySkin:"mBodyWin",
												rCSkin:"rightcorner",
												lCSkin:"leftcorner"
												};
												
		protected static const SCROLL_BAR_STYLES:Object = {
												downArrowDisabledSkin:"downArrowDisabledSkin",
												downArrowDownSkin:"downArrowDownSkin",
												downArrowOverSkin:"downArrowOverSkin",
												downArrowUpSkin:"downArrowUpSkin",
												upArrowDisabledSkin:"upArrowDisabledSkin",
												upArrowDownSkin:"upArrowDownSkin",
												upArrowOverSkin:"upArrowOverSkin",
												upArrowUpSkin:"upArrowUpSkin",
												thumbDisabledSkin:"thumbDisabledSkin",
												thumbDownSkin:"thumbDownSkin",
												thumbOverSkin:"thumbOverSkin",
												thumbUpSkin:"thumbUpSkin",
												thumbIcon:"thumbIcon",
												trackDisabledSkin:"trackDisabledSkin",
												trackDownSkin:"trackDownSkin",
												trackOverSkin:"trackOverSkin",
												trackUpSkin:"trackUpSkin",
												repeatDelay:"repeatDelay",
												repeatInterval:"repeatInterval"
												};

		public static function getStyleDefinition():Object {
			return UIComponent.mergeStyles(defaultStyles, ScrollBar.getStyleDefinition());
			return winDefaultStyles;
		}
		

		public static var createAccessibilityImplementation:Function;

		public function XpMessageWindow() {
			super();
			trace("new window");
		}
		//my variables
		public var windowMC:MovieClip;
		public var choiceBtnMC:MovieClip;
		public var closeBtn:MovieClip;

		private var mBody:MovieClip;
		private var blueHigh:MovieClip;
		private var blueLow:MovieClip;
		private var rCorner:MovieClip;
		private var lCorner:MovieClip;
		private var bBar:MovieClip;
		private var rBar:MovieClip;
		private var lBar:MovieClip;
		private var x_close:MovieClip;

		private var backDrop:Sprite;
		
		public var msgTxt:TextField;
		
		private var whiteTitle:TextFormat = new TextFormat();
		
		private var blackTitle:TextFormat = new TextFormat();
			
		private var blackBody:TextFormat = new TextFormat();
			
		private var bodyTxtFormat:TextFormat = new TextFormat();
			
		private var titleTxtFormat:TextFormat = new TextFormat();
			
		//end my variables
		
		//my inspectables
		[Inspectable(name="Body Width",type="Number",defaultValue=300)]
		public var bodyWidth:Number=300;

		[Inspectable(name = "Main Body Height", type="Number", defaultValue=100)]
		public var bodyHeight:Number = 100;

		[Inspectable(name = "Message Title Text", type="String", defaultValue="Message Window Title")]
		public var titletext:String = "Message Window Title";

		[Inspectable(name = "Window Response Button Text", type="String", defaultValue="OK")]
		public var btnTxt:String = "OK";
		
		/*[Inspectable(name = "Windows Theme Color", defaultValue="Blue", enumeration="Blue,Silver,Olive Green")]
		public function get windowsThemeColor():String {
			return _windowsThemeColor;
		}*/
		
		//backdrop or not
		[Inspectable(name="Backdrop?",type="Boolean",defaultValue="false")]
		public var backDropVar:Boolean = false;
		
		[Inspectable(name="Backdrop Alpha Value",type="Number",defaultValue=.75)]
		public var bDAlpha:Number = .75;
		
		[Inspectable(name="BackDrop Color",type="uint",defaultValue=0x000000)]
		public var bDColorVal:uint = 0x000000;
		
		//body text format options
		[Inspectable(name = "Message Text Font", type="String", defaultValue="Arial")]
		public var txtFont:String = "Arial";

		[Inspectable(name = "Message Text Color", type="uint", defaultValue=0x000000)]
		public var txtColor:uint = 0x000000;

		[Inspectable(name = "Message Text Size", type="Number", defaultValue=12)]
		public var txtSize:Number = 12;

		//title text format options
		[Inspectable(name = "Title Text Font", type="String", defaultValue="Arial")]
		public var titleTxtFont:String = "Arial";

		[Inspectable(name = "Title Text Color", type="uint", defaultValue=0x000000)]
		public var titleTxtColor:uint = 0xFFFFFF;

		[Inspectable(name = "Title Text Size", type="Number", defaultValue=12)]
		public var titleTxtSize:Number = 14;
		//end my inspectables
		
		public function get verticalScrollBar():UIScrollBar { 
			return _verticalScrollBar;
		}		
		
		[Inspectable(defaultValue=true, verbose=1)]

		override public function get enabled():Boolean {
			return super.enabled;
		}

		override public function set enabled(value:Boolean):void {
			super.enabled = value;
			mouseChildren = enabled;  //Disables mouseWheel interaction.
			invalidate(InvalidationType.STATE);
		}
		
        [Inspectable(name="Non-HTML Text",defaultValue="")]

		public function get text():String {
			return msgTxt.text;
		}

		public function set text(value:String):void {
			if (componentInspectorSetting &#38;&#38; value == "") {
				return;
			}
			
			msgTxt.text = value;
			_html = false;
			invalidate(InvalidationType.DATA);
			invalidate(InvalidationType.STYLES);			
			textHasChanged = true;
		}

		[Inspectable(name="Message Body Text")]

		public function get htmlText():String {
			return msgTxt.htmlText;
		}

		public function set htmlText(value:String):void {
			if (componentInspectorSetting &#38;&#38; value == "") {
				return;
			}
			if (value == "") { 
				text = "";
				return;
			}
			_html = true;
			_savedHTML = value;
			msgTxt.htmlText = value;
			invalidate(InvalidationType.DATA);
			invalidate(InvalidationType.STYLES);
			textHasChanged = true;
		}
		
		[Inspectable(defaultValue="auto", enumeration="auto,on,off")]

		public function get verticalScrollPolicy():String {
			return _verticalScrollPolicy;
		}

		public function set verticalScrollPolicy(value:String):void {
			_verticalScrollPolicy = value;
			invalidate(InvalidationType.SIZE);
		}

		public function get verticalScrollPosition():Number {
			return msgTxt.scrollV;
		}

		public function set verticalScrollPosition(value:Number):void {
			// We must force a redraw to ensure that the size is up to date.
			drawNow();
			msgTxt.scrollV = value;
		}

		public function get textWidth():Number {
			drawNow();
			return msgTxt.textWidth;
		}

		public function get textHeight():Number {
			drawNow();
			return msgTxt.textHeight;
		}

		public function get length():Number {
			return msgTxt.text.length;
		}
		
		public function get maxVerticalScrollPosition():int {
			return msgTxt.maxScrollV;
		}
		
        [Inspectable(name="Word Wrap?",defaultValue="true")]
	
		public function get wordWrap():Boolean {
			return _wordWrap;
		}

		public function set wordWrap(value:Boolean):void {
			_wordWrap = value;
			invalidate(InvalidationType.STATE);
		}
		
		public function getLineMetrics(lineIndex:int):TextLineMetrics {
			return msgTxt.getLineMetrics(lineIndex);
		}

		public function appendText(text:String):void {
			windowMC.	msgTxt.appendText(text);
			invalidate(InvalidationType.DATA);
		}
		
		override protected function configUI():void {
			super.configUI();
			tabChildren = true;
			
			windowMC=new MovieClip();
			backDrop=new Sprite();
			stage.addChild(backDrop);
			stage.addChild(windowMC);

			msgTxt = new TextField();
			windowMC.addChild(msgTxt);
			updateTextFieldType();
			
			_verticalScrollBar = new UIScrollBar();
			_verticalScrollBar.name = "V";
			_verticalScrollBar.visible = false;
			_verticalScrollBar.focusEnabled = false;
			copyStylesToChild(_verticalScrollBar, SCROLL_BAR_STYLES);
			_verticalScrollBar.addEventListener(ScrollEvent.SCROLL,handleScroll,false,0,true);
			windowMC.addChild(_verticalScrollBar);
			
			msgTxt.addEventListener(TextEvent.TEXT_INPUT, handleTextInput, false, 0, true);
			msgTxt.addEventListener(Event.CHANGE, handleChange, false, 0, true);
			msgTxt.addEventListener(KeyboardEvent.KEY_DOWN, handleKeyDown, false, 0, true);

			_verticalScrollBar.scrollTarget = msgTxt;
			addEventListener(MouseEvent.MOUSE_WHEEL, handleWheel, false, 0, true);
		}

		protected function updateTextFieldType():void {
			with(windowMC) {
				msgTxt.type = (enabled &#38;&#38; _editable) ? TextFieldType.INPUT : TextFieldType.DYNAMIC;
				msgTxt.selectable = enabled;
				msgTxt.wordWrap = _wordWrap;
				msgTxt.multiline = true;
			}
		}

		protected function handleKeyDown(event:KeyboardEvent):void {
			if (event.keyCode == Keyboard.ENTER) {
				dispatchEvent(new ComponentEvent(ComponentEvent.ENTER, true));
			}
		}

		protected function handleChange(event:Event):void {
			event.stopPropagation(); // so you don't get two change events
			dispatchEvent(new Event(Event.CHANGE, true));
			invalidate(InvalidationType.DATA);
		}

		protected function handleTextInput(event:TextEvent):void {
			event.stopPropagation();
			dispatchEvent(new TextEvent(TextEvent.TEXT_INPUT, true, false, event.text));
		}

		protected function handleScroll(event:ScrollEvent):void {
			dispatchEvent(event);
		}

		protected function handleWheel(event:MouseEvent):void {
			if (!enabled &#124;&#124; !_verticalScrollBar.visible) { return; }
			_verticalScrollBar.scrollPosition -= event.delta * _verticalScrollBar.lineScrollSize;
			dispatchEvent(new ScrollEvent(ScrollBarDirection.VERTICAL, event.delta * _verticalScrollBar.lineScrollSize, _verticalScrollBar.scrollPosition));
		}

		protected function setEmbedFont() {
			var embed:Object = getStyleValue("embedFonts");
			if (embed != null) {
				msgTxt.embedFonts = embed;
			}	
		}

		override protected function draw():void {
			trace('Message Window : draw');
			if (isInvalid(InvalidationType.STATE)) {
				updateTextFieldType();
			}
			
			if (isInvalid(InvalidationType.STYLES)) {
				setStyles();				
				setEmbedFont();				
			}
			
			if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)) {
				drawTextFormat();
				invalidate(InvalidationType.SIZE, false);
			}
			
			if (isInvalid(InvalidationType.SIZE, InvalidationType.DATA)) {
				drawLayout();
			}
			
			super.draw();
			
		}

		protected function setStyles():void {
			copyStylesToChild(_verticalScrollBar, SCROLL_BAR_STYLES);
		}

		protected function drawTextFormat():void {
			// Apply a default textformat
			var uiStyles:Object = UIComponent.getStyleDefinition();
			var defaultTF:TextFormat = enabled ? uiStyles.defaultTextFormat as TextFormat : uiStyles.defaultDisabledTextFormat as TextFormat;
			msgTxt.setTextFormat(defaultTF);
			
			var tf:TextFormat = getStyleValue(enabled?"textFormat":"disabledTextFormat") as TextFormat;
			if (tf != null) {
				msgTxt.setTextFormat(tf);
			} else {
				tf = defaultTF;
			}
			msgTxt.defaultTextFormat = tf;
			
			setEmbedFont();
			if (_html) {
				msgTxt.htmlText = _savedHTML; 
			}
		}

		protected function drawLayout():void {
			trace('Message Window : drawLayout');
			if (backDropVar == true) {
				backDrop.graphics.beginFill(bDColorVal, bDAlpha);
				backDrop.graphics.drawRect(0,0,stage.stageWidth,stage.stageHeight);
				backDrop.graphics.endFill();			
			}
			mBody = new mBodyWin();
			blueHigh = new toplevelblue();
			blueLow = new lowlevelblue();
			rCorner = new rightcorner();
			lCorner = new leftcorner();
			rBar = new rightbar();
			lBar = new leftbar();
			bBar =  new bottombar();
			x_close = new xclose();
			windowMC.addChild(mBody);
			windowMC.addChild(blueHigh);
			windowMC.addChild(blueLow);
			windowMC.addChild(rCorner);
			windowMC.addChild(lCorner);
			windowMC.addChild(bBar);
			windowMC.addChild(rBar);
			windowMC.addChild(lBar);
			windowMC.addChild(x_close);
			whiteTitle.color = 0xFFFFFF;
			whiteTitle.font = "Arial";
			whiteTitle.size = 14;
			
			blackTitle.color = 0x000000;
			blackTitle.font = "Arial";
			blackTitle.size = 14;
			
			blackBody.color = 0x000000;
			blackBody.font = "Arial";
			blackBody.size = 12;
			
			bodyTxtFormat.color = txtColor;
			bodyTxtFormat.font = txtFont;
			bodyTxtFormat.size = txtSize;
			
			titleTxtFormat.color = titleTxtColor;
			titleTxtFormat.font = titleTxtFont;
			titleTxtFormat.size = titleTxtSize;
			
			with(windowMC) {
				mBody.x = 0;
				mBody.y = blueLow.y+blueHigh.height+blueLow.height;
				mBody.width = bodyWidth;
				mBody.height = bodyHeight;
				//top half of top blue bar
				blueHigh.x = 6.8;
				blueHigh.y = 0;
				blueHigh.width = mBody.width - rCorner.width - lCorner.width;
				//low half of top blue bar
				blueLow.x = 0;
				blueLow.y = blueHigh.height+blueHigh.y;
				blueLow.width = mBody.width;
				//Right corner top
				rCorner.x = blueHigh.x+blueHigh.width;
				rCorner.y = 0;
				//left corner top
				lCorner.x = 6.8;
				lCorner.y = 0;
				//bottom blue bar
				bBar.x = mBody.x;
				bBar.y = mBody.y + mBody.height - bBar.height;
				bBar.width = mBody.width;
				//left blue bar
				lBar.x = mBody.x;
				lBar.y = mBody.y;
				lBar.height = mBody.height;
				//right blue bar
				rBar.x = mBody.x+mBody.width;
				rBar.y = mBody.y;
				rBar.height = mBody.height;
				//red x close button
				x_close.x = blueLow.width - 25.2;
				x_close.y = 5;
				//text block
				msgTxt.multiline = true;
				msgTxt.wordWrap = true;
				msgTxt.defaultTextFormat = bodyTxtFormat;
				msgTxt.mouseEnabled = false;
				msgTxt.x = mBody.x+10;
				msgTxt.y = mBody.y+10;
				
				var availHeight:Number = msgTxt.height;
				var vScrollBar:Boolean = needVScroll();
			
				// Size and move the scrollBars
				if (vScrollBar) {
					_verticalScrollBar.visible = true;
					_verticalScrollBar.x = msgTxt.width+5;
					_verticalScrollBar.y = msgTxt.y;
					_verticalScrollBar.height = availHeight;
					_verticalScrollBar.visible = true;
					_verticalScrollBar.enabled = enabled;
					msgTxt.width = mBody.width - 20 - _verticalScrollBar.width;
					msgTxt.height = mBody.height - 40;
				} else {
					_verticalScrollBar.visible = false;
					msgTxt.width = mBody.width - 20;
					msgTxt.height = mBody.height - 40;
					//msgTxt.autoSize = TextFieldAutoSize.CENTER;
					msgTxt.defaultTextFormat = bodyTxtFormat;
				}
				//Title Text Block
				var titleTxt:TextField = new TextField();
				addChild(titleTxt);
				titleTxt.defaultTextFormat = titleTxtFormat;
				titleTxt.mouseEnabled = false;
				titleTxt.x = 1.8;
				titleTxt.y = 4.0;
				titleTxt.width = blueLow.width - x_close.width - 25.2;
				if (titletext != "") {
					titleTxt.htmlText = "&lt;b&gt;"+titletext+"&lt;/b&gt;";
					titleTxt.defaultTextFormat = titleTxtFormat;
				} else {
					titleTxt.text = "";
					titleTxt.defaultTextFormat = titleTxtFormat;
				}
				//choice button
				var newBtn:choicebtn = new choicebtn();
				windowMC.addChild(newBtn);
				choiceBtnMC = new MovieClip();
				choiceBtnMC = newBtn;
				choiceBtnMC.x = (mBody.width/2) - (choiceBtnMC.width/2);
				choiceBtnMC.y = mBody.height;
				choiceBtnMC.choiceTxt.text = btnTxt;
				choiceBtnMC.mouseChildren = false;
				choiceBtnMC.addEventListener(MouseEvent.ROLL_OVER, mouseOverHandler);
				choiceBtnMC.addEventListener(MouseEvent.ROLL_OUT, mouseOutHandler);
				choiceBtnMC.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
				//Red X Button
				closeBtn = new MovieClip();
				closeBtn = x_close;
				closeBtn.mouseChildren = false;
				closeBtn.addEventListener(MouseEvent.ROLL_OVER, mouseOverHandler);
				closeBtn.addEventListener(MouseEvent.ROLL_OUT, mouseOutHandler);
				closeBtn.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
				//}
				blueHigh.addEventListener(MouseEvent.MOUSE_DOWN, windowStartDrag);
				blueLow.addEventListener(MouseEvent.MOUSE_DOWN, windowStartDrag);
				lCorner.addEventListener(MouseEvent.MOUSE_DOWN, windowStartDrag);
				rCorner.addEventListener(MouseEvent.MOUSE_DOWN, windowStartDrag);
				blueHigh.addEventListener(MouseEvent.MOUSE_UP, windowStopDrag);
				blueLow.addEventListener(MouseEvent.MOUSE_UP, windowStopDrag);
				lCorner.addEventListener(MouseEvent.MOUSE_UP, windowStopDrag);
				rCorner.addEventListener(MouseEvent.MOUSE_UP, windowStopDrag);
			}
			windowMC.x = (stage.stageWidth-bodyWidth)/2;
			windowMC.y = (stage.stageHeight-bodyHeight)/2;
			windowMC.swapChildren(msgTxt, mBody);
			windowMC.swapChildren(msgTxt, _verticalScrollBar);

			updateScrollBars();	
			
			addEventListener(Event.ENTER_FRAME, delayedLayoutUpdate, false, 0, true);
		}
		
		protected function delayedLayoutUpdate(event:Event):void {
			if (textHasChanged) {
				textHasChanged = false;
				drawLayout();
				return;
			}
			removeEventListener(Event.ENTER_FRAME, delayedLayoutUpdate);
		}
		
		protected function updateScrollBars() {
			_verticalScrollBar.update();
			_verticalScrollBar.enabled = enabled;
			_verticalScrollBar.drawNow();			
		}

		protected function needVScroll():Boolean {
			if (windowMC._verticalScrollPolicy == ScrollPolicy.OFF) { return false; }
			if (windowMC._verticalScrollPolicy == ScrollPolicy.ON) { return true; }
			return (msgTxt.maxScrollV &#62; 1);
		}
		
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//my functions
		private function mouseOverHandler(evt:Event):void {
			evt.target.gotoAndStop(2);
		}
		private function mouseOutHandler(evt:Event):void {
			evt.target.gotoAndStop(1);
		}
		private function mouseDownHandler(evt:Event):void {
			evt.target.gotoAndStop(3);
			evt.target.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
		}
		private function mouseUpHandler(evt:Event):void {
			evt.target.gotoAndStop(1);
			stage.removeChild(windowMC);
			stage.removeChild(backDrop);
		}
		private function closeHandler(evt:Event):void {
			stage.removeChild(windowMC);
			stage.removeChild(backDrop);
		}//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		private function windowStartDrag(evt:Event):void {
			evt.target.parent.startDrag();
		}
		private function windowStopDrag(evt:Event):void {
			evt.target.parent.stopDrag();
		}
		//end my functions
	}
}</description>
		<content:encoded><![CDATA[<p>Here&#8217;s my code:  </p>
<p>I am trying to add the ability of skinning through AS like:  </p>
<p>window1.setStyle(&#8221;lBarSkin&#8221;, leftbarsilver);  </p>
<p>leftbarsilver being a movieclip in the library exported for as.  Any help is greatly appreciated.  Thanks.  </p>
<p>Basically this code builds a windows message window.  </p>
<p>package {<br />
	import fl.controls.ScrollBar;<br />
	import fl.controls.UIScrollBar;<br />
	import fl.controls.ScrollPolicy;<br />
	import fl.controls.ScrollBarDirection;<br />
	import fl.controls.TextInput; //Only for ASDocs<br />
	import fl.core.InvalidationType;<br />
	import fl.core.UIComponent;<br />
	import fl.events.ComponentEvent;<br />
	import fl.events.ScrollEvent;<br />
	import fl.managers.IFocusManager;<br />
	import fl.managers.IFocusManagerComponent;<br />
	import flash.display.DisplayObject;<br />
	import flash.events.Event;<br />
	import flash.events.TextEvent;<br />
	import flash.events.KeyboardEvent;<br />
	import flash.events.MouseEvent;<br />
	import flash.events.FocusEvent;<br />
	import flash.system.IME;<br />
	import flash.text.TextField;<br />
	import flash.text.TextFieldType;<br />
	import flash.text.TextFormat;<br />
	import flash.text.TextLineMetrics;<br />
	import flash.ui.Keyboard;</p>
<p>	import flash.display.*;<br />
	import flash.events.*;<br />
	import flash.text.*;<br />
	import flash.xml.*;<br />
	import flash.net.*;<br />
	import flash.filters.*;<br />
	import flash.geom.*;<br />
	import fl.controls.UIScrollBar;<br />
	import fl.core.UIComponent;</p>
<p>	import fl.controls.ScrollBar;<br />
	import fl.controls.ScrollPolicy;</p>
<p>	[Event(name="change", type="flash.events.Event")]</p>
<p>	[Event(name="textInput", type="flash.events.TextEvent")]</p>
<p>	[Event(name= "enter", type="fl.events.ComponentEvent")]</p>
<p>	[Event(name="scroll", type="fl.events.ScrollEvent")]</p>
<p>	[Style(name="upSkin", type="Class")]</p>
<p>	[Style(name="disabledSkin", type="Class")]</p>
<p>    [Style(name="textPadding", type="Number", format="Length")]</p>
<p>	[Style(name="embedFonts", type="Boolean")]</p>
<p>	[Style(name="lBarSkin", type="Class")]<br />
	[Style(name="rBarSkin", type="Class")]<br />
	[Style(name="tHSkin", type="Class")]<br />
	[Style(name="tLSkin", type="Class")]<br />
	[Style(name="bBarSkin", type="Class")]<br />
	[Style(name="mBodySkin", type="Class")]<br />
	[Style(name="rCSkin", type="Class")]<br />
	[Style(name="lCSkin", type="Class")]</p>
<p>	public class XpMessageWindow extends UIComponent {</p>
<p>		protected var _editable:Boolean = true;</p>
<p>		protected var _wordWrap:Boolean = true;</p>
<p>		protected var _verticalScrollPolicy:String = ScrollPolicy.AUTO;</p>
<p>		protected var _windowsThemeColor:String = &#8220;Blue&#8221;;</p>
<p>		protected var _verticalScrollBar:UIScrollBar;</p>
<p>        protected var _html:Boolean = false;</p>
<p>		protected var _savedHTML:String;</p>
<p>		protected var textHasChanged:Boolean = false;</p>
<p>		private var defaultIt:TextFormat = new TextFormat(&#8221;Arial&#8221;, 12, 0&#215;006600, false, false, false, &#8220;&#8221;, &#8220;&#8221;, &#8220;left&#8221;, 0, 0, 0, 0);</p>
<p>		private static var defaultStyles:Object = {<br />
												upSkin:&#8221;TextArea_upSkin&#8221;,<br />
												disabledSkin:&#8221;TextArea_disabledSkin&#8221;,<br />
												focusRectSkin:null,<br />
												focusRectPadding:null,<br />
												textFormat:&#8221;defaultIt&#8221;, disabledTextFormat:null,<br />
												textPadding:3,<br />
												embedFonts:false<br />
												};</p>
<p>		protected static var winDefaultStyles:Object = {<br />
												lBarSkin:&#8221;leftbar&#8221;,<br />
												rBarSkin:&#8221;rightbar&#8221;,<br />
												tHSkin:&#8221;toplevelblue&#8221;,<br />
												tLSkin:&#8221;lowlevelblue&#8221;,<br />
												bBarSkin:&#8221;bottombar&#8221;,<br />
												mBodySkin:&#8221;mBodyWin&#8221;,<br />
												rCSkin:&#8221;rightcorner&#8221;,<br />
												lCSkin:&#8221;leftcorner&#8221;<br />
												};</p>
<p>		protected static const SCROLL_BAR_STYLES:Object = {<br />
												downArrowDisabledSkin:&#8221;downArrowDisabledSkin&#8221;,<br />
												downArrowDownSkin:&#8221;downArrowDownSkin&#8221;,<br />
												downArrowOverSkin:&#8221;downArrowOverSkin&#8221;,<br />
												downArrowUpSkin:&#8221;downArrowUpSkin&#8221;,<br />
												upArrowDisabledSkin:&#8221;upArrowDisabledSkin&#8221;,<br />
												upArrowDownSkin:&#8221;upArrowDownSkin&#8221;,<br />
												upArrowOverSkin:&#8221;upArrowOverSkin&#8221;,<br />
												upArrowUpSkin:&#8221;upArrowUpSkin&#8221;,<br />
												thumbDisabledSkin:&#8221;thumbDisabledSkin&#8221;,<br />
												thumbDownSkin:&#8221;thumbDownSkin&#8221;,<br />
												thumbOverSkin:&#8221;thumbOverSkin&#8221;,<br />
												thumbUpSkin:&#8221;thumbUpSkin&#8221;,<br />
												thumbIcon:&#8221;thumbIcon&#8221;,<br />
												trackDisabledSkin:&#8221;trackDisabledSkin&#8221;,<br />
												trackDownSkin:&#8221;trackDownSkin&#8221;,<br />
												trackOverSkin:&#8221;trackOverSkin&#8221;,<br />
												trackUpSkin:&#8221;trackUpSkin&#8221;,<br />
												repeatDelay:&#8221;repeatDelay&#8221;,<br />
												repeatInterval:&#8221;repeatInterval&#8221;<br />
												};</p>
<p>		public static function getStyleDefinition():Object {<br />
			return UIComponent.mergeStyles(defaultStyles, ScrollBar.getStyleDefinition());<br />
			return winDefaultStyles;<br />
		}</p>
<p>		public static var createAccessibilityImplementation:Function;</p>
<p>		public function XpMessageWindow() {<br />
			super();<br />
			trace(&#8221;new window&#8221;);<br />
		}<br />
		//my variables<br />
		public var windowMC:MovieClip;<br />
		public var choiceBtnMC:MovieClip;<br />
		public var closeBtn:MovieClip;</p>
<p>		private var mBody:MovieClip;<br />
		private var blueHigh:MovieClip;<br />
		private var blueLow:MovieClip;<br />
		private var rCorner:MovieClip;<br />
		private var lCorner:MovieClip;<br />
		private var bBar:MovieClip;<br />
		private var rBar:MovieClip;<br />
		private var lBar:MovieClip;<br />
		private var x_close:MovieClip;</p>
<p>		private var backDrop:Sprite;</p>
<p>		public var msgTxt:TextField;</p>
<p>		private var whiteTitle:TextFormat = new TextFormat();</p>
<p>		private var blackTitle:TextFormat = new TextFormat();</p>
<p>		private var blackBody:TextFormat = new TextFormat();</p>
<p>		private var bodyTxtFormat:TextFormat = new TextFormat();</p>
<p>		private var titleTxtFormat:TextFormat = new TextFormat();</p>
<p>		//end my variables</p>
<p>		//my inspectables<br />
		[Inspectable(name="Body Width",type="Number",defaultValue=300)]<br />
		public var bodyWidth:Number=300;</p>
<p>		[Inspectable(name = "Main Body Height", type="Number", defaultValue=100)]<br />
		public var bodyHeight:Number = 100;</p>
<p>		[Inspectable(name = "Message Title Text", type="String", defaultValue="Message Window Title")]<br />
		public var titletext:String = &#8220;Message Window Title&#8221;;</p>
<p>		[Inspectable(name = "Window Response Button Text", type="String", defaultValue="OK")]<br />
		public var btnTxt:String = &#8220;OK&#8221;;</p>
<p>		/*[Inspectable(name = "Windows Theme Color", defaultValue="Blue", enumeration="Blue,Silver,Olive Green")]<br />
		public function get windowsThemeColor():String {<br />
			return _windowsThemeColor;<br />
		}*/</p>
<p>		//backdrop or not<br />
		[Inspectable(name="Backdrop?",type="Boolean",defaultValue="false")]<br />
		public var backDropVar:Boolean = false;</p>
<p>		[Inspectable(name="Backdrop Alpha Value",type="Number",defaultValue=.75)]<br />
		public var bDAlpha:Number = .75;</p>
<p>		[Inspectable(name="BackDrop Color",type="uint",defaultValue=0x000000)]<br />
		public var bDColorVal:uint = 0&#215;000000;</p>
<p>		//body text format options<br />
		[Inspectable(name = "Message Text Font", type="String", defaultValue="Arial")]<br />
		public var txtFont:String = &#8220;Arial&#8221;;</p>
<p>		[Inspectable(name = "Message Text Color", type="uint", defaultValue=0x000000)]<br />
		public var txtColor:uint = 0&#215;000000;</p>
<p>		[Inspectable(name = "Message Text Size", type="Number", defaultValue=12)]<br />
		public var txtSize:Number = 12;</p>
<p>		//title text format options<br />
		[Inspectable(name = "Title Text Font", type="String", defaultValue="Arial")]<br />
		public var titleTxtFont:String = &#8220;Arial&#8221;;</p>
<p>		[Inspectable(name = "Title Text Color", type="uint", defaultValue=0x000000)]<br />
		public var titleTxtColor:uint = 0xFFFFFF;</p>
<p>		[Inspectable(name = "Title Text Size", type="Number", defaultValue=12)]<br />
		public var titleTxtSize:Number = 14;<br />
		//end my inspectables</p>
<p>		public function get verticalScrollBar():UIScrollBar {<br />
			return _verticalScrollBar;<br />
		}		</p>
<p>		[Inspectable(defaultValue=true, verbose=1)]</p>
<p>		override public function get enabled():Boolean {<br />
			return super.enabled;<br />
		}</p>
<p>		override public function set enabled(value:Boolean):void {<br />
			super.enabled = value;<br />
			mouseChildren = enabled;  //Disables mouseWheel interaction.<br />
			invalidate(InvalidationType.STATE);<br />
		}</p>
<p>        [Inspectable(name="Non-HTML Text",defaultValue="")]</p>
<p>		public function get text():String {<br />
			return msgTxt.text;<br />
		}</p>
<p>		public function set text(value:String):void {<br />
			if (componentInspectorSetting &amp;&amp; value == &#8220;&#8221 <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> {<br />
				return;<br />
			}</p>
<p>			msgTxt.text = value;<br />
			_html = false;<br />
			invalidate(InvalidationType.DATA);<br />
			invalidate(InvalidationType.STYLES);<br />
			textHasChanged = true;<br />
		}</p>
<p>		[Inspectable(name="Message Body Text")]</p>
<p>		public function get htmlText():String {<br />
			return msgTxt.htmlText;<br />
		}</p>
<p>		public function set htmlText(value:String):void {<br />
			if (componentInspectorSetting &amp;&amp; value == &#8220;&#8221 <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> {<br />
				return;<br />
			}<br />
			if (value == &#8220;&#8221 <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> {<br />
				text = &#8220;&#8221;;<br />
				return;<br />
			}<br />
			_html = true;<br />
			_savedHTML = value;<br />
			msgTxt.htmlText = value;<br />
			invalidate(InvalidationType.DATA);<br />
			invalidate(InvalidationType.STYLES);<br />
			textHasChanged = true;<br />
		}</p>
<p>		[Inspectable(defaultValue="auto", enumeration="auto,on,off")]</p>
<p>		public function get verticalScrollPolicy():String {<br />
			return _verticalScrollPolicy;<br />
		}</p>
<p>		public function set verticalScrollPolicy(value:String):void {<br />
			_verticalScrollPolicy = value;<br />
			invalidate(InvalidationType.SIZE);<br />
		}</p>
<p>		public function get verticalScrollPosition():Number {<br />
			return msgTxt.scrollV;<br />
		}</p>
<p>		public function set verticalScrollPosition(value:Number):void {<br />
			// We must force a redraw to ensure that the size is up to date.<br />
			drawNow();<br />
			msgTxt.scrollV = value;<br />
		}</p>
<p>		public function get textWidth():Number {<br />
			drawNow();<br />
			return msgTxt.textWidth;<br />
		}</p>
<p>		public function get textHeight():Number {<br />
			drawNow();<br />
			return msgTxt.textHeight;<br />
		}</p>
<p>		public function get length():Number {<br />
			return msgTxt.text.length;<br />
		}</p>
<p>		public function get maxVerticalScrollPosition():int {<br />
			return msgTxt.maxScrollV;<br />
		}</p>
<p>        [Inspectable(name="Word Wrap?",defaultValue="true")]</p>
<p>		public function get wordWrap():Boolean {<br />
			return _wordWrap;<br />
		}</p>
<p>		public function set wordWrap(value:Boolean):void {<br />
			_wordWrap = value;<br />
			invalidate(InvalidationType.STATE);<br />
		}</p>
<p>		public function getLineMetrics(lineIndex:int):TextLineMetrics {<br />
			return msgTxt.getLineMetrics(lineIndex);<br />
		}</p>
<p>		public function appendText(text:String):void {<br />
			windowMC.	msgTxt.appendText(text);<br />
			invalidate(InvalidationType.DATA);<br />
		}</p>
<p>		override protected function configUI():void {<br />
			super.configUI();<br />
			tabChildren = true;</p>
<p>			windowMC=new MovieClip();<br />
			backDrop=new Sprite();<br />
			stage.addChild(backDrop);<br />
			stage.addChild(windowMC);</p>
<p>			msgTxt = new TextField();<br />
			windowMC.addChild(msgTxt);<br />
			updateTextFieldType();</p>
<p>			_verticalScrollBar = new UIScrollBar();<br />
			_verticalScrollBar.name = &#8220;V&#8221;;<br />
			_verticalScrollBar.visible = false;<br />
			_verticalScrollBar.focusEnabled = false;<br />
			copyStylesToChild(_verticalScrollBar, SCROLL_BAR_STYLES);<br />
			_verticalScrollBar.addEventListener(ScrollEvent.SCROLL,handleScroll,false,0,true);<br />
			windowMC.addChild(_verticalScrollBar);</p>
<p>			msgTxt.addEventListener(TextEvent.TEXT_INPUT, handleTextInput, false, 0, true);<br />
			msgTxt.addEventListener(Event.CHANGE, handleChange, false, 0, true);<br />
			msgTxt.addEventListener(KeyboardEvent.KEY_DOWN, handleKeyDown, false, 0, true);</p>
<p>			_verticalScrollBar.scrollTarget = msgTxt;<br />
			addEventListener(MouseEvent.MOUSE_WHEEL, handleWheel, false, 0, true);<br />
		}</p>
<p>		protected function updateTextFieldType():void {<br />
			with(windowMC) {<br />
				msgTxt.type = (enabled &amp;&amp; _editable) ? TextFieldType.INPUT : TextFieldType.DYNAMIC;<br />
				msgTxt.selectable = enabled;<br />
				msgTxt.wordWrap = _wordWrap;<br />
				msgTxt.multiline = true;<br />
			}<br />
		}</p>
<p>		protected function handleKeyDown(event:KeyboardEvent):void {<br />
			if (event.keyCode == Keyboard.ENTER) {<br />
				dispatchEvent(new ComponentEvent(ComponentEvent.ENTER, true));<br />
			}<br />
		}</p>
<p>		protected function handleChange(event:Event):void {<br />
			event.stopPropagation(); // so you don&#8217;t get two change events<br />
			dispatchEvent(new Event(Event.CHANGE, true));<br />
			invalidate(InvalidationType.DATA);<br />
		}</p>
<p>		protected function handleTextInput(event:TextEvent):void {<br />
			event.stopPropagation();<br />
			dispatchEvent(new TextEvent(TextEvent.TEXT_INPUT, true, false, event.text));<br />
		}</p>
<p>		protected function handleScroll(event:ScrollEvent):void {<br />
			dispatchEvent(event);<br />
		}</p>
<p>		protected function handleWheel(event:MouseEvent):void {<br />
			if (!enabled || !_verticalScrollBar.visible) { return; }<br />
			_verticalScrollBar.scrollPosition -= event.delta * _verticalScrollBar.lineScrollSize;<br />
			dispatchEvent(new ScrollEvent(ScrollBarDirection.VERTICAL, event.delta * _verticalScrollBar.lineScrollSize, _verticalScrollBar.scrollPosition));<br />
		}</p>
<p>		protected function setEmbedFont() {<br />
			var embed:Object = getStyleValue(&#8221;embedFonts&#8221;);<br />
			if (embed != null) {<br />
				msgTxt.embedFonts = embed;<br />
			}<br />
		}</p>
<p>		override protected function draw():void {<br />
			trace(&#8217;Message Window : draw&#8217;);<br />
			if (isInvalid(InvalidationType.STATE)) {<br />
				updateTextFieldType();<br />
			}</p>
<p>			if (isInvalid(InvalidationType.STYLES)) {<br />
				setStyles();<br />
				setEmbedFont();<br />
			}</p>
<p>			if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)) {<br />
				drawTextFormat();<br />
				invalidate(InvalidationType.SIZE, false);<br />
			}</p>
<p>			if (isInvalid(InvalidationType.SIZE, InvalidationType.DATA)) {<br />
				drawLayout();<br />
			}</p>
<p>			super.draw();</p>
<p>		}</p>
<p>		protected function setStyles():void {<br />
			copyStylesToChild(_verticalScrollBar, SCROLL_BAR_STYLES);<br />
		}</p>
<p>		protected function drawTextFormat():void {<br />
			// Apply a default textformat<br />
			var uiStyles:Object = UIComponent.getStyleDefinition();<br />
			var defaultTF:TextFormat = enabled ? uiStyles.defaultTextFormat as TextFormat : uiStyles.defaultDisabledTextFormat as TextFormat;<br />
			msgTxt.setTextFormat(defaultTF);</p>
<p>			var tf:TextFormat = getStyleValue(enabled?&#8221;textFormat&#8221;:&#8221;disabledTextFormat&#8221 <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> as TextFormat;<br />
			if (tf != null) {<br />
				msgTxt.setTextFormat(tf);<br />
			} else {<br />
				tf = defaultTF;<br />
			}<br />
			msgTxt.defaultTextFormat = tf;</p>
<p>			setEmbedFont();<br />
			if (_html) {<br />
				msgTxt.htmlText = _savedHTML;<br />
			}<br />
		}</p>
<p>		protected function drawLayout():void {<br />
			trace(&#8217;Message Window : drawLayout&#8217;);<br />
			if (backDropVar == true) {<br />
				backDrop.graphics.beginFill(bDColorVal, bDAlpha);<br />
				backDrop.graphics.drawRect(0,0,stage.stageWidth,stage.stageHeight);<br />
				backDrop.graphics.endFill();<br />
			}<br />
			mBody = new mBodyWin();<br />
			blueHigh = new toplevelblue();<br />
			blueLow = new lowlevelblue();<br />
			rCorner = new rightcorner();<br />
			lCorner = new leftcorner();<br />
			rBar = new rightbar();<br />
			lBar = new leftbar();<br />
			bBar =  new bottombar();<br />
			x_close = new xclose();<br />
			windowMC.addChild(mBody);<br />
			windowMC.addChild(blueHigh);<br />
			windowMC.addChild(blueLow);<br />
			windowMC.addChild(rCorner);<br />
			windowMC.addChild(lCorner);<br />
			windowMC.addChild(bBar);<br />
			windowMC.addChild(rBar);<br />
			windowMC.addChild(lBar);<br />
			windowMC.addChild(x_close);<br />
			whiteTitle.color = 0xFFFFFF;<br />
			whiteTitle.font = &#8220;Arial&#8221;;<br />
			whiteTitle.size = 14;</p>
<p>			blackTitle.color = 0&#215;000000;<br />
			blackTitle.font = &#8220;Arial&#8221;;<br />
			blackTitle.size = 14;</p>
<p>			blackBody.color = 0&#215;000000;<br />
			blackBody.font = &#8220;Arial&#8221;;<br />
			blackBody.size = 12;</p>
<p>			bodyTxtFormat.color = txtColor;<br />
			bodyTxtFormat.font = txtFont;<br />
			bodyTxtFormat.size = txtSize;</p>
<p>			titleTxtFormat.color = titleTxtColor;<br />
			titleTxtFormat.font = titleTxtFont;<br />
			titleTxtFormat.size = titleTxtSize;</p>
<p>			with(windowMC) {<br />
				mBody.x = 0;<br />
				mBody.y = blueLow.y+blueHigh.height+blueLow.height;<br />
				mBody.width = bodyWidth;<br />
				mBody.height = bodyHeight;<br />
				//top half of top blue bar<br />
				blueHigh.x = 6.8;<br />
				blueHigh.y = 0;<br />
				blueHigh.width = mBody.width - rCorner.width - lCorner.width;<br />
				//low half of top blue bar<br />
				blueLow.x = 0;<br />
				blueLow.y = blueHigh.height+blueHigh.y;<br />
				blueLow.width = mBody.width;<br />
				//Right corner top<br />
				rCorner.x = blueHigh.x+blueHigh.width;<br />
				rCorner.y = 0;<br />
				//left corner top<br />
				lCorner.x = 6.8;<br />
				lCorner.y = 0;<br />
				//bottom blue bar<br />
				bBar.x = mBody.x;<br />
				bBar.y = mBody.y + mBody.height - bBar.height;<br />
				bBar.width = mBody.width;<br />
				//left blue bar<br />
				lBar.x = mBody.x;<br />
				lBar.y = mBody.y;<br />
				lBar.height = mBody.height;<br />
				//right blue bar<br />
				rBar.x = mBody.x+mBody.width;<br />
				rBar.y = mBody.y;<br />
				rBar.height = mBody.height;<br />
				//red x close button<br />
				x_close.x = blueLow.width - 25.2;<br />
				x_close.y = 5;<br />
				//text block<br />
				msgTxt.multiline = true;<br />
				msgTxt.wordWrap = true;<br />
				msgTxt.defaultTextFormat = bodyTxtFormat;<br />
				msgTxt.mouseEnabled = false;<br />
				msgTxt.x = mBody.x+10;<br />
				msgTxt.y = mBody.y+10;</p>
<p>				var availHeight:Number = msgTxt.height;<br />
				var vScrollBar:Boolean = needVScroll();</p>
<p>				// Size and move the scrollBars<br />
				if (vScrollBar) {<br />
					_verticalScrollBar.visible = true;<br />
					_verticalScrollBar.x = msgTxt.width+5;<br />
					_verticalScrollBar.y = msgTxt.y;<br />
					_verticalScrollBar.height = availHeight;<br />
					_verticalScrollBar.visible = true;<br />
					_verticalScrollBar.enabled = enabled;<br />
					msgTxt.width = mBody.width - 20 - _verticalScrollBar.width;<br />
					msgTxt.height = mBody.height - 40;<br />
				} else {<br />
					_verticalScrollBar.visible = false;<br />
					msgTxt.width = mBody.width - 20;<br />
					msgTxt.height = mBody.height - 40;<br />
					//msgTxt.autoSize = TextFieldAutoSize.CENTER;<br />
					msgTxt.defaultTextFormat = bodyTxtFormat;<br />
				}<br />
				//Title Text Block<br />
				var titleTxt:TextField = new TextField();<br />
				addChild(titleTxt);<br />
				titleTxt.defaultTextFormat = titleTxtFormat;<br />
				titleTxt.mouseEnabled = false;<br />
				titleTxt.x = 1.8;<br />
				titleTxt.y = 4.0;<br />
				titleTxt.width = blueLow.width - x_close.width - 25.2;<br />
				if (titletext != &#8220;&#8221 <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> {<br />
					titleTxt.htmlText = &#8220;<b>&#8220;+titletext+&#8221;</b>&#8220;;<br />
					titleTxt.defaultTextFormat = titleTxtFormat;<br />
				} else {<br />
					titleTxt.text = &#8220;&#8221;;<br />
					titleTxt.defaultTextFormat = titleTxtFormat;<br />
				}<br />
				//choice button<br />
				var newBtn:choicebtn = new choicebtn();<br />
				windowMC.addChild(newBtn);<br />
				choiceBtnMC = new MovieClip();<br />
				choiceBtnMC = newBtn;<br />
				choiceBtnMC.x = (mBody.width/2) - (choiceBtnMC.width/2);<br />
				choiceBtnMC.y = mBody.height;<br />
				choiceBtnMC.choiceTxt.text = btnTxt;<br />
				choiceBtnMC.mouseChildren = false;<br />
				choiceBtnMC.addEventListener(MouseEvent.ROLL_OVER, mouseOverHandler);<br />
				choiceBtnMC.addEventListener(MouseEvent.ROLL_OUT, mouseOutHandler);<br />
				choiceBtnMC.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);<br />
				//Red X Button<br />
				closeBtn = new MovieClip();<br />
				closeBtn = x_close;<br />
				closeBtn.mouseChildren = false;<br />
				closeBtn.addEventListener(MouseEvent.ROLL_OVER, mouseOverHandler);<br />
				closeBtn.addEventListener(MouseEvent.ROLL_OUT, mouseOutHandler);<br />
				closeBtn.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);<br />
				//}<br />
				blueHigh.addEventListener(MouseEvent.MOUSE_DOWN, windowStartDrag);<br />
				blueLow.addEventListener(MouseEvent.MOUSE_DOWN, windowStartDrag);<br />
				lCorner.addEventListener(MouseEvent.MOUSE_DOWN, windowStartDrag);<br />
				rCorner.addEventListener(MouseEvent.MOUSE_DOWN, windowStartDrag);<br />
				blueHigh.addEventListener(MouseEvent.MOUSE_UP, windowStopDrag);<br />
				blueLow.addEventListener(MouseEvent.MOUSE_UP, windowStopDrag);<br />
				lCorner.addEventListener(MouseEvent.MOUSE_UP, windowStopDrag);<br />
				rCorner.addEventListener(MouseEvent.MOUSE_UP, windowStopDrag);<br />
			}<br />
			windowMC.x = (stage.stageWidth-bodyWidth)/2;<br />
			windowMC.y = (stage.stageHeight-bodyHeight)/2;<br />
			windowMC.swapChildren(msgTxt, mBody);<br />
			windowMC.swapChildren(msgTxt, _verticalScrollBar);</p>
<p>			updateScrollBars();	</p>
<p>			addEventListener(Event.ENTER_FRAME, delayedLayoutUpdate, false, 0, true);<br />
		}</p>
<p>		protected function delayedLayoutUpdate(event:Event):void {<br />
			if (textHasChanged) {<br />
				textHasChanged = false;<br />
				drawLayout();<br />
				return;<br />
			}<br />
			removeEventListener(Event.ENTER_FRAME, delayedLayoutUpdate);<br />
		}</p>
<p>		protected function updateScrollBars() {<br />
			_verticalScrollBar.update();<br />
			_verticalScrollBar.enabled = enabled;<br />
			_verticalScrollBar.drawNow();<br />
		}</p>
<p>		protected function needVScroll():Boolean {<br />
			if (windowMC._verticalScrollPolicy == ScrollPolicy.OFF) { return false; }<br />
			if (windowMC._verticalScrollPolicy == ScrollPolicy.ON) { return true; }<br />
			return (msgTxt.maxScrollV &gt; 1);<br />
		}</p>
<p>//////////////////////////////////////////////////////////////////////////////////////////////////////////////////<br />
//my functions<br />
		private function mouseOverHandler(evt:Event):void {<br />
			evt.target.gotoAndStop(2);<br />
		}<br />
		private function mouseOutHandler(evt:Event):void {<br />
			evt.target.gotoAndStop(1);<br />
		}<br />
		private function mouseDownHandler(evt:Event):void {<br />
			evt.target.gotoAndStop(3);<br />
			evt.target.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);<br />
		}<br />
		private function mouseUpHandler(evt:Event):void {<br />
			evt.target.gotoAndStop(1);<br />
			stage.removeChild(windowMC);<br />
			stage.removeChild(backDrop);<br />
		}<br />
		private function closeHandler(evt:Event):void {<br />
			stage.removeChild(windowMC);<br />
			stage.removeChild(backDrop);<br />
		}//////////////////////////////////////////////////////////////////////////////////////////////////////////////////<br />
		private function windowStartDrag(evt:Event):void {<br />
			evt.target.parent.startDrag();<br />
		}<br />
		private function windowStopDrag(evt:Event):void {<br />
			evt.target.parent.stopDrag();<br />
		}<br />
		//end my functions<br />
	}<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Flash CS3 component creation : SWC to FLA by saumya</title>
		<link>http://saumyaray.wordpress.com/2007/12/11/flash-cs3-component-creation-swc-to-fla/#comment-2679</link>
		<dc:creator>saumya</dc:creator>
		<pubDate>Tue, 06 May 2008 03:48:44 +0000</pubDate>
		<guid isPermaLink="false">http://saumyaray.wordpress.com/2007/12/11/flash-cs3-component-creation-swc-to-fla/#comment-2679</guid>
		<description>For a button you need to import other classes while doing your component. The one and most obvious class is 'SimpleButton'.Just import this class and it should be fine or else I have to go through your source code for the component.
This example shows the basic method of creating a component.I hope I will get some time to write down further, regarding skinning and other aspects of the component. Till then my suggestion would be join FlashMove or Flash-DB forum and ask the questions there, I am sure you will never be disappointed.</description>
		<content:encoded><![CDATA[<p>For a button you need to import other classes while doing your component. The one and most obvious class is &#8216;SimpleButton&#8217;.Just import this class and it should be fine or else I have to go through your source code for the component.<br />
This example shows the basic method of creating a component.I hope I will get some time to write down further, regarding skinning and other aspects of the component. Till then my suggestion would be join FlashMove or Flash-DB forum and ask the questions there, I am sure you will never be disappointed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Flash CS3 component creation : SWC to FLA by Jonathon</title>
		<link>http://saumyaray.wordpress.com/2007/12/11/flash-cs3-component-creation-swc-to-fla/#comment-2678</link>
		<dc:creator>Jonathon</dc:creator>
		<pubDate>Mon, 05 May 2008 19:33:35 +0000</pubDate>
		<guid isPermaLink="false">http://saumyaray.wordpress.com/2007/12/11/flash-cs3-component-creation-swc-to-fla/#comment-2678</guid>
		<description>I've done this now but one of my component assets is a button with 3 frames, and a stop layer action, it cause an error that says it was ignored everytime.  How do I avoid this?  

Also, I know you can skin an FLA based component, how would I add skinning to this?</description>
		<content:encoded><![CDATA[<p>I&#8217;ve done this now but one of my component assets is a button with 3 frames, and a stop layer action, it cause an error that says it was ignored everytime.  How do I avoid this?  </p>
<p>Also, I know you can skin an FLA based component, how would I add skinning to this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Flash CS3 component creation : The process by saumya</title>
		<link>http://saumyaray.wordpress.com/2007/12/07/flash-cs3-component-creation-the-process/#comment-2677</link>
		<dc:creator>saumya</dc:creator>
		<pubDate>Wed, 30 Apr 2008 04:04:32 +0000</pubDate>
		<guid isPermaLink="false">http://saumyaray.wordpress.com/2007/12/07/flash-cs3-component-creation-the-process/#comment-2677</guid>
		<description>Hi Jonathon,
I am happy that you got the answer.
Happy Flashing :)</description>
		<content:encoded><![CDATA[<p>Hi Jonathon,<br />
I am happy that you got the answer.<br />
Happy Flashing <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Flash CS3 component creation : The process by Jonathon</title>
		<link>http://saumyaray.wordpress.com/2007/12/07/flash-cs3-component-creation-the-process/#comment-2676</link>
		<dc:creator>Jonathon</dc:creator>
		<pubDate>Tue, 29 Apr 2008 14:56:59 +0000</pubDate>
		<guid isPermaLink="false">http://saumyaray.wordpress.com/2007/12/07/flash-cs3-component-creation-the-process/#comment-2676</guid>
		<description>Nevermind, figured it out.  It's because I have semicolons ending each one and apparently with inspectables you can't have that.  Thanks.</description>
		<content:encoded><![CDATA[<p>Nevermind, figured it out.  It&#8217;s because I have semicolons ending each one and apparently with inspectables you can&#8217;t have that.  Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Flash CS3 component creation : The process by Jonathon</title>
		<link>http://saumyaray.wordpress.com/2007/12/07/flash-cs3-component-creation-the-process/#comment-2675</link>
		<dc:creator>Jonathon</dc:creator>
		<pubDate>Tue, 29 Apr 2008 13:42:33 +0000</pubDate>
		<guid isPermaLink="false">http://saumyaray.wordpress.com/2007/12/07/flash-cs3-component-creation-the-process/#comment-2675</guid>
		<description>I have the following code yet I can not get these values to appear in the property inspector.  Any ideas?  


		[Inspectable(name="Main Body Width", type="Number", defaultValue=300)];
		public var bodyWidth:Number = 300;

		[Inspectable(name = "Main Body Height", type="Number", defaultValue=100)];
		public var bodyHeight:Number;

		[Inspectable(name = "Scroll Bar Value", type="Number", defaultValue="0")];
		public var scrollBarVal:Number;

		[Inspectable(name = "Stage Height", type="Number", defaultValue="400")];
		public var stageHeight:Number;

		[Inspectable(name = "Stage Width", type="Number", defaultValue="750")];
		public var stageWidth:Number;

		[Inspectable(name = "X Position", type="Number", defaultValue="225")];
		public var xPosVal:Number;

		[Inspectable(name = "Y Position", type="Number", defaultValue="116")];
		public var yPosVal:Number;

		[Inspectable(name = "Message Text", type="String", defaultValue="Message Text in Window")];
		public var msgText:String;

		[Inspectable(name = "Message Title Text", type="String", defaultValue="Message Window Title")];
		public var titletext:String;</description>
		<content:encoded><![CDATA[<p>I have the following code yet I can not get these values to appear in the property inspector.  Any ideas?  </p>
<p>		[Inspectable(name="Main Body Width", type="Number", defaultValue=300)];<br />
		public var bodyWidth:Number = 300;</p>
<p>		[Inspectable(name = "Main Body Height", type="Number", defaultValue=100)];<br />
		public var bodyHeight:Number;</p>
<p>		[Inspectable(name = "Scroll Bar Value", type="Number", defaultValue="0")];<br />
		public var scrollBarVal:Number;</p>
<p>		[Inspectable(name = "Stage Height", type="Number", defaultValue="400")];<br />
		public var stageHeight:Number;</p>
<p>		[Inspectable(name = "Stage Width", type="Number", defaultValue="750")];<br />
		public var stageWidth:Number;</p>
<p>		[Inspectable(name = "X Position", type="Number", defaultValue="225")];<br />
		public var xPosVal:Number;</p>
<p>		[Inspectable(name = "Y Position", type="Number", defaultValue="116")];<br />
		public var yPosVal:Number;</p>
<p>		[Inspectable(name = "Message Text", type="String", defaultValue="Message Text in Window")];<br />
		public var msgText:String;</p>
<p>		[Inspectable(name = "Message Title Text", type="String", defaultValue="Message Window Title")];<br />
		public var titletext:String;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Flash-XML [ Part 2] by Dinesh</title>
		<link>http://saumyaray.wordpress.com/2006/06/22/flash-xml-part-2/#comment-2674</link>
		<dc:creator>Dinesh</dc:creator>
		<pubDate>Tue, 29 Apr 2008 07:58:10 +0000</pubDate>
		<guid isPermaLink="false">https://saumyaray.wordpress.com/2006/06/22/flash-xml-part-2/#comment-2674</guid>
		<description>Thanks for your tips and time.

Dinesh</description>
		<content:encoded><![CDATA[<p>Thanks for your tips and time.</p>
<p>Dinesh</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Flash-XML [ Part 2] by saumya</title>
		<link>http://saumyaray.wordpress.com/2006/06/22/flash-xml-part-2/#comment-2673</link>
		<dc:creator>saumya</dc:creator>
		<pubDate>Mon, 28 Apr 2008 10:48:04 +0000</pubDate>
		<guid isPermaLink="false">https://saumyaray.wordpress.com/2006/06/22/flash-xml-part-2/#comment-2673</guid>
		<description>If you are new to actionscript, just search in here, I had posted some tips regarding the getting started with actionscript.Read the question answers at the forum, ask your doubts there.And yes, if you can get Essential Actionscript 3 (essential Actionscript 2, if you still want to do AS2) by coolin Mook, it would be real handy.
happy flashing</description>
		<content:encoded><![CDATA[<p>If you are new to actionscript, just search in here, I had posted some tips regarding the getting started with actionscript.Read the question answers at the forum, ask your doubts there.And yes, if you can get Essential Actionscript 3 (essential Actionscript 2, if you still want to do AS2) by coolin Mook, it would be real handy.<br />
happy flashing</p>
]]></content:encoded>
	</item>
</channel>
</rss>
