<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.0.4" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: LiquidGUI tutorial updated for Adobe Dev Center</title>
	<link>http://www.jamesor.com/2006/12/18/liquidgui-tutorial-updated-for-adobe-dev-center/</link>
	<description>Flash Guru</description>
	<pubDate>Thu, 21 Aug 2008 19:53:50 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.4</generator>

	<item>
		<title>by: squibn</title>
		<link>http://www.jamesor.com/2006/12/18/liquidgui-tutorial-updated-for-adobe-dev-center/#comment-16845</link>
		<pubDate>Thu, 10 Jul 2008 11:02:18 +0000</pubDate>
		<guid>http://www.jamesor.com/2006/12/18/liquidgui-tutorial-updated-for-adobe-dev-center/#comment-16845</guid>
					<description>Wah hey! Cracked it (At least I think this is the right way?!?)
If anyone is interested this is how I did it... (apologies if this isn't the right way to do it, if anyone knows a better way, please post)
I put the Grad box in a separate class and and placed it within a sprite in the Body class, like so...

package com.squibn.examples.liquidgui.ui
{
  import com.squibn.examples.liquidgui.IResizable;	
  import flash.display.Sprite;
  //
  public class BodyUI extends Sprite implements IResizable
  {    
    public static var _instance:BodyUI;
    public var bg:Sprite;
    private var _parent:Sprite;
    /**
     * Constructor
     */
    public function BodyUI (p:Sprite)
    {
      _parent = p;
      __configUI ();
    }
  	/**
  	 * Configures the user interface elements of this DisplayObject
  	 */
    private function __configUI ():void 
    {
      bg = new Sprite();
      addChild(bg);
	  
      var bottom:Base=new Base();
      bg.addChild(bottom);
	  
    }
    /**
     * Singleton implementation
     * @param   p   A reference to the parent
     * @returns BodyUI singleton instance
     */
    public static function getInstance (p:Sprite):BodyUI
    {
      if (_instance == null)
        _instance = new BodyUI (p);
      return _instance;
    }
  	/**
  	 * Implemented method of IResizable interface
  	 */
    public function setSize(w:Number, h:Number):void
    {
  		bg.width = w;
  		bg.height = h;
    }
  }
}

I know this is fairly basic stuff, but for someone (like myself) struggling to grasp AS3 this i a major breakthrough!! And might help someone else who's also learning this crazy language!:D
I love it when a plan comes together!</description>
		<content:encoded><![CDATA[<p>Wah hey! Cracked it (At least I think this is the right way?!?)<br />
If anyone is interested this is how I did it&#8230; (apologies if this isn&#8217;t the right way to do it, if anyone knows a better way, please post)<br />
I put the Grad box in a separate class and and placed it within a sprite in the Body class, like so&#8230;</p>
<p>package com.squibn.examples.liquidgui.ui<br />
{<br />
  import com.squibn.examples.liquidgui.IResizable;<br />
  import flash.display.Sprite;<br />
  //<br />
  public class BodyUI extends Sprite implements IResizable<br />
  {<br />
    public static var _instance:BodyUI;<br />
    public var bg:Sprite;<br />
    private var _parent:Sprite;<br />
    /**<br />
     * Constructor<br />
     */<br />
    public function BodyUI (p:Sprite)<br />
    {<br />
      _parent = p;<br />
      __configUI ();<br />
    }<br />
  	/**<br />
  	 * Configures the user interface elements of this DisplayObject<br />
  	 */<br />
    private function __configUI ():void<br />
    {<br />
      bg = new Sprite();<br />
      addChild(bg);</p>
<p>      var bottom:Base=new Base();<br />
      bg.addChild(bottom);</p>
<p>    }<br />
    /**<br />
     * Singleton implementation<br />
     * @param   p   A reference to the parent<br />
     * @returns BodyUI singleton instance<br />
     */<br />
    public static function getInstance (p:Sprite):BodyUI<br />
    {<br />
      if (_instance == null)<br />
        _instance = new BodyUI (p);<br />
      return _instance;<br />
    }<br />
  	/**<br />
  	 * Implemented method of IResizable interface<br />
  	 */<br />
    public function setSize(w:Number, h:Number):void<br />
    {<br />
  		bg.width = w;<br />
  		bg.height = h;<br />
    }<br />
  }<br />
}</p>
<p>I know this is fairly basic stuff, but for someone (like myself) struggling to grasp AS3 this i a major breakthrough!! And might help someone else who&#8217;s also learning this crazy language!:D<br />
I love it when a plan comes together!
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: squibn</title>
		<link>http://www.jamesor.com/2006/12/18/liquidgui-tutorial-updated-for-adobe-dev-center/#comment-16795</link>
		<pubDate>Wed, 09 Jul 2008 16:15:08 +0000</pubDate>
		<guid>http://www.jamesor.com/2006/12/18/liquidgui-tutorial-updated-for-adobe-dev-center/#comment-16795</guid>
					<description>Hi James,
I've just read your tutorial, which I found hugely helpful in my quest to gain a greater understanding of possible ways of laying out websites in AS3. I managed (only just, as I'm still quite a noobie to AS3) to follow it, but I have a question regarding the third example...

How would I go about replacing the library instances with shapes that I've created using actionscript say for example replacing the Body UI instance with a graphic I've created solely by code, like this...

package {

	import flash.display.*;
	import flash.geom.Matrix;

	public class Base extends Sprite {

		public function Base() {
			
			var gradType:String = GradientType.LINEAR;
			var matrix:Matrix = new Matrix();
			matrix.createGradientBox(950, 700, deg2rad(90), 0, 0);
			var colors:Array = [0x999999, 0x000000];
			var alphas:Array = [1, 1];
			var ratios:Array = [0, 255];
			var canvas = new Sprite();
			canvas.graphics.beginGradientFill(gradType, colors, alphas, ratios, matrix);
			canvas.graphics.drawRect(0, 0, 950, 700);
			addChild(canvas);
			
		}

		private function deg2rad(deg:Number):Number {
			return deg * Math.PI / 180;
		}
	}
}

Thanks,
Squibn</description>
		<content:encoded><![CDATA[<p>Hi James,<br />
I&#8217;ve just read your tutorial, which I found hugely helpful in my quest to gain a greater understanding of possible ways of laying out websites in AS3. I managed (only just, as I&#8217;m still quite a noobie to AS3) to follow it, but I have a question regarding the third example&#8230;</p>
<p>How would I go about replacing the library instances with shapes that I&#8217;ve created using actionscript say for example replacing the Body UI instance with a graphic I&#8217;ve created solely by code, like this&#8230;</p>
<p>package {</p>
<p>	import flash.display.*;<br />
	import flash.geom.Matrix;</p>
<p>	public class Base extends Sprite {</p>
<p>		public function Base() {</p>
<p>			var gradType:String = GradientType.LINEAR;<br />
			var matrix:Matrix = new Matrix();<br />
			matrix.createGradientBox(950, 700, deg2rad(90), 0, 0);<br />
			var colors:Array = [0&#215;999999, 0&#215;000000];<br />
			var alphas:Array = [1, 1];<br />
			var ratios:Array = [0, 255];<br />
			var canvas = new Sprite();<br />
			canvas.graphics.beginGradientFill(gradType, colors, alphas, ratios, matrix);<br />
			canvas.graphics.drawRect(0, 0, 950, 700);<br />
			addChild(canvas);</p>
<p>		}</p>
<p>		private function deg2rad(deg:Number):Number {<br />
			return deg * Math.PI / 180;<br />
		}<br />
	}<br />
}</p>
<p>Thanks,<br />
Squibn
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Raelene</title>
		<link>http://www.jamesor.com/2006/12/18/liquidgui-tutorial-updated-for-adobe-dev-center/#comment-15074</link>
		<pubDate>Mon, 26 May 2008 21:59:36 +0000</pubDate>
		<guid>http://www.jamesor.com/2006/12/18/liquidgui-tutorial-updated-for-adobe-dev-center/#comment-15074</guid>
					<description>Hello,

Thank you for providing the AS3 version of this tutorial at http://www.adobe.com/devnet/flash/articles/liquid_gui.html. (I'm interested in using this new AS3 liquid stuff because I'm using the shiny new AS3 XML stuff).

Anyways, the liquid_gui_source.zip file that I downloaded from this Adobe site doesn't have any fla files in the version folder other than in the first one. As part of the steps of version 2, I can follow renaming my LiquidGUI_v1.fla to the LiquidGUI_v2 folder and the handful of steps after that ... however, after the Linkage Properties screenshot in the Version 2 section, it says to leave the SWF file in the assets subfolder. Which SWF? The LiquidGUI_v2.swf that I think I'm generating here in the root of the new version 2 folder? I'm feeling a little disoriented about where the FLA which calls the Document class should be. 

Thanks in advance for your assistance.</description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>Thank you for providing the AS3 version of this tutorial at <a href='http://www.adobe.com/devnet/flash/articles/liquid_gui.html.' rel='nofollow'>http://www.adobe.com/devnet/flash/articles/liquid_gui.html.</a> (I&#8217;m interested in using this new AS3 liquid stuff because I&#8217;m using the shiny new AS3 XML stuff).</p>
<p>Anyways, the liquid_gui_source.zip file that I downloaded from this Adobe site doesn&#8217;t have any fla files in the version folder other than in the first one. As part of the steps of version 2, I can follow renaming my LiquidGUI_v1.fla to the LiquidGUI_v2 folder and the handful of steps after that &#8230; however, after the Linkage Properties screenshot in the Version 2 section, it says to leave the SWF file in the assets subfolder. Which SWF? The LiquidGUI_v2.swf that I think I&#8217;m generating here in the root of the new version 2 folder? I&#8217;m feeling a little disoriented about where the FLA which calls the Document class should be. </p>
<p>Thanks in advance for your assistance.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Andrew</title>
		<link>http://www.jamesor.com/2006/12/18/liquidgui-tutorial-updated-for-adobe-dev-center/#comment-14643</link>
		<pubDate>Wed, 14 May 2008 08:13:22 +0000</pubDate>
		<guid>http://www.jamesor.com/2006/12/18/liquidgui-tutorial-updated-for-adobe-dev-center/#comment-14643</guid>
					<description>I'm currently building an AS3 site with a liquid layout. Basically I've got a main menu section up the top that loads in modular content swf's to a MovieClip underneath it. I've got the basic liquid layout working, but am having problems getting the modular swf's to resize properly. at the moment I'm using:

mc_header.mc_swf2.addEventListener(MouseEvent.CLICK, bttnClick2);
mc_header.mc_swf2.buttonMode = true;
function bttnClick2(event:MouseEvent):void {

	

	var imageLdr2:Loader = new Loader();
	var imageURLReq2:URLRequest = new URLRequest( "swf2.swf" );
	imageLdr2.load(imageURLReq2);
	imageLdr2.contentLoaderInfo.addEventListener(Event.COMPLETE , imageLoaded2);

	function imageLoaded2(event:Event):void {
		imageLdr2.content.width = mc_body.width;
		imageLdr2.content.height = mc_body.height;
		mc_body.addChildAt( imageLdr2.content , 1);
		mc_body.removeChildAt(2);
	}
}


which does resize the imported swf, but is a bit unpredictable and I haven't worked out how to turn it's scaleMode off, so it's is still getting stretched. I've tried setting the scaleMode to NO_SCALE within the imported swf. Can you please suggest a better way to change the stage size of the imported swf to match the size of the area it will be loaded in to? 

Also I have a set width for the main section of my site, and have a MovieClip on either side of the main area. These movie clips have widths are just the left over area {(stage.width - "mainContent".width) / 2}. I'm using these MovieClips to load in other swf.s with animations if there is enough room. It works but seems to load the swf every frame like an ENTER_FRAME event, and I can't find out what type of event to use to only trigger the function once, if the area is wide enough. Can you please tell me what type of event to use? 


stage.addEventListener(Event.RESIZE, sizeCheck);
function sizeCheck(e:Event):void {
	if(mc_left.width = 200){
	var imageLdr3:Loader = new Loader();
	var imageURLReq3:URLRequest = new URLRequest( "anim1.swf" );
	imageLdr3.load(imageURLReq3);
	mc_loadAreaLeft.addChildAt( imageLdr3, 1);
	mc_loadAreaLeft.removeChildAt(2);
	trace("anim1 loaded");
}
}


I'm really new to flash and can't get much help at uni cause they aren't using AS3 yet. I'd love any suggestions on how better ways to do this (preferably not using external classes yet). This is just the code I've chopped and changed from tutorials I've done. 

Thanks</description>
		<content:encoded><![CDATA[<p>I&#8217;m currently building an AS3 site with a liquid layout. Basically I&#8217;ve got a main menu section up the top that loads in modular content swf&#8217;s to a MovieClip underneath it. I&#8217;ve got the basic liquid layout working, but am having problems getting the modular swf&#8217;s to resize properly. at the moment I&#8217;m using:</p>
<p>mc_header.mc_swf2.addEventListener(MouseEvent.CLICK, bttnClick2);<br />
mc_header.mc_swf2.buttonMode = true;<br />
function bttnClick2(event:MouseEvent):void {</p>
<p>	var imageLdr2:Loader = new Loader();<br />
	var imageURLReq2:URLRequest = new URLRequest( &#8220;swf2.swf&#8221; );<br />
	imageLdr2.load(imageURLReq2);<br />
	imageLdr2.contentLoaderInfo.addEventListener(Event.COMPLETE , imageLoaded2);</p>
<p>	function imageLoaded2(event:Event):void {<br />
		imageLdr2.content.width = mc_body.width;<br />
		imageLdr2.content.height = mc_body.height;<br />
		mc_body.addChildAt( imageLdr2.content , 1);<br />
		mc_body.removeChildAt(2);<br />
	}<br />
}</p>
<p>which does resize the imported swf, but is a bit unpredictable and I haven&#8217;t worked out how to turn it&#8217;s scaleMode off, so it&#8217;s is still getting stretched. I&#8217;ve tried setting the scaleMode to NO_SCALE within the imported swf. Can you please suggest a better way to change the stage size of the imported swf to match the size of the area it will be loaded in to? </p>
<p>Also I have a set width for the main section of my site, and have a MovieClip on either side of the main area. These movie clips have widths are just the left over area {(stage.width - &#8220;mainContent&#8221;.width) / 2}. I&#8217;m using these MovieClips to load in other swf.s with animations if there is enough room. It works but seems to load the swf every frame like an ENTER_FRAME event, and I can&#8217;t find out what type of event to use to only trigger the function once, if the area is wide enough. Can you please tell me what type of event to use? </p>
<p>stage.addEventListener(Event.RESIZE, sizeCheck);<br />
function sizeCheck(e:Event):void {<br />
	if(mc_left.width = 200){<br />
	var imageLdr3:Loader = new Loader();<br />
	var imageURLReq3:URLRequest = new URLRequest( &#8220;anim1.swf&#8221; );<br />
	imageLdr3.load(imageURLReq3);<br />
	mc_loadAreaLeft.addChildAt( imageLdr3, 1);<br />
	mc_loadAreaLeft.removeChildAt(2);<br />
	trace(&#8221;anim1 loaded&#8221;);<br />
}<br />
}</p>
<p>I&#8217;m really new to flash and can&#8217;t get much help at uni cause they aren&#8217;t using AS3 yet. I&#8217;d love any suggestions on how better ways to do this (preferably not using external classes yet). This is just the code I&#8217;ve chopped and changed from tutorials I&#8217;ve done. </p>
<p>Thanks
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: James O'Reilly</title>
		<link>http://www.jamesor.com/2006/12/18/liquidgui-tutorial-updated-for-adobe-dev-center/#comment-14259</link>
		<pubDate>Tue, 29 Apr 2008 21:05:15 +0000</pubDate>
		<guid>http://www.jamesor.com/2006/12/18/liquidgui-tutorial-updated-for-adobe-dev-center/#comment-14259</guid>
					<description>Well looking at the error stack there seems to be a problem with the code inside your __configUI() method, probably with a line using a "new" statement.  Are you trying to create an instance of class that doesn't exist perhaps?  Comment out lines in this method one by one to locate the problem line.</description>
		<content:encoded><![CDATA[<p>Well looking at the error stack there seems to be a problem with the code inside your __configUI() method, probably with a line using a &#8220;new&#8221; statement.  Are you trying to create an instance of class that doesn&#8217;t exist perhaps?  Comment out lines in this method one by one to locate the problem line.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Eric</title>
		<link>http://www.jamesor.com/2006/12/18/liquidgui-tutorial-updated-for-adobe-dev-center/#comment-14257</link>
		<pubDate>Tue, 29 Apr 2008 20:09:53 +0000</pubDate>
		<guid>http://www.jamesor.com/2006/12/18/liquidgui-tutorial-updated-for-adobe-dev-center/#comment-14257</guid>
					<description>I have tried to use your examples to build in Flash CS3. I can get the first two to work easily. I am having a hard time with the 3rd. I am having a very hard time finding what I am missing. This is the error that I keep getting. 

TypeError: Error #1007: Instantiation attempted on a non-constructor.
	at com.jor.examples.liquidgui.ui::HeaderUI/__configUI()
	at com.jor.examples.liquidgui.ui::HeaderUI()
	at com.jor.examples.liquidgui.ui::HeaderUI$/getInstance()
	at LiquidGUI_v3()</description>
		<content:encoded><![CDATA[<p>I have tried to use your examples to build in Flash CS3. I can get the first two to work easily. I am having a hard time with the 3rd. I am having a very hard time finding what I am missing. This is the error that I keep getting. </p>
<p>TypeError: Error #1007: Instantiation attempted on a non-constructor.<br />
	at com.jor.examples.liquidgui.ui::HeaderUI/__configUI()<br />
	at com.jor.examples.liquidgui.ui::HeaderUI()<br />
	at com.jor.examples.liquidgui.ui::HeaderUI$/getInstance()<br />
	at LiquidGUI_v3()
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: ruggero</title>
		<link>http://www.jamesor.com/2006/12/18/liquidgui-tutorial-updated-for-adobe-dev-center/#comment-13769</link>
		<pubDate>Mon, 03 Dec 2007 21:20:56 +0000</pubDate>
		<guid>http://www.jamesor.com/2006/12/18/liquidgui-tutorial-updated-for-adobe-dev-center/#comment-13769</guid>
					<description>Hi James

I'm working from a setup of; Mac OSX 10.4...Firefos v.2.0.0.2, Flash Player 9.0.

The tutorial "Version 4 completed (full working application)" http://www.adobe.com/devnet/flash/articles/liquid_gui_04.html#
does not work.

The window is fixed and cannot be resized.

Also...an error comes up in Firefox: "tocObj.SetVariable is not a function
helptoc_DoFSCommand("checkURL", "")help_toc.php (line 34)
[Break on this error] tocObj.SetVariable("content_url", parent.help_content.location.href);"

BR
Ruggero</description>
		<content:encoded><![CDATA[<p>Hi James</p>
<p>I&#8217;m working from a setup of; Mac OSX 10.4&#8230;Firefos v.2.0.0.2, Flash Player 9.0.</p>
<p>The tutorial &#8220;Version 4 completed (full working application)&#8221; <a href='http://www.adobe.com/devnet/flash/articles/liquid_gui_04.html#' rel='nofollow'>http://www.adobe.com/devnet/flash/articles/liquid_gui_04.html#</a><br />
does not work.</p>
<p>The window is fixed and cannot be resized.</p>
<p>Also&#8230;an error comes up in Firefox: &#8220;tocObj.SetVariable is not a function<br />
helptoc_DoFSCommand(&#8221;checkURL&#8221;, &#8220;&#8221;)help_toc.php (line 34)<br />
[Break on this error] tocObj.SetVariable(&#8221;content_url&#8221;, parent.help_content.location.href);&#8221;</p>
<p>BR<br />
Ruggero
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: kanu</title>
		<link>http://www.jamesor.com/2006/12/18/liquidgui-tutorial-updated-for-adobe-dev-center/#comment-8445</link>
		<pubDate>Mon, 09 Apr 2007 11:59:28 +0000</pubDate>
		<guid>http://www.jamesor.com/2006/12/18/liquidgui-tutorial-updated-for-adobe-dev-center/#comment-8445</guid>
					<description>hi james,
i saw ur article for photoalbum in flex, but i'm not able to implement that in flex.
can u pls specify what to write in mxml file and what else i have to do</description>
		<content:encoded><![CDATA[<p>hi james,<br />
i saw ur article for photoalbum in flex, but i&#8217;m not able to implement that in flex.<br />
can u pls specify what to write in mxml file and what else i have to do
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Tom</title>
		<link>http://www.jamesor.com/2006/12/18/liquidgui-tutorial-updated-for-adobe-dev-center/#comment-8024</link>
		<pubDate>Tue, 27 Mar 2007 18:53:07 +0000</pubDate>
		<guid>http://www.jamesor.com/2006/12/18/liquidgui-tutorial-updated-for-adobe-dev-center/#comment-8024</guid>
					<description>Hi James,

Not sure if this is the correct place to ask, but am a newbie at Flash and wanted to know your opinion on which way I should go? the old tutorial or the new one? I'm not actually sure what Flex Builder is??

Thanks!</description>
		<content:encoded><![CDATA[<p>Hi James,</p>
<p>Not sure if this is the correct place to ask, but am a newbie at Flash and wanted to know your opinion on which way I should go? the old tutorial or the new one? I&#8217;m not actually sure what Flex Builder is??</p>
<p>Thanks!
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: James O'Reilly</title>
		<link>http://www.jamesor.com/2006/12/18/liquidgui-tutorial-updated-for-adobe-dev-center/#comment-5600</link>
		<pubDate>Fri, 09 Feb 2007 18:39:49 +0000</pubDate>
		<guid>http://www.jamesor.com/2006/12/18/liquidgui-tutorial-updated-for-adobe-dev-center/#comment-5600</guid>
					<description>The trick is not to scale the movieclip but to scale only the children of the movieclip that need scaling.  For example, if you look at my tutorial I have a footer movieclip that has thumbnail buttons.  I don't scale the footer, instead I call a custom setSize() method on the footer that resizes only its background graphic and leaves the other children alone.  The overall affect this has alters the size of the footer movieclip but indirectly by resizing the background.  Download the source code and take a look at how this is achieved.</description>
		<content:encoded><![CDATA[<p>The trick is not to scale the movieclip but to scale only the children of the movieclip that need scaling.  For example, if you look at my tutorial I have a footer movieclip that has thumbnail buttons.  I don&#8217;t scale the footer, instead I call a custom setSize() method on the footer that resizes only its background graphic and leaves the other children alone.  The overall affect this has alters the size of the footer movieclip but indirectly by resizing the background.  Download the source code and take a look at how this is achieved.
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
