<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Flex Community Blog</title>
	<atom:link href="http://blog.flexcommunity.net/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://blog.flexcommunity.net</link>
	<description>Adobe Flex, Flash and ActionScript 3.0</description>
	<lastBuildDate>Wed, 03 Mar 2010 04:02:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>inverse &#8220;masking&#8221; in AS3</title>
		<link>http://blog.flexcommunity.net/?p=202</link>
		<comments>http://blog.flexcommunity.net/?p=202#comments</comments>
		<pubDate>Tue, 02 Mar 2010 17:15:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.flexcommunity.net/?p=202</guid>
		<description><![CDATA[Here&#8217;s a great tidbit I found on creating a reverse &#8220;masking&#8221; effect in as3: http://franto.com/inverse-masking-disclosed/ below is an example using text as an inverse mask. example A few notes: 1) this isn&#8217;t really a mask, it&#8217;s a blendMode effect, so &#8230; <a href="http://blog.flexcommunity.net/?p=202">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a great tidbit I found on creating a reverse &#8220;masking&#8221; effect in as3:</p>
<p><a href="http://franto.com/inverse-masking-disclosed/">http://franto.com/inverse-masking-disclosed/</a></p>
<p>below is an example using text as an inverse mask.<br />
<a href="http://www.tetraktysdesign.com/experiments/inversMask.swf"><br />
example</a></p>
<p>A few notes:</p>
<p>1) this isn&#8217;t really a mask, it&#8217;s a blendMode effect, so nothing actually gets set as a mask of anything else.</p>
<p>2) display order (depth) matters, as the display object we are using as the mask needs to be on top (not so with standard masks)</p>
<p>3) everything beneath the &#8216;mask&#8221; will be affected so long as it&#8217;s a child of the same parent (not so with regular masks)</p>
<p>4) if you&#8217;re using text, be sure to set selectable to false, or it can get weird! </p>
<p>5) alpha values affect the masking, if you want a full mask, have the alpha of the masking layer set to 1.</p>
<p>enjoy!<br />
<span id="more-202"></span></p>
<p>The following example loads a bitmap image, then puts a white block over the whole image. Then text is used as an &#8216;inverse mask&#8217; to &#8216;punch out&#8217; the white block and show the image through the text.</p>
<p>Note: the image is not a child of the same container the white block and the text are.</p>
<p>import flash.display.Loader;<br />
import flash.events.Event;<br />
import flash.net.URLRequest;<br />
import flash.display.*;</p>
<p>var imageLoader:Loader = new Loader();<br />
var contentContainer:Sprite = new Sprite();<br />
var textMask:TextField = new TextField();<br />
var whiteBlock:Sprite = new Sprite();</p>
<p>init();</p>
<p>function init():void{</p>
<p>	contentContainer.blendMode = &#8220;layer&#8221;;<br />
	addChild(contentContainer);<br />
	imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageCompleteHandler);<br />
	imageLoader.load(new URLRequest(&#8216;http://i.ehow.com/images/GlobalPhoto/Articles/4456649/seascape-main_Full.jpg&#8217;));</p>
<p>}</p>
<p>function imageCompleteHandler(event:Event):void{<br />
 addChild(imageLoader);<br />
 setWhiteBlock();<br />
 setTextMask();<br />
 this.setChildIndex(imageLoader,0);<br />
}</p>
<p>function setWhiteBlock():void{<br />
	whiteBlock.graphics.beginFill(0xffffff);<br />
	whiteBlock.graphics.drawRect(0,0,550,400);<br />
	whiteBlock.graphics.endFill();<br />
	contentContainer.addChild(whiteBlock);<br />
}</p>
<p>function setTextMask():void{</p>
<p>	var labelFormat:TextFormat = new TextFormat();<br />
	labelFormat.font = &#8220;Arial&#8221;;<br />
	labelFormat.bold = true;<br />
	labelFormat.color = 0xff0000;<br />
	labelFormat.size = 100;</p>
<p>	textMask.autoSize = &#8220;left&#8221;;<br />
	textMask.text = &#8220;SEASCAPE&#8221;;<br />
	textMask.selectable = false;</p>
<p>	textMask.setTextFormat(labelFormat);</p>
<p>	textMask.blendMode = &#8220;erase&#8221;;<br />
	contentContainer.addChild(textMask);<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.flexcommunity.net/?feed=rss2&amp;p=202</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Singleton Event Controller</title>
		<link>http://blog.flexcommunity.net/?p=189</link>
		<comments>http://blog.flexcommunity.net/?p=189#comments</comments>
		<pubDate>Wed, 06 Jan 2010 05:38:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.flexcommunity.net/?p=189</guid>
		<description><![CDATA[[edit: the links referenced in this post are unfortunately broken, I have removed them and posted the full code - see below.] I haven&#8217;t posted in a while. I&#8217;ve been involved in a big project, so will have lots to &#8230; <a href="http://blog.flexcommunity.net/?p=189">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>[edit: the links referenced in this post are unfortunately broken,  I have removed them and posted the full code - see below.]</p>
<p>I haven&#8217;t posted in a while. I&#8217;ve been involved in a big project, so will have lots to post soon. But I found a nice tidbit to share. This comes from this site:http://www.angryrocket.com/?p=113 &#8211; the link is broken &#8211; the code can be found below.</p>
<p>this is a great class to centralize and organize project-wide events, that any class in the project can access.</p>
<p>The real need for it for me came when I had a custom scroller object (the scroll bars in flex suck), that needed to see keyboard events. I wanted the keyboards events to be dispatched from the stage, and not targeted to specific instances of the scroller, as there were many. As I understand it, events dispatched from the stage do not really have a capture or bubble phase, and won&#8217;t nicely propagate up the display list, the same way they would go &#8220;down&#8221; the display list to the stage, if they were dispatched from the scroller (which they could not be in this case). So I had the stage listen for the keyboward event, and when it heard it, dispatch it through this singlton instance, whcih the scroller can invoke as a listener, and viola, it worked perfectly! All events that need to travel all over the project, to parents, grandparents, and to all points in the display list, will now do so through this great EventCentral singleton.</p>
<p>here&#8217;s the code:<br />
<span id="more-189"></span></p>
<pre>
-EventCentral.as-
package {

import flash.events.*;

    public class EventCentral extends EventDispatcher {
    private static var instance:EventCentral;
    public static function getInstance():EventCentral {
      if (instance == null){
         instance = new EventCentral(new SingletonBlocker());
      }
      return instance;
}
      public function EventCentral(blocker:SingletonBlocker):void{
        super();
        if (blocker == null) {
           throw new Error("Error: instantiation failed; Use EventCentral.getInstance()");
       }
}
        public override function dispatchEvent($event:Event):Boolean{
        return super.dispatchEvent($event);
}
}
}
internal class SingletonBlocker {}

--ProjectEvent.as--

package {
      import flash.events.Event
      public class ProjectEvent extends Event {
        public static const SOME_EVENT:String = "ProjectEvent.onSomeEvent";
        public var params:Object;
        public function ProjectEvent($type:String,$params:Object = null){
          super($type,true,true);
          this.params = $params;
}
       public override function clone():Event {
           return new ProjectEvent(this.type,this.params);
}
     override public function toString():String{
          return ("[Event ProjectEvent]");
}
}
}

To set up a listener:

EventCentral.getInstance().addEventListener('ProjectEvent.SOME_EVENT',handleSomeEvent);
function handleSomeEvent(event:ProjectEvent):void{
trace(event.params.param1);
}

to dispatch:

EventCentral.getInstance().dispatchEvent(new ProjectEvent('ProjectEvent.SOME_EVENT',{param1:'something'}));
</pre>
<p>Nice!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.flexcommunity.net/?feed=rss2&amp;p=189</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Read files from a folder and create xml file with php</title>
		<link>http://blog.flexcommunity.net/?p=169</link>
		<comments>http://blog.flexcommunity.net/?p=169#comments</comments>
		<pubDate>Sun, 30 Aug 2009 04:53:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[php/mySQL]]></category>
		<category><![CDATA[directory]]></category>
		<category><![CDATA[files]]></category>
		<category><![CDATA[folder]]></category>
		<category><![CDATA[mp3]]></category>
		<category><![CDATA[mp3s]]></category>
		<category><![CDATA[path]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php to xml]]></category>
		<category><![CDATA[read files from folder]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://blog.flexcommunity.net/?p=169</guid>
		<description><![CDATA[I recently did this for a flash mp3 player (I&#8217;ll write on that later), but it would work just fine for an xml photo gallery like the one shown here Basically what I was doing was creating quite a few &#8230; <a href="http://blog.flexcommunity.net/?p=169">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I recently did this for a flash mp3 player (I&#8217;ll write on that later), but it would work just fine for an xml photo gallery like the one shown <a href="http://blog.flexcommunity.net/?p=25">here</a></p>
<p>Basically what I was doing was creating quite a few mp3players, each with many songs, and didn&#8217;t want to edit all the xml files, as the player I was using reads from an xml file with the following structure:</p>
<p><code><br />
<?xml version="1.0" encoding="UTF-8" ?></p>
<playlist version="1" xmlns="http://xspf.org/ns/0/">
<trackList>
<track>
            <annotation>1. Song Title 1</annotation><br />
            <location>http://www.path_to_your/song 1.mp3<location><br />
        </track>
        </trackList>
</playlist>
</code></p>
<p>So what I did was this:<br />
<span id="more-169"></span><br />
Create a php file that reads the contents of a folder, and takes all the file names and returns the same xml structure as above. There are the following considerations:</p>
<p>1) I&#8217;m not reading any id3 tags, so the file name needs to be the actual song title, for the title to show up.<br />
2) I&#8217;m stripping the &#8220;.mp3&#8243; from the file name so it doesn&#8217;t show up in the title.<br />
3) I implemented this in wordpress, so I had the whole relative path problem discussed <a href="http://blog.flexcommunity.net/?p=135">here</a>. To overcome this, I had php file find the path to itself, then add the &#8220;mp3s/&#8221; to it &#8211; i.e. the mp3s are located in a folder called mp3s/ in the same folder as playlist.php</p>
<p>Enough talk, here&#8217;s the code:</p>
<p><code><br />
<?php<br />
$str = '<?xml version="1.0" encoding="UTF-8" ?></p>
<playlist version="1" xmlns="http://xspf.org/ns/0/">
<trackList>';<br />
echo $str;</p>
<p>// find the path to the php script<br />
if(empty($_SERVER['REQUEST_URI'])) {<br />
    $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'];<br />
}<br />
// strip the php file name from the path and add '/mp3s/'<br />
$url = preg_replace('/\?.*$/', '', $_SERVER['REQUEST_URI']);<br />
$url = 'http://'.$_SERVER['HTTP_HOST'].'/'.ltrim(dirname($url), '/').'/mp3s/';</p>
<p>$dir="mp3s";<br />
// scan the mp3s directory for file names<br />
$files = scandir($dir);<br />
foreach ($files as &#038;$file) {<br />
if ($file!='.' &#038;&#038; $file!='..' )<br />
{<br />
// strip '.mp3' from the file name for the title shown in the player<br />
echo '<br />
<track><annotation>'.preg_replace  ( "/.mp3/" , " " , $file ).'</annotation>';<br />
// give the full absolute path for each mp3<br />
echo '<location>'.$url.$file.'</location></track>';<br />
}<br />
}</p>
<p>$str2 = '</trackList>
        </playlist>';<br />
echo $str2;<br />
?><br />
</code></p>
<p>Oh, also you need to change whatever reference to playlist.xml there is in your mp3player (or photo gallery, etc.) to playlist.php</p>
<p>I will write more on this later regarding the mp3 player itself &#8211; stay tuned&#8230;</p>
<p>EDIT: I realized that this gives errors in PHP4 &#8211; the working PHP4 code is:</p>
<p><?php</p>
<p>$str = '<?xml version="1.0" encoding="UTF-8" ?></p>
<playlist>
<trackList>&#8216;;</p>
<p>echo $str;</p>
<p>if(empty($_SERVER['REQUEST_URI'])) {</p>
<p>    $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'];</p>
<p>};</p>
<p>$url = preg_replace(&#8216;/\?.*$/&#8217;, &#8221;, $_SERVER['REQUEST_URI']);</p>
<p>$url = &#8216;http://&#8217;.$_SERVER['HTTP_HOST'].&#8217;/&#8217;.ltrim(dirname($url), &#8216;/&#8217;).&#8217;/mp3s/&#8217;;</p>
<p>$dir=&#8221;mp3s&#8221;;</p>
<p>$dh = opendir($dir);</p>
<p>while (($file = readdir($dh)) !== false) {<br />
	if ($file!=&#8217;.&#8217; &#038;&#038; $file!=&#8217;..&#8217; )</p>
<p>{<br />
echo &#8216;<br />
<track><annotation>&#8216;.preg_replace  ( &#8220;/.mp3/&#8221; , &#8221; &#8221; , $file ).&#8217;</annotation>&#8216;;</p>
<p>echo &#8216;<location>&#8216;.$url.$file.&#8217;</location></track>&#8216;;<br />
}<br />
}</p>
<p>closedir($dh);</p>
<p>$str2 = &#8216;</trackList>
</playlist>&#8216;;</p>
<p>echo $str2;</p>
<p>?></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.flexcommunity.net/?feed=rss2&amp;p=169</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>(more) text effects with TweenMax</title>
		<link>http://blog.flexcommunity.net/?p=165</link>
		<comments>http://blog.flexcommunity.net/?p=165#comments</comments>
		<pubDate>Tue, 21 Jul 2009 04:00:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[flash effects]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[text]]></category>
		<category><![CDATA[text effect]]></category>
		<category><![CDATA[text effect flex]]></category>
		<category><![CDATA[text effects]]></category>
		<category><![CDATA[tweenLite]]></category>
		<category><![CDATA[tweenMax]]></category>

		<guid isPermaLink="false">http://blog.flexcommunity.net/?p=165</guid>
		<description><![CDATA[EXAMPLE This is an improvement on the technique used here This one deals with linemetrics, and solves the weakness of the other one (that it only works well with monotype fonts) Here&#8217;s the class code: Note &#8211; you must have &#8230; <a href="http://blog.flexcommunity.net/?p=165">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.flexcommunity.net/lab/textEffect2/">EXAMPLE</a></p>
<p>This is an improvement on the technique used <a href="http://blog.flexcommunity.net/?p=109">here</a></p>
<p>This one deals with linemetrics, and solves the weakness of the other one (that it only works well with monotype fonts)</p>
<p>Here&#8217;s the class code:</p>
<p>Note &#8211; you must have the <a href="http://blog.greensock.com/tweenmaxas3/">tweenMax</a> library in your library path</p>
<p><span id="more-165"></span></p>
<p>package com.flexcommunity<br />
{<br />
	import flash.filters.*;<br />
	import gs.*;<br />
	import gs.easing.*;<br />
	import gs.plugins.*;<br />
	import flash.utils.Timer;<br />
	import flash.events.TimerEvent;<br />
   	import flash.text.TextLineMetrics;<br />
 	import flash.events.MouseEvent<br />
	import mx.containers.Canvas;<br />
	import mx.controls.Label;<br />
	import mx.core.Application;</p>
<p>	public class EffectText extends Canvas<br />
	{</p>
<p>		private var tf:Label;<br />
		private var test:Label = new Label();<br />
		private var tfs:Array = new Array();<br />
		private var lm:Array = new Array();<br />
		private var j:int=0;<br />
		[Bindable]<br />
		public var totalWidth:Number=0;<br />
		private var myColor:uint;<br />
		public var results:Array;<br />
		public var myStr:String;<br />
 		public var buttonSprite:Canvas= new Canvas();</p>
<p>		public function EffectText(str:String,color:uint)<br />
		{</p>
<p>		 TweenPlugin.activate([BlurFilterPlugin]);</p>
<p>    	 var filter1:DropShadowFilter = new DropShadowFilter();<br />
    	 myStr = str<br />
    	 myColor=color;<br />
    	 results =  myStr.split(&#8221;);</p>
<p>     for(var i:int=0; i<results.length; i++){<br />
     	 tf = new Label();<br />
      	 tf.filters = [filter1];<br />
    	 tf.text = results[i].toString();<br />
   		 test.y=0;<br />
   		 tf.alpha=0;<br />
    	 tf.setStyle("fontFamily","Arial");<br />
    	 tf.setStyle("fontSize",40);<br />
   		 tf.setStyle("color",myColor);<br />
  		 tfs.push(tf);</p>
<p>     }<br />
     TimerInit();</p>
<p>     function myTrans():void{<br />
    	addChild(tfs[j]);<br />
     	tfs[j].validateNow();<br />
    	 var metrics:TextLineMetrics = tfs[j].getLineMetrics(0);<br />
		lm.push(metrics.width);</p>
<p>  		if(j>0){<br />
    		 totalWidth+=lm[j-1];<br />
  		}<br />
         tfs[j].x=0+(totalWidth);</p>
<p>         TweenMax.from(tfs[j],.1,{alpha:0,blurFilter:{blurX:0,blurY:120}});<br />
     	 TweenMax.to(tfs[j],.3,{alpha:1,blurFilter:{blurX:0,blurY:0,quality:3},onComplete:myGlowIn,onCompleteParams:[tfs[j]],ease:Back.easeOut});<br />
    	 j++;<br />
     	}</p>
<p> 		function TimerInit() {<br />
            var myTimer:Timer = new Timer(40, tfs.length);<br />
            myTimer.addEventListener(&#8220;timer&#8221;, timerHandler);<br />
            myTimer.start();<br />
        }</p>
<p>        function myGlowIn(parameter1:Label):void{<br />
     	var target:Label=parameter1;<br />
     	TweenMax.to(target,.2,{glowFilter:{color:0xffffff, alpha:1, blurX:10, blurY:10},onComplete:myGlowOut,onCompleteParams:[target],ease:Cubic.easeOut});<br />
     }</p>
<p>     function myGlowOut(parameter1:Label):void{<br />
     	var target:Label=parameter1;<br />
     	TweenMax.to(target,1,{glowFilter:{color:0xffffff, alpha:0, blurX:0, blurY:0},ease:Cubic.easeOut});<br />
     }</p>
<p>     function timerHandler(event:TimerEvent):void {<br />
           myTrans();<br />
        }</p>
<p> }}}</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.flexcommunity.net/?feed=rss2&amp;p=165</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Auto Resizing Text Area Component &#8211; Flex</title>
		<link>http://blog.flexcommunity.net/?p=159</link>
		<comments>http://blog.flexcommunity.net/?p=159#comments</comments>
		<pubDate>Tue, 21 Jul 2009 03:10:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.flexcommunity.net/?p=159</guid>
		<description><![CDATA[Just to spread the word, there is a great article here with an AutoResizing TextArea component that seems to work well. I added one small thing to support resizing of htmlText too (see below). (add this code to the component) &#8230; <a href="http://blog.flexcommunity.net/?p=159">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Just to spread the word, there is a great article <a href="http://www.flexer.info/2009/02/06/auto-resizable-text-area-component/">here</a> with an AutoResizing TextArea component that seems to work well. I added one small thing to support resizing of htmlText too (see below). </p>
<p>(add this code to the component)</p>
<p>override public function set htmlText(value:String):void<br />
               {<br />
                    // calling super method<br />
                    super.htmlText = value;<br />
                    // if is auto resizable we call<br />
                    // the resize method<br />
                    if (_autoResizable)<br />
                         resizeTextArea();<br />
               } </p>
<p>Also, as a side note: you can bind to the height of the text component to resize containers etc. like this:<br />
<span id="more-159"></span><br />
<,mx:Canvas width="500" height="{homeText.height+25}" left="16" bottom="128" backgroundImage="images/fades/fade01.png" showEffect="{myRS}" backgroundSize="100%" ><br />
	<,custom:AutoResizableTextArea id="homeText" width="94%" height="90%" showEffect="{myRS}" verticalCenter="0" left="15" htmlText="{content.lastResult.homeText}" leading="0" condenseWhite="true" selectable="true" editable="false"/><br />
<,/mx:Canvas></p>
<p>one more little thing: I set</p>
<p>private var _autoResizable:Boolean = false;</p>
<p>to:</p>
<p>private var _autoResizable:Boolean = true;</p>
<p>I figured it&#8217;s better to have it resize by default (or else why would you use it) and avoid having to change to property when you instantiate it.</p>
<p>Great component. Thanks FLEX{ER}</p>
<p>btw &#8211; the fact that TextArea should have an autoResize method inherent in it goes without saying <img src='http://blog.flexcommunity.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Happy flexing!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.flexcommunity.net/?feed=rss2&amp;p=159</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>cool xml photo gallery with flex and PaperVision3D</title>
		<link>http://blog.flexcommunity.net/?p=146</link>
		<comments>http://blog.flexcommunity.net/?p=146#comments</comments>
		<pubDate>Fri, 17 Jul 2009 22:58:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Papervision3D]]></category>
		<category><![CDATA[3d]]></category>
		<category><![CDATA[3d photo gallery]]></category>
		<category><![CDATA[flex photo gallery]]></category>
		<category><![CDATA[gallery]]></category>
		<category><![CDATA[image gallery]]></category>
		<category><![CDATA[papervision]]></category>
		<category><![CDATA[papervision3d gallery]]></category>
		<category><![CDATA[papervision3d photo gallery]]></category>
		<category><![CDATA[sliced cube]]></category>
		<category><![CDATA[xml photo gallery]]></category>

		<guid isPermaLink="false">http://blog.flexcommunity.net/?p=146</guid>
		<description><![CDATA[This is an example of a photo gallery in Flex using papervision3D and a &#8220;sliced cube&#8221; effect for the transitions. The image data is loaded from an external xml file. Major credit goes to John Lindquist for the cool effect. &#8230; <a href="http://blog.flexcommunity.net/?p=146">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This is an example of a photo gallery in Flex using papervision3D and a &#8220;sliced cube&#8221; effect for the transitions. The image data is loaded from an external xml file.</p>
<p>Major credit goes to John Lindquist for the cool effect. Read his article here:</p>
<p><a href="http://pv3d.org/2009/04/09/sliced-cube/">http://pv3d.org/2009/04/09/sliced-cube/</a></p>
<p>john says: &#8220;I’m sorry the code is a big pile of crap. I’m too lazy right now to clean it up&#8221;</p>
<p>well, I just made it worse! <img src='http://blog.flexcommunity.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Here&#8217;s my example (right click for source)</p>
<p><a href="http://blog.flexcommunity.net/lab/ppv3dGallery_slicedCube/">http://blog.flexcommunity.net/lab/ppv3dGallery_slicedCube/</a></p>
<p>Here&#8217;s a description of what I did:<br />
<span id="more-146"></span><br />
First off the necessary steps required to make this happen were:</p>
<p>1) Load the images from an external xml file (this could also be done from a db of course).</p>
<p>2) Devise a method to swap out the materials on the faces of the cube as needed.</p>
<p>3) add &#8216;previous&#8217; and &#8216;next&#8217; functionality</p>
<p>Known weaknesses:</p>
<p>1) at least 4 images are needed for this to work as expected</p>
<p>2) better error catching (if an image path is typed wrong in the xml, it breaks the whole app)</p>
<p>3) no image scaling &#8211; the images need to be the exact size of the viewer (in this case 900&#215;480)</p>
<p>4) Since the image swapping is called after the tween finishes, I disabled the buttons while the tween is in effect (unlike the original &#8211; which gets cool if you start clicking like a wildman)</p>
<p>things to add:</p>
<p>1) a play/pause feature (this is a simple add)</p>
<p>2) image captions or other data (also simple) EDIT: CAPTIONS SUPPORT ADDED</p>
<p>Text effect is an improved version of the technique <a href="http://blog.flexcommunity.net/?p=109">here</a> :<br />
The improvement adds kerning &#8211; the original example only works right with monotype fonts.</p>
<p>Technical notes:</p>
<p>1) In order to use the papervision3d scene in a flex mxml app, I wrapped it in a UIComponent. See SlicedCube.as</p>
<p>2) you need to have the papervision3d and tweenmax swc in your lib path for this to work. (See the <a href="http://pv3d.org/2009/04/09/sliced-cube/">original article</a>) </p>
<p>I&#8217;m sure this can be done better/cleaner. If anyone has improvements, additions, or suggestions, please help your fellow man, and put them in the comments.</p>
<p>Thanks!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.flexcommunity.net/?feed=rss2&amp;p=146</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>relative paths, HTML and embedded swfs</title>
		<link>http://blog.flexcommunity.net/?p=135</link>
		<comments>http://blog.flexcommunity.net/?p=135#comments</comments>
		<pubDate>Tue, 09 Jun 2009 23:42:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[absolute path]]></category>
		<category><![CDATA[embedded swf]]></category>
		<category><![CDATA[file path]]></category>
		<category><![CDATA[filepath]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[LoaderInfo]]></category>
		<category><![CDATA[loaderInfo.url]]></category>
		<category><![CDATA[relative path]]></category>
		<category><![CDATA[URL]]></category>

		<guid isPermaLink="false">http://blog.flexcommunity.net/?p=135</guid>
		<description><![CDATA[I recently had a need to load external jpgs into multiple swfs, which were embedded into an HTML page. The swfs were in sub-directories. The problem soon arose was this: Referencing relative paths from an swf that is not in &#8230; <a href="http://blog.flexcommunity.net/?p=135">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I recently had a need to load external jpgs into multiple swfs, which were embedded into an HTML page. The swfs were in sub-directories. The problem soon arose was this:</p>
<p>Referencing relative paths from an swf that is not in the root folder (the same folder containing the HTML page) doesn&#8217;t work. For example, if you have</p>
<p>root -> html page -> swf folder -> image.jpg</p>
<p>And in the swf file you try to load &#8220;image.jpg&#8221; as a relative path, it does not work. According to the swf (embedded in the HTML page), the jpg it is looking for should be located in root -> image.jpg</p>
<p>It is not there. it is actually in root -> swf folder -> image.jpg</p>
<p>I found others on blogs and forums with the same problem<br />
<span id="more-135"></span></p>
<p>Obviously one could write an absolute path, or just put the image where the swf wants to see it, but in my case neither of these options was acceptable. I wanted all the images to have the same name &#8211; preview.jpg, so that the client could swap out images, and as long as they were called preview.jpg, they would work (so they couldn&#8217;t all be in the same folder. Also I didn&#8217;t want to generate a different swf for each one, looking for -say preview1.jpg, preview2.jpg, etc.</p>
<p>The solution I found is as follows. (this is not complete code, just the relevant snippet. It works great. Hope it helps someone out there.</p>
<p><code></p>
<p>var curUrl:String =  this.loaderInfo.url as String;</p>
<p>var pattern:RegExp = /video.swf/;</p>
<p> var url:String = curUrl.replace(pattern, "preview.jpg");</p>
<p> /* the preceding code finds the URL of the swf itself, removes the name of the swf<br />
and adds the name of the .jpg - ending up with dynamically generated absolute filepath<br />
for the .jpg which resides in the same folder as the .swf*/</p>
<p> var ldr:Loader = new Loader();</p>
<p> var urlReq:URLRequest = new URLRequest(url);<br />
 ldr.load(urlReq);<br />
 addChild(ldr);<br />
</code></p>
<p>EDIT:<br />
in AS 2 this can be achieved by somethng like this:</p>
<p>var curUrl:String = _root._url;<br />
var strLength = curUrl.length;<br />
// the following slice removes the name of the swf file &#8211; in this case its 13 chars long<br />
var url:String = curUrl.slice(0,-13);<br />
		trace(url);<br />
		 playlistURL = url + &#8220;preview.jpg&#8221;;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.flexcommunity.net/?feed=rss2&amp;p=135</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Documenting your classes with ASDoc</title>
		<link>http://blog.flexcommunity.net/?p=131</link>
		<comments>http://blog.flexcommunity.net/?p=131#comments</comments>
		<pubDate>Thu, 28 May 2009 21:21:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[asdoc]]></category>
		<category><![CDATA[asdoc flex]]></category>
		<category><![CDATA[docs]]></category>
		<category><![CDATA[documenting actionscript]]></category>
		<category><![CDATA[documenting clases]]></category>
		<category><![CDATA[running asdoc]]></category>

		<guid isPermaLink="false">http://blog.flexcommunity.net/?p=131</guid>
		<description><![CDATA[I started working on this today for the first time for a new project I want to document. After some reading online, I found many people having problems with this, and complaining about problems using ASDocs through the command line, &#8230; <a href="http://blog.flexcommunity.net/?p=131">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I started working on this today for the first time for a new project I want to document. After some reading online, I found many people having problems with this, and complaining about problems using ASDocs through the command line, lack of documentation (which is kind of ironic), and many people saying they&#8217;ve spend hours and days trying to get it to work. I decided to skip the command line and try to run ASDOcs from Flex Builder. I&#8217;m happy to report I&#8217;ve gotten it to work after about 20 min, with the help of this great article:<br />
<span id="more-131"></span><br />
<a href="http://amiest-devblog.blogspot.com/2007/12/launching-asdoc-with-external-tools.html">http://amiest-devblog.blogspot.com/2007/12/launching-asdoc-with-external-tools.html</a></p>
<p>and this:</p>
<p><a href="http://livedocs.adobe.com/flex/3/html/index.html?content=asdoc_9.html#142061">http://livedocs.adobe.com/flex/3/html/index.html?content=asdoc_9.html#142061</a></p>
<p>Some additional notes to help:</p>
<p>1) This method creates docs for a folder in a particular flex project, if you want to create docs for a folder not in a project, you&#8217;ll have to modify the options, see the adobe page for different command options</p>
<p>2) For this particular method to work, it seems you need to have the flex navigator open, and the project selected</p>
<p>3) ASDocs is not as forgiving with errors as the regular compiler is, and I found myself fixing &#8216;errors&#8217; that were not showing up at all when i debug the flex app itself. Most of these had to do with private or public variables. Warnings were ignored.</p>
<p>4) even with the good advice, I had to play around a bit before getting this to work, so keep trying&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.flexcommunity.net/?feed=rss2&amp;p=131</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using Flex swf to load html into frames</title>
		<link>http://blog.flexcommunity.net/?p=128</link>
		<comments>http://blog.flexcommunity.net/?p=128#comments</comments>
		<pubDate>Fri, 17 Apr 2009 17:19:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[controlling frames]]></category>
		<category><![CDATA[flex + frames]]></category>
		<category><![CDATA[frame]]></category>
		<category><![CDATA[frames]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[html frames]]></category>
		<category><![CDATA[loading page into frame]]></category>

		<guid isPermaLink="false">http://blog.flexcommunity.net/?p=128</guid>
		<description><![CDATA[I recently had a reason to do this, and saw that many people online are having problems. Here&#8217;s a solution, and a few notes to help. First the Flex code: import flash.net.URLRequest; //private var contentFrame: private var myArr:Array = new &#8230; <a href="http://blog.flexcommunity.net/?p=128">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I recently had a reason to do this, and saw that many people online are having problems. Here&#8217;s a solution, and a few notes to help. First the Flex code:<br />
<span id="more-128"></span><br />
<code><?xml version="1.0" encoding="utf-8"?><br />
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="400" height="30" horizontalScrollPolicy="off" verticalScrollPolicy="off" backgroundColor="#000000" backgroundGradientAlphas="{[0,0]}"><br />
<mx:Script><br />
	<![CDATA[<br />
	import flash.net.URLRequest;<br />
		//private var contentFrame:<br />
		private var myArr:Array = new Array("home","bio","contact");</p>
<p>	]]&gt;<br />
</mx:Script><br />
	<mx:ButtonBar width="100%" height="100%" dataProvider="{myArr}" itemClick="navigateToURL(new<br />
URLRequest(event.label+'.html'),'contentFrame');" color="#ffffff"/><br />
<mx:Label id="test" y ="150" /></mx:Application></code></p>
<p><a href="http://blog.flexcommunity.net/lab/frameTEST/">Here&#8217;s an example (you can view page source to see the HTML):</a></p>
<p>A few notes:</p>
<p>In AS3:</p>
<p>The frame name must by exactly the same (of course! &#8211; but this came up in the forums), and must be a string, passed as a parameter in navigateToURL (in place of &#8220;_blank&#8221; etc)</p>
<p>In AS2: (Flash): The parameter is &#8216;supposed&#8217; to be a string here as well, but I could only get it to work with out the quotes (as a var) &#8211; here you use the getURL() method.</p>
<p>Note: if using relative urls, it will appear not to work while developing, but should once you get it on the server &#8211; flash security. This seems o only be the case with as3</p>
<p>Cheers,</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.flexcommunity.net/?feed=rss2&amp;p=128</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GuerrillaMail disposable email</title>
		<link>http://blog.flexcommunity.net/?p=126</link>
		<comments>http://blog.flexcommunity.net/?p=126#comments</comments>
		<pubDate>Fri, 17 Apr 2009 16:21:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[spam]]></category>

		<guid isPermaLink="false">http://blog.flexcommunity.net/?p=126</guid>
		<description><![CDATA[This isn&#8217;t about Flex or Flash, but it&#8217;s a useful item for any developer, and I&#8217;d thought I&#8217;d share to anyone who doesn&#8217;t already know about it. Using Guerrilla Mail, you can generate a free, anonymous, disposable email address that &#8230; <a href="http://blog.flexcommunity.net/?p=126">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This isn&#8217;t about Flex or Flash, but it&#8217;s a useful item for any developer, and I&#8217;d thought I&#8217;d share to anyone who doesn&#8217;t already know about it. Using Guerrilla Mail, you can generate a free, anonymous, disposable email address that expires in 1 hr. You can use this address to sign up to things that require an email (and send a confirmation code/link) that you plan to only use or sign up to once.</p>
<p>It works like a charm. </p>
<p>Cheers</p>
<p><a href="http://www.guerrillamail.com/">http://www.guerrillamail.com/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.flexcommunity.net/?feed=rss2&amp;p=126</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
