<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc = "http://purl.org/dc/elements/1.1/" xmlns="http://purl.org/rss/1.0/">
	<channel rdf:about="http://livedocs.adobe.com/">
	<title>LiveDocs Comments - flash - 9.0 - ActionScriptLangRefV3 - flash/display/DisplayObject.html</title>	
		<link>http://livedocs.adobe.com/</link>
		<description>Macromedia LiveDocs - online documentation with user feedback.</description>
		<copyright>Copyright 2009, Macromedia, Inc.</copyright>
		<dc:date>2009-11-25T00:03:20</dc:date>
		<dc:language>en-us</dc:language>
		<items>
			<rdf:Seq>
				<rdf:li rdf:resource="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObject.html#86560" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObject.html#86381" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObject.html#86368" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObject.html#74848" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObject.html#74803" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObject.html#74771" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObject.html#74736" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObject.html#67410" />
			</rdf:Seq>
		</items>
	</channel>
	
	<item rdf:about="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObject.html#86560">
		<title>flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObject.html</title>
		<link>http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObject.html#86560</link>
		<description>Working with widths and heights of Sprite objects can be tricky. Changing one of these properties is equivalent to scaling.</description>
		<dc:creator>Joe ... Ward</dc:creator>
		<dc:type>1 1</dc:type>
		<dc:date>2008-08-08T12:00:11</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObject.html#86381">
		<title>flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObject.html</title>
		<link>http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObject.html#86381</link>
		<description>Going on from the object's coordinate space versus it's parent when dealing with mouseX/mouseY (object's) and width/height (parent's), the way then to get the object's coordinate space width is to get it's bounding box with respect to itself.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;var dobj = new Sprite();&lt;br /&gt;&lt;br /&gt;dobj.graphics.beginFill( 0 );&lt;br /&gt;dobj.graphics.drawRect( 0, 0, 100, 100 );&lt;br /&gt;dobj.graphics.endFill();&lt;br /&gt;&lt;br /&gt;addChild( dobj );&lt;br /&gt;&lt;br /&gt;trace( &quot;Width unmodified :&quot;, dobj.width ); // 100&lt;br /&gt;&lt;br /&gt;dobj.width = 200;&lt;br /&gt;&lt;br /&gt;trace( &quot;Width set to 200 :&quot;, dobj.width ); // 200&lt;br /&gt;trace( &quot;Width from getBounds :&quot;, dobj.getBounds( dobj ).width ); // 100&lt;br /&gt;&lt;br /&gt;dobj.width = 50;&lt;br /&gt;&lt;br /&gt;trace( &quot;Width set to 50 :&quot;, dobj.width ); // 50&lt;br /&gt;trace( &quot;Width from getBounds :&quot;, dobj.getBounds( dobj ).width ); // 100.  Stays the same in either case.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Again, logical, but not the first thing you think of.  Or at least not the first thing I thought of.</description>
		<dc:creator>sikorsjd</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2008-08-03T17:01:03</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObject.html#86368">
		<title>flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObject.html</title>
		<link>http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObject.html#86368</link>
		<description>This is a small gotcha that, if you think about it, makes sense, but had me running around in circles for quite some time.&lt;br /&gt;&lt;br /&gt;mouseX and mouseY are calculated in local space, which is logical.  Where you get caught, however, is when you try to use it with width.  Specifically...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;// Oh noes, no labels!&lt;br /&gt;var dobj = new Sprite();&lt;br /&gt;var sdobj = new Sprite();&lt;br /&gt;&lt;br /&gt;var g = sdobj.graphics;&lt;br /&gt;&lt;br /&gt;g.beginFill( 0 );&lt;br /&gt;g.drawRect( 0, 0, 100, 100 );&lt;br /&gt;g.endFill();&lt;br /&gt;&lt;br /&gt;dobj.addChild( sdobj ); // now dobj is 100x100.&lt;br /&gt;addChild( dobj ); // just EG&lt;br /&gt;&lt;br /&gt;trace( dobj.width ); // 100&lt;br /&gt;&lt;br /&gt;dobj.width = 200;&lt;br /&gt;&lt;br /&gt;trace( dobj.width ); // 200&lt;br /&gt;&lt;br /&gt;// That's all logical...&lt;br /&gt;// Now, let's say you move the mouse over about the middle of the box on screen.&lt;br /&gt;&lt;br /&gt;trace( dobj.mouseX ); // about 50.&lt;br /&gt;&lt;br /&gt;// Move the mouse to the right end of the box.&lt;br /&gt;&lt;br /&gt;trace( dobj.mouseX / dobj.width ); // about 0.5 instead of 1!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;That last statement had me spinning wheels for quite awhile.</description>
		<dc:creator>sikorsjd</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2008-08-02T21:55:32</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObject.html#74848">
		<title>flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObject.html</title>
		<link>http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObject.html#74848</link>
		<description>dr.hc.solo, thanks for your comment. Consider a movie clip named container that contains another display object, named component. When you scale the container object, its scaleX (or scaleY) value changes. However, the component's scale values remain unchanged because it has not scaled in its coordinate space (only its parent has scaled). For this reason, the component's scale9Grid regions do not apply when the parent is scaled. Consider the following code, in which the component object's scaleX value remains constant:&lt;br&gt;&lt;br&gt;container.addChild(component);&lt;br&gt;setInterval(scaler, 1000);&lt;br&gt;&lt;br&gt;function scaler():void &lt;br&gt;{&lt;br&gt;container.scaleX += 0.1;&lt;br&gt;trace(container.scaleX); // increments&lt;br&gt;trace(component.scaleX) // remains constant&lt;br&gt;}</description>
		<dc:creator>swartz1999</dc:creator>
		<dc:type>1 1</dc:type>
		<dc:date>2007-10-11T17:28:30</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObject.html#74803">
		<title>flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObject.html</title>
		<link>http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObject.html#74803</link>
		<description>Unfortunately the scale9Grid doesn't seem to work with nested DisplayObjects. Only the outer definition is used.</description>
		<dc:creator>dr.hc.solo</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2007-10-11T06:23:13</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObject.html#74771">
		<title>flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObject.html</title>
		<link>http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObject.html#74771</link>
		<description>Sanderbot, the trace() output for a Rectangle object use w and h for the width and height. However, the properties of the Rectangle class are named width and height (not w and h).</description>
		<dc:creator>swartz1999</dc:creator>
		<dc:type>1 1</dc:type>
		<dc:date>2007-10-10T13:33:00</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObject.html#74736">
		<title>flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObject.html</title>
		<link>http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObject.html#74736</link>
		<description>The rectangle's properties returned by getBounds() do not match the Rectangle class specification. Property w should be width, for instance:&lt;br /&gt;&lt;br /&gt;var myMc: MovieClip = new MovieClip();&lt;br /&gt;myMc.x = 100;&lt;br /&gt;myMc.y = 100;&lt;br /&gt;addChild(myMc);&lt;br /&gt;&lt;br /&gt;var contents:Shape = new Shape();&lt;br /&gt;contents.graphics.drawCircle(0,0,100);&lt;br /&gt;myMc.addChild(contents);&lt;br /&gt;&lt;br /&gt;var myBoundsRect : Rectangle = myMc.getBounds(this);&lt;br /&gt;trace(myBoundsRect.toString());&lt;br /&gt;// returns (x=0, y=0, w=200, h=200)&lt;br /&gt;&lt;br /&gt;// but when you try to access the property w:&lt;br /&gt;// trace(myBoundsRect.w);&lt;br /&gt;// throws Compile Error 1119: Access of possibly undefined property w through a reference with static type flash.geom:Rectangle.&lt;br /&gt;&lt;br /&gt;// however&lt;br /&gt;trace(myBoundsRect.width);&lt;br /&gt;// returns 200&lt;br /&gt;&lt;br /&gt;var myBoundsObj : Object = myMc.getBounds(this);&lt;br /&gt;trace(myBoundsObj.toString());&lt;br /&gt;// returns (x=0, y=0, w=200, h=200)&lt;br /&gt;&lt;br /&gt;// but when you try to access the property w:&lt;br /&gt;// trace(myBoundsObj.w);&lt;br /&gt;// returns ReferenceError: Error #1069: Property w not found on flash.geom.Rectangle and there is no default value.&lt;br /&gt;&lt;br /&gt;// however&lt;br /&gt;trace(myBoundsObj.width);&lt;br /&gt;// returns 200</description>
		<dc:creator>sanderbontje</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2007-10-10T02:06:14</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObject.html#67410">
		<title>flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObject.html</title>
		<link>http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObject.html#67410</link>
		<description>Execuse me~&lt;br /&gt;I have test the example code in Flex2,  and then I found that the renderHandler() function had never been invoked, &lt;br /&gt; it is defeated when I tried to listen the 'render' event in my codes also!&lt;br /&gt;&lt;br /&gt;I am not understanding the 'render' event fairly because I am a Chinese any my English was weakness~&lt;br /&gt;Were here anyone tell me how to listen the 'render' event in hell?&lt;br /&gt;Thank you very much!</description>
		<dc:creator>xb06stu</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2007-05-26T03:59:20</dc:date>
	</item>
	</rdf:RDF>

