<?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>LetsFlex</title>
	<atom:link href="http://letsflex.com/feed" rel="self" type="application/rss+xml" />
	<link>http://letsflex.com</link>
	<description></description>
	<lastBuildDate>Mon, 29 Dec 2008 09:02:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Actionscript based effects examples</title>
		<link>http://letsflex.com/actionscript/actionscript-based-effects-examples</link>
		<comments>http://letsflex.com/actionscript/actionscript-based-effects-examples#comments</comments>
		<pubDate>Fri, 19 Dec 2008 01:42:04 +0000</pubDate>
		<dc:creator>jlagunas</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Effects]]></category>

		<guid isPermaLink="false">http://letsflex.com/?p=72</guid>
		<description><![CDATA[Here&#8217;s an example of the effects code from a previous post. It fades the Flex icon out and in, same goes with the move effect, it moves the Flex icon to the bottom right and back.



MXML File


&#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62;
	&#60;mx:Application xmlns:mx=&#34;http://www.adobe.com/2006/mxml&#34; layout=&#34;absolute&#34; backgroundColor=&#34;0xffffff&#34; themeColor=&#34;0xffffff&#34; viewSourceURL=&#34;srcview/index.html&#34;&#62;

		&#60;mx:Script&#62;
			&#60;![CDATA[
				import mx.effects.Move;
				import mx.effects.Fade;
				import mx.effects.easing.Cubic;

				public var moveStatus:Boolean;
				public var fadeeStatus:Boolean;

				public function FadeEffect(target:Object, duration:Number, delay:Number, [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s an example of the <a href="http://letsflex.com/actionscript/effects" target="_blank">effects</a> code from a previous post. It fades the Flex icon out and in, same goes with the move effect, it moves the Flex icon to the bottom right and back.</p>
<p><span id="more-72"></span><br />
<iframe src="http://letsflex.com/examples/coding/effects/" width="100%" height="400" frameborder="0"></iframe>
</p>
<p><b>MXML File</b></p>
<div class="codeContainer">
<pre class="code">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
	&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; layout=&quot;absolute&quot; backgroundColor=&quot;0xffffff&quot; themeColor=&quot;0xffffff&quot; viewSourceURL=&quot;srcview/index.html&quot;&gt;

		&lt;mx:Script&gt;
			&lt;![CDATA[
				import mx.effects.Move;
				import mx.effects.Fade;
				import mx.effects.easing.Cubic;

				public var moveStatus:Boolean;
				public var fadeeStatus:Boolean;

				public function FadeEffect(target:Object, duration:Number, delay:Number, alphaFrom:Number, alphaTo:Number):void
				{
					var fadeEffect:Fade = new Fade();
					fadeEffect.end();
					fadeEffect.target = target;
					fadeEffect.duration = duration;
					fadeEffect.startDelay = delay;
					fadeEffect.easingFunction = Cubic.easeInOut;
					fadeEffect.alphaFrom = alphaFrom;
					fadeEffect.alphaTo = alphaTo;
					fadeEffect.play();
				}

				public function MoveEffect(target:Object, duration:Number, delay:Number, xStart:Number, xEnd:Number, yStart:Number, yEnd:Number):void
				{
					var moveEffect:Move = new Move();
					moveEffect.end();
					moveEffect.target = target;
					moveEffect.duration = duration;
					moveEffect.startDelay = delay;
					moveEffect.easingFunction = Cubic.easeInOut;
					moveEffect.xFrom = xStart;
					moveEffect.xTo = xEnd;
					moveEffect.yFrom = yStart;
					moveEffect.yTo = yEnd;
					moveEffect.play();
				}

				public function fadeIcon():void
				{
					switch(fadeeStatus)
					{
						case false :
							fadeeStatus = true;
							FadeEffect(flexicon, 1000, 0, 1, 0);
							fader.label = &quot;fade in&quot;;
						break;

						case true :
							fadeeStatus = false;
							FadeEffect(flexicon, 1000, 0, 0, 1);
							fader.label = &quot;fade out&quot;;
						break;
					}
				}

				public function moveIcon():void
				{
					switch(moveStatus)
					{
						case false :
							moveStatus = true;
							MoveEffect(flexicon, 1000, 0, flexicon.x, (iconContainer.width - flexicon.width), flexicon.y, (iconContainer.height - flexicon.height));
							mover.label = &quot;move to top left&quot;;
						break;

						case true :
							moveStatus = false;
							MoveEffect(flexicon, 1000, 0, flexicon.x, 0, flexicon.y, 0);
							mover.label = &quot;move to bottom right&quot;;
						break;
					}
				}
			]]&gt;

		&lt;/mx:Script&gt;

		&lt;mx:VBox width=&quot;100%&quot; height=&quot;100%&quot;&gt;

			&lt;mx:HBox&gt;

				&lt;mx:Button id=&quot;fader&quot; label=&quot;fade out&quot; click=&quot;fadeIcon();&quot; /&gt;
				&lt;mx:Button id=&quot;mover&quot; label=&quot;move to bottom right&quot; click=&quot;moveIcon();&quot; /&gt;

			&lt;/mx:HBox&gt;

			&lt;mx:Container id=&quot;iconContainer&quot; width=&quot;100%&quot; height=&quot;100%&quot;&gt;
				&lt;mx:Image id=&quot;flexicon&quot; source=&quot;assets/images/flex-icon.png&quot; width=&quot;104&quot; height=&quot;104&quot; /&gt;
			&lt;/mx:Container&gt;

		&lt;/mx:VBox&gt;

	&lt;/mx:Application&gt;</pre>
</div>
<div class="viewsourceContainer"><a href="http://letsflex.com/examples/coding/effects/srcview/">VIEW SOURCE</a></div>
]]></content:encoded>
			<wfw:commentRss>http://letsflex.com/actionscript/actionscript-based-effects-examples/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ModuleManager with ProgressBar and Fade Effect</title>
		<link>http://letsflex.com/actionscript/modulemanager-with-progressbar-and-fade-effect</link>
		<comments>http://letsflex.com/actionscript/modulemanager-with-progressbar-and-fade-effect#comments</comments>
		<pubDate>Wed, 17 Dec 2008 20:44:55 +0000</pubDate>
		<dc:creator>jlagunas</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Effects]]></category>
		<category><![CDATA[ModuleLoader]]></category>
		<category><![CDATA[ProgressBbar]]></category>

		<guid isPermaLink="false">http://letsflex.com/?p=63</guid>
		<description><![CDATA[This examples shows you how you can use the ModuleManager with the ProgressBar and a fade effect.

&#160;


MXML File


&#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62;
&#60;mx:Application xmlns:mx=&#34;http://www.adobe.com/2006/mxml&#34; layout=&#34;absolute&#34; pageTitle=&#34;Module Manager&#34; width=&#34;100%&#34; height=&#34;100%&#34; viewSourceURL=&#34;srcview/index.html&#34;&#62;

	&#60;mx:Script source=&#34;as/moduleManager.as&#34; /&#62;
	&#60;mx:Script source=&#34;as/effects.as&#34; /&#62;

	&#60;mx:states&#62;

		&#60;mx:State name=&#34;progress&#34;&#62;
			&#60;mx:AddChild relativeTo=&#34;{container}&#34; position=&#34;after&#34;&#62;
				&#60;mx:Canvas id=&#34;progressCanvas&#34; width=&#34;100%&#34; height=&#34;100%&#34; backgroundColor=&#34;0xffffff&#34; alpha=&#34;.5&#34;&#62;
					&#60;mx:ProgressBar source=&#34;{moduleInfo}&#34; horizontalCenter=&#34;0&#34; verticalCenter=&#34;0&#34; color=&#34;0x333333&#34; fontWeight=&#34;normal&#34;/&#62;
				&#60;/mx:Canvas&#62;
			&#60;/mx:AddChild&#62;
		&#60;/mx:State&#62;

	&#60;/mx:states&#62;

	&#60;mx:VBox id=&#34;container&#34; width=&#34;100%&#34; height=&#34;100%&#34;&#62;

		&#60;mx:HBox&#62;
			&#60;mx:Button id=&#34;loadModule1&#34; label=&#34;load module 1&#34; click=&#34;moduleHandler('assets/modules/module1.swf');&#34; /&#62;
			&#60;mx:Button id=&#34;loadModule2&#34; label=&#34;load [...]]]></description>
			<content:encoded><![CDATA[<p>This examples shows you how you can use the ModuleManager with the ProgressBar and a fade effect.</p>
<p><span id="more-63"></span></p>
<p>&nbsp;</p>
<p><iframe src="http://letsflex.com/examples/coding/module-manager/" width="100%" height="400" frameborder="0"></iframe>
</p>
<p><b>MXML File</b></p>
<div class="codeContainer">
<pre class="code">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; layout=&quot;absolute&quot; pageTitle=&quot;Module Manager&quot; width=&quot;100%&quot; height=&quot;100%&quot; viewSourceURL=&quot;srcview/index.html&quot;&gt;

	&lt;mx:Script source=&quot;as/moduleManager.as&quot; /&gt;
	&lt;mx:Script source=&quot;as/effects.as&quot; /&gt;

	&lt;mx:states&gt;

		&lt;mx:State name=&quot;progress&quot;&gt;
			&lt;mx:AddChild relativeTo=&quot;{container}&quot; position=&quot;after&quot;&gt;
				&lt;mx:Canvas id=&quot;progressCanvas&quot; width=&quot;100%&quot; height=&quot;100%&quot; backgroundColor=&quot;0xffffff&quot; alpha=&quot;.5&quot;&gt;
					&lt;mx:ProgressBar source=&quot;{moduleInfo}&quot; horizontalCenter=&quot;0&quot; verticalCenter=&quot;0&quot; color=&quot;0x333333&quot; fontWeight=&quot;normal&quot;/&gt;
				&lt;/mx:Canvas&gt;
			&lt;/mx:AddChild&gt;
		&lt;/mx:State&gt;

	&lt;/mx:states&gt;

	&lt;mx:VBox id=&quot;container&quot; width=&quot;100%&quot; height=&quot;100%&quot;&gt;

		&lt;mx:HBox&gt;
			&lt;mx:Button id=&quot;loadModule1&quot; label=&quot;load module 1&quot; click=&quot;moduleHandler('assets/modules/module1.swf');&quot; /&gt;
			&lt;mx:Button id=&quot;loadModule2&quot; label=&quot;load module 2&quot; click=&quot;moduleHandler('assets/modules/module2.swf');&quot; /&gt;
		&lt;/mx:HBox&gt;

		&lt;mx:ModuleLoader id=&quot;moduleLoader&quot; width=&quot;100%&quot; height=&quot;100%&quot; /&gt;

	&lt;/mx:VBox&gt;

&lt;/mx:Application&gt;</pre>
</div>
<p>&nbsp;</p>
<p><b>moduleManager.as</b></p>
<div class="codeContainer">
<pre class="code">
import flash.display.DisplayObject;
import mx.controls.Alert;
import mx.events.ModuleEvent;
import mx.modules.IModuleInfo;
import mx.modules.ModuleManager;

[Bindable]
private var moduleInfo:IModuleInfo;
private var displayObject:DisplayObject;

private function moduleHandler(moduleUrl:String):void
{
	if(moduleLoader.numChildren &gt; 0)
	{
		if(moduleInfo.url != moduleUrl)
			unloadModule();
		else
			return;
	}

	currentState = &quot;progress&quot;;

	moduleInfo = ModuleManager.getModule(moduleUrl);
	moduleInfo.addEventListener(ModuleEvent.READY, readyHandler);
	moduleInfo.addEventListener(ModuleEvent.ERROR, errorHandler);
	moduleInfo.load();
}

private function readyHandler(event:ModuleEvent):void
{
	displayObject = moduleInfo.factory.create() as DisplayObject;

	moduleLoader.addChild(displayObject);

	FadeEffect(displayObject, 1000, 0, 0, 1);

	currentState = &quot;&quot;;
}

private function errorHandler(event:ModuleEvent):void
{
	Alert.show(&quot;ERROR Loading Module: &quot; + moduleInfo.url, &quot;ERROR&quot;);
	currentState = &quot;&quot;;
}

private function unloadModule():void
{
	moduleLoader.removeAllChildren();
	moduleInfo.unload();
}</pre>
</div>
<p>&nbsp;</p>
<p><b>effects.as</b></p>
<div class="codeContainer">
<pre class="code">
import mx.effects.Move;
import mx.effects.Fade;
import mx.effects.easing.Cubic;

public function MoveEffect(target:Object, duration:Number, delay:Number, xStart:Number, xEnd:Number, yStart:Number, yEnd:Number):void
{
	var moveEffect:Move = new Move();
	moveEffect.end();
	moveEffect.target = target;
	moveEffect.duration = duration;
	moveEffect.startDelay = delay;
	moveEffect.easingFunction = Cubic.easeInOut;
	moveEffect.xFrom = xStart;
	moveEffect.xTo = xEnd;
	moveEffect.yFrom = yStart;
	moveEffect.yTo = yEnd;
	moveEffect.play();
}

public function FadeEffect(target:Object, duration:Number, delay:Number, alphaFrom:Number, alphaTo:Number):void
{
	var fadeEffect:Fade = new Fade();
	fadeEffect.end();
	fadeEffect.target = target;
	fadeEffect.duration = duration;
	fadeEffect.startDelay = delay;
	fadeEffect.easingFunction = Cubic.easeInOut;
	fadeEffect.alphaFrom = alphaFrom;
	fadeEffect.alphaTo = alphaTo;
	fadeEffect.play();
}</pre>
</div>
<div class="viewsourceContainer"><a href="http://letsflex.com/examples/coding/module-manager/srcview/">VIEW SOURCE</a></div>
]]></content:encoded>
			<wfw:commentRss>http://letsflex.com/actionscript/modulemanager-with-progressbar-and-fade-effect/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Effect easing classes</title>
		<link>http://letsflex.com/actionscript/effect-easing-classes</link>
		<comments>http://letsflex.com/actionscript/effect-easing-classes#comments</comments>
		<pubDate>Wed, 17 Dec 2008 19:58:50 +0000</pubDate>
		<dc:creator>jlagunas</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Effects]]></category>

		<guid isPermaLink="false">http://letsflex.com/?p=59</guid>
		<description><![CDATA[Here&#8217;s the list of all the easing classes for the effects package.


Back
Bounce
Circular
Cubic
Elastic
Exponential
Linear
Quadratic
Quartic
Quintic
Sine

]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s the list of all the easing classes for the effects package.</p>
<p><span id="more-59"></span></p>
<ul style="list-style-type:none;">
<li>Back</li>
<li>Bounce</li>
<li>Circular</li>
<li>Cubic</li>
<li>Elastic</li>
<li>Exponential</li>
<li>Linear</li>
<li>Quadratic</li>
<li>Quartic</li>
<li>Quintic</li>
<li>Sine</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://letsflex.com/actionscript/effect-easing-classes/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Effects</title>
		<link>http://letsflex.com/actionscript/effects</link>
		<comments>http://letsflex.com/actionscript/effects#comments</comments>
		<pubDate>Wed, 17 Dec 2008 19:15:45 +0000</pubDate>
		<dc:creator>jlagunas</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Effects]]></category>

		<guid isPermaLink="false">http://letsflex.com/?p=55</guid>
		<description><![CDATA[Using the Fade effect class via Actionscript. The same thing can be done with the other effects such as Move.



import mx.effects.Fade;
import mx.effects.Move;
import mx.effects.easing.Cubic;

public function FadeEffect(target:Object, duration:Number, delay:Number, alphaFrom:Number, alphaTo:Number):void
{
	var fadeEffect:Fade = new Fade();
	fadeEffect.end();
	fadeEffect.target = target;
	fadeEffect.duration = duration;
	fadeEffect.startDelay = delay;
	fadeEffect.easingFunction = Cubic.easeInOut;
	fadeEffect.alphaFrom = alphaFrom;
	fadeEffect.alphaTo = alphaTo;
	fadeEffect.play();
}

public function MoveEffect(target:Object, duration:Number, delay:Number, xStart:Number, xEnd:Number, yStart:Number, yEnd:Number):void
{
	var moveEffect:Move = [...]]]></description>
			<content:encoded><![CDATA[<p>Using the Fade effect class via Actionscript. The same thing can be done with the other effects such as Move.</p>
<p><span id="more-55"></span></p>
<div class="codeContainer">
<pre class="code">
import mx.effects.Fade;
import mx.effects.Move;
import mx.effects.easing.Cubic;

public function FadeEffect(target:Object, duration:Number, delay:Number, alphaFrom:Number, alphaTo:Number):void
{
	var fadeEffect:Fade = new Fade();
	fadeEffect.end();
	fadeEffect.target = target;
	fadeEffect.duration = duration;
	fadeEffect.startDelay = delay;
	fadeEffect.easingFunction = Cubic.easeInOut;
	fadeEffect.alphaFrom = alphaFrom;
	fadeEffect.alphaTo = alphaTo;
	fadeEffect.play();
}

public function MoveEffect(target:Object, duration:Number, delay:Number, xStart:Number, xEnd:Number, yStart:Number, yEnd:Number):void
{
	var moveEffect:Move = new Move();
	moveEffect.end();
	moveEffect.target = target;
	moveEffect.duration = duration;
	moveEffect.startDelay = delay;
	moveEffect.easingFunction = Cubic.easeInOut;
	moveEffect.xFrom = xStart;
	moveEffect.xTo = xEnd;
	moveEffect.yFrom = yStart;
	moveEffect.yTo = yEnd;
	moveEffect.play();
}
	</pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://letsflex.com/actionscript/effects/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Module Loader</title>
		<link>http://letsflex.com/actionscript/module-loader</link>
		<comments>http://letsflex.com/actionscript/module-loader#comments</comments>
		<pubDate>Wed, 17 Dec 2008 08:02:02 +0000</pubDate>
		<dc:creator>sucka</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[ModuleLoader]]></category>

		<guid isPermaLink="false">http://letsflex.com/?p=12</guid>
		<description><![CDATA[Here is a quick and easy way of using ModuleLoader to load other sections of your &#8220;site&#8221;, just remember that the modules that you are loading are not any ol&#8217; regular swfs like the ones that you can export from flash, they are modules specifically for the ModuleLoader.

&#160;


MXML File

&#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62;
	&#60;mx:Application xmlns:mx=&#34;http://www.adobe.com/2006/mxml&#34;
		layout=&#34;absolute&#34;
		themeColor=&#34;#FF6600&#34;
		backgroundGradientAlphas=&#34;[1.0, 1.0]&#34;
		backgroundGradientColors=&#34;[#222222, #444444]&#34;&#62;

	&#60;mx:Script&#62;
		&#60;![CDATA[
			import mx.controls.Alert;
			import [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a quick and easy way of using ModuleLoader to load other sections of your &#8220;site&#8221;, just remember that the modules that you are loading are not any ol&#8217; regular swfs like the ones that you can export from flash, they are modules specifically for the ModuleLoader.</p>
<p><span id="more-12"></span></p>
<p>&nbsp;</p>
<p><iframe src="http://letsflex.com/examples/coding/module-loader/" width="100%" height="400" frameborder="0"></iframe>
</p>
<p><b>MXML File</b></p>
<div class="codeContainer">
<pre class="code">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
	&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;
		layout=&quot;absolute&quot;
		themeColor=&quot;#FF6600&quot;
		backgroundGradientAlphas=&quot;[1.0, 1.0]&quot;
		backgroundGradientColors=&quot;[#222222, #444444]&quot;&gt;

	&lt;mx:Script&gt;
		&lt;![CDATA[
			import mx.controls.Alert;
			import mx.controls.buttonBarClasses.ButtonBarButton;
			import mx.events.ItemClickEvent;
			import mx.utils.ObjectUtil;

			private function buttonBar_itemClick(evt:ItemClickEvent):void {
				if (evt.label == &quot;Home&quot;) {
					modLoader.url = &quot;Page01.swf&quot;;
			}

			if (evt.label == &quot;About&quot;) {
				modLoader.url = &quot;Page02.swf&quot;;
			}

			if (evt.label == &quot;Contact&quot;) {
				modLoader.url = &quot;Page03.swf&quot;;
			}
		}
		]]&gt;
	&lt;/mx:Script&gt;

	&lt;mx:Array id=&quot;arr&quot;&gt;
		&lt;mx:Object label=&quot;Home&quot; page=&quot;Page01.swf&quot; /&gt;
		&lt;mx:Object label=&quot;About&quot; page=&quot;Page02.swf&quot; /&gt;
		&lt;mx:Object label=&quot;Contact&quot; page=&quot;Page03.swf&quot; /&gt;
	&lt;/mx:Array&gt;

	&lt;mx:Label y=&quot;19&quot; text=&quot;Mini Site&quot; color=&quot;#FF6600&quot; fontWeight=&quot;bold&quot; fontSize=&quot;20&quot; horizontalCenter=&quot;-150&quot;/&gt;

	&lt;mx:ToggleButtonBar id=&quot;buttonBar&quot;
		dataProvider=&quot;{arr}&quot;
		itemClick=&quot;buttonBar_itemClick(event);&quot;
		horizontalCenter=&quot;73&quot;
		top=&quot;22&quot;
		width=&quot;254&quot;/&gt;

	&lt;mx:ModuleLoader id=&quot;modLoader&quot;
		url=&quot;Page01.swf&quot;
		backgroundColor=&quot;#EEEEEE&quot;
		horizontalCenter=&quot;0&quot;
		top=&quot;50&quot;
		width=&quot;400&quot; height=&quot;300&quot;/&gt;

&lt;/mx:Application&gt;
	</pre>
</div>
<div class="viewsourceContainer"><a href="http://letsflex.com/examples/coding/module-loader/srcview/">VIEW SOURCE</a></div>
]]></content:encoded>
			<wfw:commentRss>http://letsflex.com/actionscript/module-loader/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>google maps: geocoding with text input fields</title>
		<link>http://letsflex.com/google-maps/google-maps-geocoding-with-text-input-fields</link>
		<comments>http://letsflex.com/google-maps/google-maps-geocoding-with-text-input-fields#comments</comments>
		<pubDate>Wed, 26 Nov 2008 17:19:54 +0000</pubDate>
		<dc:creator>jlagunas</dc:creator>
				<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[geocoding]]></category>
		<category><![CDATA[TextInput]]></category>

		<guid isPermaLink="false">http://letsflex.com/?p=14</guid>
		<description><![CDATA[This google maps examples contains text input fields for the address, city, state and zip code which are then used to geocode and place a marker on that latitude and longitude. the markers themselves are clickable and contain its address.
note: you will need to download the Google Maps API for Flash SDK.

&#160;


MXML File


&#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62;
	&#60;mx:Application [...]]]></description>
			<content:encoded><![CDATA[<p>This google maps examples contains text input fields for the address, city, state and zip code which are then used to geocode and place a marker on that latitude and longitude. the markers themselves are clickable and contain its address.</p>
<p><i>note: you will need to download the <a href="http://maps.googleapis.com/maps/flash/release/sdk.zip" target="_blank"><b>Google Maps API for Flash SDK</b></a>.</i></p>
<p><span id="more-14"></span></p>
<p>&nbsp;</p>
<p><iframe src="http://letsflex.com/examples/coding/googleMaps/geocoding-with-textInput/" width="100%" height="300" frameborder="0"></iframe>
</p>
<p><b>MXML File</b></p>
<div class="codeContainer">
<pre class="code">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
	&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; width=&quot;100%&quot; height=&quot;100%&quot; layout=&quot;absolute&quot; initialize=&quot;initializeHandler(event);&quot; backgroundColor=&quot;0xffffff&quot;&gt;

		&lt;mx:Style&gt;
			Label { font-weight: bold; }
		&lt;/mx:Style&gt;

		&lt;mx:Script&gt;
			&lt;![CDATA[
				import mx.controls.Alert;
				import mx.events.ResizeEvent;

				import com.google.maps.interfaces.IMapType;
				import com.google.maps.InfoWindowOptions;
				import com.google.maps.overlays.Marker;
				import com.google.maps.services.Placemark;
				import com.google.maps.services.GeocodingEvent;
				import com.google.maps.services.ClientGeocoder;
				import com.google.maps.controls.ZoomControl;
				import com.google.maps.MapType;
				import com.google.maps.MapZoomEvent;
				import com.google.maps.MapMouseEvent;
				import com.google.maps.LatLng;
				import com.google.maps.MapEvent;
				import com.google.maps.Map;

				private var map:Map;
				private var geocoder:ClientGeocoder;
				private var contentFormat:TextFormat;
				private var mapTypes:Array;
				private var currentMapType:Number;

				[Bindable]
				private var currentMapZoom:Number;

				private function initializeHandler(event:Event):void
				{
					map = new Map();
					map.key = &quot;PLACE YOUR API KEY HERE&quot;;
					map.addEventListener(MapEvent.MAP_READY, mapReadyHandler);
					map.addEventListener(MapZoomEvent.ZOOM_RANGE_CHANGED, updateMapZoom);

					mapComponent.addChild(map);
				}

				private function mapReadyHandler(event:MapEvent):void
				{
					currentMapZoom = 11;

					geoCoder(null);
					intMapType();
					intMapZoom();
				}

				private function geoCoder(event:Event):void
				{
					geocoder = new ClientGeocoder();
					geocoder.addEventListener(GeocodingEvent.GEOCODING_SUCCESS, geocodingSuccessHandler);
					geocoder.addEventListener(GeocodingEvent.GEOCODING_FAILURE, geocodingFailureHandler);
					geocoder.geocode(address.text + &quot; &quot; + city.text + &quot;, &quot; + state.text + &quot; &quot; + zip.text);
				}

				private function geocodingSuccessHandler(event:GeocodingEvent):void
				{
					var placeMarkers:Array = event.response.placemarks;

					if (placeMarkers.length &gt; 0)
					{
						map.setCenter(placeMarkers[0].point, currentMapZoom);

						var marker:Marker = new Marker(placeMarkers[0].point);
						marker.addEventListener(MapMouseEvent.CLICK, markerClickHandler);

						function markerClickHandler(event:MapMouseEvent):void
						{
							contentFormat = new TextFormat();
							contentFormat.font = &quot;Arial&quot;;
							contentFormat.size = 12;

							var address:String = placeMarkers[0].address;

							var infoWindow:InfoWindowOptions = new InfoWindowOptions();
							// USE REPLACE TO FIND THE FIRST COMMA AT THE END OF THE PHYSICAL ADDRESS
							// AND SWAP IT OUT WITH A NEW LINE FOR THE CITY, STATE, ZIP CODE AND COUNTRY
							infoWindow.content = address.replace(&quot;, &quot;, &quot;n&quot;);
							infoWindow.contentFormat = contentFormat;
							infoWindow.padding = 10;

							marker.openInfoWindow(infoWindow);
						}

					map.addOverlay(marker);

					}
				}

				private function geocodingFailureHandler(event:GeocodingEvent):void
				{
					Alert.show(&quot;can not locate: &quot; + event.name);
				}

				private function mapResizeHandler(event:ResizeEvent):void
				{
					map.setSize(new Point(mapComponent.width, mapComponent.height));
				}

				private function intMapType():void
				{
					mapTypes = new Array(MapType.NORMAL_MAP_TYPE, MapType.SATELLITE_MAP_TYPE, MapType.HYBRID_MAP_TYPE, MapType.PHYSICAL_MAP_TYPE);

					if(!currentMapType)
						currentMapType = 0;

					mapType.dataProvider = mapTypes;
					mapType.labelFunction = getMapTypeLabels;
					mapType.selectedIndex = currentMapType;

					map.enableScrollWheelZoom();
					map.enableContinuousZoom();
				}

				private function mapTypeChangeHandler():void
				{
					currentMapType = mapType.selectedIndex;
					map.setMapType(IMapType(mapTypes[currentMapType]));
				}

				private function getMapTypeLabels(item:Object):String
				{
					return IMapType(item).getName();
				}

				private function intMapZoom():void
				{
					mapZoomSlider.minimum = map.getMinZoomLevel();
					mapZoomSlider.maximum = map.getMaxZoomLevel();
					mapZoomSlider.allowTrackClick = true;
				}

				private function mapZoomChangeHandler():void
				{
					currentMapZoom = mapZoomSlider.value;

					if(map.isLoaded())
						map.setZoom(currentMapZoom);
				}

				private function updateMapZoom(event:MapEvent):void
				{
					currentMapZoom = map.getZoom();
					mapZoomSlider.value = currentMapZoom;
				}

			]]&gt;
		&lt;/mx:Script&gt;

		&lt;mx:UIComponent id=&quot;mapComponent&quot; width=&quot;100%&quot; height=&quot;100%&quot; resize=&quot;mapResizeHandler(event);&quot; /&gt;

			&lt;mx:ApplicationControlBar width=&quot;100%&quot; cornerRadius=&quot;0&quot; fillColors=&quot;[0xFFFFFF, 0xFFFFFF]&quot; fillAlphas=&quot;[1,1]&quot;&gt;

				&lt;mx:Label text=&quot;adrress:&quot; /&gt;
				&lt;mx:TextInput id=&quot;address&quot; width=&quot;150&quot; text=&quot;1990 e grand ave&quot; toolTip=&quot;Address Text Input&quot; /&gt;

				&lt;mx:Label text=&quot;city:&quot; /&gt;
				&lt;mx:TextInput id=&quot;city&quot; width=&quot;150&quot; text=&quot;el segundo&quot; toolTip=&quot;City Text Input&quot; /&gt;

				&lt;mx:Label text=&quot;state:&quot; /&gt;
				&lt;mx:TextInput id=&quot;state&quot; maxChars=&quot;2&quot; width=&quot;25&quot; text=&quot;ca&quot; toolTip=&quot;State Text Input&quot; /&gt;

				&lt;mx:Label text=&quot;zip:&quot; /&gt;
				&lt;mx:TextInput id=&quot;zip&quot; maxChars=&quot;5&quot; width=&quot;50&quot; text=&quot;90245&quot; toolTip=&quot;Zip Text Input&quot; /&gt;

				&lt;mx:Button label=&quot;find&quot; click=&quot;geoCoder(event);&quot; /&gt;

				&lt;mx:Spacer width=&quot;100%&quot; /&gt;

				&lt;mx:ComboBox id=&quot;mapType&quot; change=&quot;mapTypeChangeHandler();&quot; fillColors=&quot;[0xFFFFFF, 0xFFFFFF]&quot; fillAlphas=&quot;[1,1]&quot; toolTip=&quot;Map Type&quot; /&gt;
			&lt;/mx:ApplicationControlBar&gt;

			&lt;mx:Box left=&quot;10&quot; top=&quot;50&quot; paddingBottom=&quot;5&quot; paddingLeft=&quot;5&quot; paddingRight=&quot;5&quot; paddingTop=&quot;5&quot; backgroundColor=&quot;0xffffff&quot; borderStyle=&quot;solid&quot; cornerRadius=&quot;5&quot;&gt;
				&lt;mx:VSlider id=&quot;mapZoomSlider&quot; change=&quot;mapZoomChangeHandler();&quot; value=&quot;{currentMapZoom}&quot; dataTipPlacement=&quot;right&quot; liveDragging=&quot;true&quot; tickLength=&quot;0&quot; snapInterval=&quot;1&quot; toolTip=&quot;Map Zoom Slider&quot; /&gt;
			&lt;/mx:Box&gt;

	&lt;/mx:Application&gt;</pre>
</div>
<div class="viewsourceContainer"><a href="http://letsflex.com/examples/coding/googleMaps/geocoding-with-textInput/srcview/index.html">VIEW SOURCE</a></div>
]]></content:encoded>
			<wfw:commentRss>http://letsflex.com/google-maps/google-maps-geocoding-with-text-input-fields/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>google maps: controls</title>
		<link>http://letsflex.com/google-maps/google-map-controls</link>
		<comments>http://letsflex.com/google-maps/google-map-controls#comments</comments>
		<pubDate>Wed, 26 Nov 2008 06:27:20 +0000</pubDate>
		<dc:creator>jlagunas</dc:creator>
				<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[Combobox]]></category>
		<category><![CDATA[Controls]]></category>
		<category><![CDATA[geocoding]]></category>
		<category><![CDATA[mapType]]></category>
		<category><![CDATA[vSlider]]></category>
		<category><![CDATA[zoom]]></category>

		<guid isPermaLink="false">http://letsflex.com/?p=13</guid>
		<description><![CDATA[Don&#8217;t feel like using the default controls that google provides? Well here is an example on using a ComboBox component for the different map types and a VSlider for zooming in and out.
note: you will need to download the Google Maps API for Flash SDK.

&#160;


MXML File

&#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62;
	&#60;mx:Application xmlns:mx=&#34;http://www.adobe.com/2006/mxml&#34; width=&#34;100%&#34; height=&#34;100%&#34; layout=&#34;absolute&#34; initialize=&#34;initializeHandler(event);&#34; backgroundColor=&#34;0xffffff&#34;&#62;

		&#60;mx:Style&#62;
			Label { [...]]]></description>
			<content:encoded><![CDATA[<p>Don&#8217;t feel like using the default controls that google provides? Well here is an example on using a ComboBox component for the different map types and a VSlider for zooming in and out.</p>
<p><i>note: you will need to download the <a href="http://maps.googleapis.com/maps/flash/release/sdk.zip" target="_blank"><b>Google Maps API for Flash SDK</b></a>.</i></p>
<p><span id="more-13"></span></p>
<p>&nbsp;</p>
<p><iframe src="http://letsflex.com/examples/coding/googleMaps/controls/" width="100%" height="300" frameborder="0"></iframe>
</p>
<p><b>MXML File</b></p>
<div class="codeContainer">
<pre class="code">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
	&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; width=&quot;100%&quot; height=&quot;100%&quot; layout=&quot;absolute&quot; initialize=&quot;initializeHandler(event);&quot; backgroundColor=&quot;0xffffff&quot;&gt;

		&lt;mx:Style&gt;
			Label { font-weight: bold; }
		&lt;/mx:Style&gt;

		&lt;mx:Script&gt;
			&lt;![CDATA[
				import mx.controls.Alert;
				import mx.events.ResizeEvent;

				import com.google.maps.interfaces.IMapType;
				import com.google.maps.InfoWindowOptions;
				import com.google.maps.overlays.Marker;
				import com.google.maps.services.Placemark;
				import com.google.maps.services.GeocodingEvent;
				import com.google.maps.services.ClientGeocoder;
				import com.google.maps.controls.ZoomControl;
				import com.google.maps.MapType;
				import com.google.maps.MapZoomEvent;
				import com.google.maps.MapMouseEvent;
				import com.google.maps.LatLng;
				import com.google.maps.MapEvent;
				import com.google.maps.Map;

				private var map:Map;
				private var geocoder:ClientGeocoder;
				private var contentFormat:TextFormat;
				private var mapTypes:Array;
				private var currentMapType:Number;

				[Bindable]
				private var currentMapZoom:Number;

				private function initializeHandler(event:Event):void
				{
					map = new Map();
					map.key = &quot;PLACE YOUR API KEY HERE&quot;;
					map.addEventListener(MapEvent.MAP_READY, mapReadyHandler);
					map.addEventListener(MapZoomEvent.ZOOM_RANGE_CHANGED, updateMapZoom);

					mapComponent.addChild(map);
				}

				private function mapReadyHandler(event:MapEvent):void
				{
					currentMapZoom = 11;

					geoCoder(null);
					intMapType();
					intMapZoom();
				}

				private function geoCoder(event:Event):void
				{
					geocoder = new ClientGeocoder();
					geocoder.addEventListener(GeocodingEvent.GEOCODING_SUCCESS, geocodingSuccessHandler);
					geocoder.addEventListener(GeocodingEvent.GEOCODING_FAILURE, geocodingFailureHandler);
					geocoder.geocode(&quot;1990 e grand ave el segundo ca 90245&quot;);
				}

				private function geocodingSuccessHandler(event:GeocodingEvent):void
				{
					var placeMarkers:Array = event.response.placemarks;

					if (placeMarkers.length &gt; 0)
					{
						map.setCenter(placeMarkers[0].point, currentMapZoom);

						var marker:Marker = new Marker(placeMarkers[0].point);
						marker.addEventListener(MapMouseEvent.CLICK, markerClickHandler);

						function markerClickHandler(event:MapMouseEvent):void
						{
							contentFormat = new TextFormat();
							contentFormat.font = &quot;Arial&quot;;
							contentFormat.size = 12;

							var address:String = placeMarkers[0].address;

							var infoWindow:InfoWindowOptions = new InfoWindowOptions();
							// USE REPLACE TO FIND THE FIRST COMMA AT THE END OF THE PHYSICAL ADDRESS
							// AND SWAP IT OUT WITH A NEW LINE FOR THE CITY, STATE, ZIP CODE AND COUNTRY
							infoWindow.content = address.replace(&quot;, &quot;, &quot;n&quot;);
							infoWindow.contentFormat = contentFormat;
							infoWindow.padding = 10;

							marker.openInfoWindow(infoWindow);
						}

					map.addOverlay(marker);

					}
				}

				private function geocodingFailureHandler(event:GeocodingEvent):void
				{
					Alert.show(&quot;can not locate: &quot; + event.name);
				}

				private function mapResizeHandler(event:ResizeEvent):void

				{
					map.setSize(new Point(mapComponent.width, mapComponent.height));
				}

				private function intMapType():void
				{
					mapTypes = new Array(MapType.NORMAL_MAP_TYPE, MapType.SATELLITE_MAP_TYPE, MapType.HYBRID_MAP_TYPE, MapType.PHYSICAL_MAP_TYPE);

					if(!currentMapType)
						currentMapType = 0;

					mapType.dataProvider = mapTypes;
					mapType.labelFunction = getMapTypeLabels;
					mapType.selectedIndex = currentMapType;

					map.enableScrollWheelZoom();
					map.enableContinuousZoom();
				}

				private function mapTypeChangeHandler():void
				{
					currentMapType = mapType.selectedIndex;
					map.setMapType(IMapType(mapTypes[currentMapType]));
				}

				private function getMapTypeLabels(item:Object):String
				{
					return IMapType(item).getName();
				}

				private function intMapZoom():void
				{
					mapZoomSlider.minimum = map.getMinZoomLevel();
					mapZoomSlider.maximum = map.getMaxZoomLevel();
					mapZoomSlider.allowTrackClick = true;
				}

				private function mapZoomChangeHandler():void
				{
					currentMapZoom = mapZoomSlider.value;

					if(map.isLoaded())
						map.setZoom(currentMapZoom);
				}

				private function updateMapZoom(event:MapEvent):void
				{
					currentMapZoom = map.getZoom();
					mapZoomSlider.value = currentMapZoom;
				}

			]]&gt;
		&lt;/mx:Script&gt;

		&lt;mx:UIComponent id=&quot;mapComponent&quot; width=&quot;100%&quot; height=&quot;100%&quot; resize=&quot;mapResizeHandler(event);&quot; /&gt;

			&lt;mx:ComboBox id=&quot;mapType&quot; change=&quot;mapTypeChangeHandler();&quot; fillColors=&quot;[0xFFFFFF, 0xFFFFFF]&quot; fillAlphas=&quot;[1,1]&quot; toolTip=&quot;Map Type&quot; top=&quot;10&quot; right=&quot;10&quot; /&gt;

			&lt;mx:Box left=&quot;10&quot; top=&quot;10&quot; paddingBottom=&quot;5&quot; paddingLeft=&quot;5&quot; paddingRight=&quot;5&quot; paddingTop=&quot;5&quot; backgroundColor=&quot;0xffffff&quot; borderStyle=&quot;solid&quot; cornerRadius=&quot;5&quot;&gt;
				&lt;mx:VSlider id=&quot;mapZoomSlider&quot; change=&quot;mapZoomChangeHandler();&quot; value=&quot;{currentMapZoom}&quot; dataTipPlacement=&quot;right&quot; liveDragging=&quot;true&quot; tickLength=&quot;0&quot; snapInterval=&quot;1&quot; toolTip=&quot;Map Zoom Slider&quot; /&gt;
			&lt;/mx:Box&gt;

	&lt;/mx:Application&gt;</pre>
</div>
<div class="viewsourceContainer"><a href="http://letsflex.com/examples/coding/googleMaps/controls/srcview/index.html">VIEW SOURCE</a></div>
]]></content:encoded>
			<wfw:commentRss>http://letsflex.com/google-maps/google-map-controls/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>google maps: InfoWindowOptions.customContent</title>
		<link>http://letsflex.com/google-maps/google-maps-infowindowoptionscustomcontent</link>
		<comments>http://letsflex.com/google-maps/google-maps-infowindowoptionscustomcontent#comments</comments>
		<pubDate>Tue, 25 Nov 2008 21:52:34 +0000</pubDate>
		<dc:creator>jlagunas</dc:creator>
				<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[customContent]]></category>
		<category><![CDATA[geocoding]]></category>
		<category><![CDATA[InfoWindowOptions]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://letsflex.com/?p=10</guid>
		<description><![CDATA[The following example continues from the previous post google maps geocoding service by using the customContent parameter to display an image instead of using the content parameter to display company information.
note: you will need to download the Google Maps API for Flash SDK Version 1.8a.

&#160;


MXML File


&#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62;
	&#60;mx:Application xmlns:mx=&#34;http://www.adobe.com/2006/mxml&#34; width=&#34;100%&#34; height=&#34;100%&#34; layout=&#34;absolute&#34; initialize=&#34;initializeHandler(event);&#34; viewSourceURL=&#34;srcview/index.html&#34;&#62;

		&#60;mx:Script&#62;
			&#60;![CDATA[
				import mx.controls.Alert;
				import [...]]]></description>
			<content:encoded><![CDATA[<p>The following example continues from the previous post <a href="http://letsflex.com/?p=11"><strong>google maps geocoding service</strong></a> by using the customContent parameter to display an image instead of using the content parameter to display company information.</p>
<p><i>note: you will need to download the <a href="http://maps.googleapis.com/maps/flash/release/sdk.zip" target="_blank"><b>Google Maps API for Flash SDK Version 1.8a</b></a>.</i></p>
<p><span id="more-10"></span></p>
<p>&nbsp;</p>
<p><iframe src="http://letsflex.com/examples/coding/googleMaps/custom-content/" width="100%" height="300" frameborder="0"></iframe>
</p>
<p><b>MXML File</b></p>
<div class="codeContainer">
<pre class="code">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
	&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; width=&quot;100%&quot; height=&quot;100%&quot; layout=&quot;absolute&quot; initialize=&quot;initializeHandler(event);&quot; viewSourceURL=&quot;srcview/index.html&quot;&gt;

		&lt;mx:Script&gt;
			&lt;![CDATA[
				import mx.controls.Alert;
				import mx.events.ResizeEvent;
				import mx.rpc.events.ResultEvent;
				import mx.rpc.events.FaultEvent;

				import com.google.maps.InfoWindowOptions;
				import com.google.maps.overlays.Marker;
				import com.google.maps.services.Placemark;
				import com.google.maps.services.GeocodingEvent;
				import com.google.maps.services.GeocodingResponse;
				import com.google.maps.services.ClientGeocoder;
				import com.google.maps.MapMouseEvent;
				import com.google.maps.LatLng;
				import com.google.maps.MapEvent;
				import com.google.maps.Map;

				private var map:Map;
				private var geocoder:ClientGeocoder;
				private var marker:Marker;
				private var xmlRequest:URLRequest;
				private var xmlLoader:URLLoader;
				private var xml:XML;
				private var xmlList:XMLList;
				private var companyName:String;
				private var companyAddress:String;
				private var companyCity:String;
				private var companyState:String;
				private var companyZip:String;
				private var companyLogo:String; // ADDED TO SHOW COMPANY LOGO
				private var titleFormat:TextFormat;
				private var contentFormat:TextFormat;

				private function initializeHandler(event:Event):void
				{
					map = new Map();
					map.key = &quot;ABQIAAAATWQnNGYYF28knwWIESB8zhRLz8UzBuuxzPpAro5QNlTIlTn1thTHQ2SeYGgkJAudO3Ky8iX2UYjyCQ&quot;;
					map.addEventListener(MapEvent.MAP_READY, mapReadyHandler);

					mapComponent.addChild(map);
				}

				private function mapReadyHandler(event:MapEvent):void
				{
					xmlRequest = new URLRequest(&quot;address.xml&quot;);
					xmlLoader = new URLLoader(xmlRequest);
					xmlLoader.addEventListener(&quot;complete&quot;, xmlLoaderHandler);
				}

				private function xmlLoaderHandler(event:Event):void
				{
					xml = new XML(event.target.data);
					xmlList = xml..marker;

					companyName = xmlList.@name;
					companyAddress = xmlList.@address;
					companyCity = xmlList.@city;
					companyState = xmlList.@state;
					companyZip = xmlList.@zip;
					companyLogo = xmlList.@image; // COMPANY LOGO

					geocoder = new ClientGeocoder();
					geocoder.addEventListener(GeocodingEvent.GEOCODING_SUCCESS, geocodingSuccessHandler);
					geocoder.addEventListener(GeocodingEvent.GEOCODING_FAILURE, geocodingFailureHandler);
					geocoder.geocode(companyAddress + &quot; &quot; + companyCity + &quot;, &quot; + companyState + &quot; &quot; + companyZip);
				}

				private function geocodingSuccessHandler(event:GeocodingEvent):void
				{
					marker = new Marker(GeocodingResponse(event.response).placemarks[0].point);
					marker.addEventListener(MapMouseEvent.CLICK, markerClickHandler);

					map.addOverlay(marker);
					map.setCenter(GeocodingResponse(event.response).placemarks[0].point, 11);
				}

				private function geocodingFailureHandler(event:GeocodingEvent):void
				{
					Alert.show(&quot;can not locate: &quot; + event.name);
				}

				private function markerClickHandler(event:MapMouseEvent):void
				{
					titleFormat = new TextFormat();
					titleFormat.font = &quot;Arial&quot;;
					titleFormat.size = 14;
					titleFormat.bold = true;

					contentFormat = new TextFormat();
					contentFormat.font = &quot;Arial&quot;;
					contentFormat.size = 12;

					var urlRequest:URLRequest = new URLRequest(companyLogo);
					var imageLoader:Loader = new Loader();
					imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, function(event:Event):void
					{
						var infoWindow:InfoWindowOptions = new InfoWindowOptions();
						infoWindow.title = companyName;
						infoWindow.titleFormat = titleFormat;
						//
						// CURRENTLY THERE IS NO WAY OF ADDING STINGS INTO THE CUSTOMCONTENT PARAMETER
						//
						//infoWindow.content = companyAddress + &quot;n&quot; + companyCity + &quot;, &quot; + companyState + &quot; &quot; + companyZip;
						//infoWindow.contentFormat = contentFormat;
						infoWindow.customContent = imageLoader;
						infoWindow.drawDefaultFrame = true;
						infoWindow.padding = 10;
						infoWindow.width = (imageLoader.width + 10);
						infoWindow.height = (imageLoader.height + 10);

						marker.openInfoWindow(infoWindow);
					});

					imageLoader.load(urlRequest);
				}

				private function mapResizeHandler(event:ResizeEvent):void
				{
					map.setSize(new Point(mapComponent.width, mapComponent.height));
				}
			]]&gt;
		&lt;/mx:Script&gt;

		&lt;mx:UIComponent id=&quot;mapComponent&quot; width=&quot;100%&quot; height=&quot;100%&quot; resize=&quot;mapResizeHandler(event);&quot; /&gt;

	&lt;/mx:Application&gt;</pre>
</div>
<div class="viewsourceContainer"><a href="http://letsflex.com/examples/coding/googleMaps/custom-content/srcview/source/customContent.mxml.html">VIEW SOURCE</a></div>
<p><b>XML File</b></p>
<div class="codeContainer">
<pre class="code">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
	&lt;markers&gt;
	&lt;marker name=&quot;ad2, Inc.&quot; address=&quot;1990 e. grand ave&quot; city=&quot;el segundo&quot; state=&quot;ca&quot; zip=&quot;90245&quot; image=&quot;ad2 logo_black.jpg&quot; /&gt;
&lt;/markers&gt;</pre>
</div>
<div class="viewsourceContainer"><a href="http://letsflex.com/examples/coding/googleMaps/custom-content/srcview/source/address.xml.txt">VIEW XML</a></div>
]]></content:encoded>
			<wfw:commentRss>http://letsflex.com/google-maps/google-maps-infowindowoptionscustomcontent/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>google maps: geocoding service</title>
		<link>http://letsflex.com/google-maps/google-maps-geocoding-service</link>
		<comments>http://letsflex.com/google-maps/google-maps-geocoding-service#comments</comments>
		<pubDate>Tue, 26 Aug 2008 17:53:01 +0000</pubDate>
		<dc:creator>jlagunas</dc:creator>
				<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[geocoding]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://letsflex.com/?p=11</guid>
		<description><![CDATA[The following example shows you an introduction to google&#8217;s map geocoding service to find your address from an xml file.
note: you will need to download the Google Maps API for Flash SDK.

&#160;

MXML File


&#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62;
	&#60;mx:Application xmlns:mx=&#34;http://www.adobe.com/2006/mxml&#34; width=&#34;100%&#34; height=&#34;100%&#34; layout=&#34;absolute&#34; initialize=&#34;initializeHandler(event);&#34; viewSourceURL=&#34;srcview/index.html&#34;&#62;
		&#60;mx:Script&#62;
			&#60;![CDATA[
				import mx.controls.Alert;
				import mx.events.ResizeEvent;
				import mx.rpc.events.ResultEvent;
				import mx.rpc.events.FaultEvent;
				import com.google.maps.InfoWindowOptions;
				import com.google.maps.overlays.Marker;
				import com.google.maps.services.Placemark;
				import com.google.maps.services.GeocodingEvent;
				import com.google.maps.services.GeocodingResponse;
				import com.google.maps.services.ClientGeocoder;
				import com.google.maps.MapMouseEvent;
				import com.google.maps.LatLng;
				import com.google.maps.MapEvent;
				import com.google.maps.Map;

				private [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows you an introduction to google&#8217;s map geocoding service to find your address from an xml file.</p>
<p><i>note: you will need to download the <a href="http://maps.googleapis.com/maps/flash/release/sdk.zip" target="_blank"><b>Google Maps API for Flash SDK</b></a>.</i></p>
<p><span id="more-11"></span></p>
<p>&nbsp;</p>
<p><iframe src="http://letsflex.com/examples/coding/googleMaps/xml-geocoding/" width="100%" height="300" frameborder="0"></iframe></p>
<p><b>MXML File</b></p>
<div class="codeContainer">
<pre class="code">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
	&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; width=&quot;100%&quot; height=&quot;100%&quot; layout=&quot;absolute&quot; initialize=&quot;initializeHandler(event);&quot; viewSourceURL=&quot;srcview/index.html&quot;&gt;
		&lt;mx:Script&gt;
			&lt;![CDATA[
				import mx.controls.Alert;
				import mx.events.ResizeEvent;
				import mx.rpc.events.ResultEvent;
				import mx.rpc.events.FaultEvent;
				import com.google.maps.InfoWindowOptions;
				import com.google.maps.overlays.Marker;
				import com.google.maps.services.Placemark;
				import com.google.maps.services.GeocodingEvent;
				import com.google.maps.services.GeocodingResponse;
				import com.google.maps.services.ClientGeocoder;
				import com.google.maps.MapMouseEvent;
				import com.google.maps.LatLng;
				import com.google.maps.MapEvent;
				import com.google.maps.Map;

				private var map:Map;
				private var geocoder:ClientGeocoder;
				private var marker:Marker;
				private var xmlRequest:URLRequest;
				private var xmlLoader:URLLoader;
				private var xml:XML;
				private var xmlList:XMLList;
				private var companyName:String;
				private var companyAddress:String;
				private var companyCity:String;
				private var companyState:String;
				private var companyZip:String;
				private var titleFormat:TextFormat;
				private var contentFormat:TextFormat;

				private function initializeHandler(event:Event):void
				{
					map = new Map();
					map.key = &quot;PLACE YOUR API KEY HERE&quot;;
					map.addEventListener(MapEvent.MAP_READY, mapReadyHandler);

					mapComponent.addChild(map);
				}

				private function mapReadyHandler(event:MapEvent):void
				{
					xmlRequest = new URLRequest(&quot;address.xml&quot;);
					xmlLoader = new URLLoader(xmlRequest);
					xmlLoader.addEventListener(&quot;complete&quot;, xmlLoaderHandler);
				}

				private function xmlLoaderHandler(event:Event):void
				{
					xml = new XML(event.target.data);
					xmlList = xml..marker;

					companyName = xmlList.@name;
					companyAddress = xmlList.@address;
					companyCity = xmlList.@city;
					companyState = xmlList.@state;
					companyZip = xmlList.@zip;

					geocoder = new ClientGeocoder();
					geocoder.addEventListener(GeocodingEvent.GEOCODING_SUCCESS, geocodingSuccessHandler);
					geocoder.addEventListener(GeocodingEvent.GEOCODING_FAILURE, geocodingFailureHandler);
					geocoder.geocode(companyAddress + &quot; &quot; + companyCity + &quot;, &quot; + companyState + &quot; &quot; + companyZip);
				}

				private function geocodingSuccessHandler(event:GeocodingEvent):void
				{
					marker = new Marker(GeocodingResponse(event.response).placemarks[0].point);
					marker.addEventListener(MapMouseEvent.CLICK, markerClickHandler);

					map.addOverlay(marker);
					map.setCenter(GeocodingResponse(event.response).placemarks[0].point, 11);
				}

				private function geocodingFailureHandler(event:GeocodingEvent):void
				{
					Alert.show(&quot;can not locate: &quot; + event.name);
				}

				private function markerClickHandler(event:MapMouseEvent):void
				{
					titleFormat = new TextFormat();
					titleFormat.font = &quot;Arial&quot;;
					titleFormat.size = 14;
					titleFormat.bold = true;

					contentFormat = new TextFormat();
					contentFormat.font = &quot;Arial&quot;;
					contentFormat.size = 12;

					var infoWindow:InfoWindowOptions = new InfoWindowOptions();
					infoWindow.title = companyName;
					infoWindow.titleFormat = titleFormat;
					infoWindow.content = companyAddress + &quot;n&quot; + companyCity + &quot;, &quot; + companyState + &quot; &quot; + companyZip;
					infoWindow.contentFormat = contentFormat;
					infoWindow.padding = 10;
					infoWindow.width = 250;
					infoWindow.height = 100;

					marker.openInfoWindow(infoWindow);
				}

				private function mapResizeHandler(event:ResizeEvent):void
				{
					map.setSize(new Point(mapComponent.width, mapComponent.height));
				}
			]]&gt;
		&lt;/mx:Script&gt;

		&lt;mx:UIComponent id=&quot;mapComponent&quot; width=&quot;100%&quot; height=&quot;100%&quot; resize=&quot;mapResizeHandler(event);&quot; /&gt;

	&lt;/mx:Application&gt;</pre>
</div>
<div class="viewsourceContainer"><a href="http://letsflex.com/examples/coding/googleMaps/xml-geocoding/srcview/">VIEW SOURCE</a></div>
<p><b>XML File</b></p>
<div class="codeContainer">
<pre class="code">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;markers&gt;
	&lt;marker name=&quot;ad2, Inc.&quot; address=&quot;1990 e. grand ave&quot; city=&quot;el segundo&quot; state=&quot;ca&quot; zip=&quot;90245&quot; /&gt;
&lt;/markers&gt;
</pre>
</div>
<div class="viewsourceContainer"><a href="http://letsflex.com/examples/coding/googleMaps/xml-geocoding/srcview/source/address.xml.txt">VIEW XML</a></div>
]]></content:encoded>
			<wfw:commentRss>http://letsflex.com/google-maps/google-maps-geocoding-service/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>button click handler with alert window using AS3</title>
		<link>http://letsflex.com/actionscript/button-click-handler-with-alert-window-using-as3</link>
		<comments>http://letsflex.com/actionscript/button-click-handler-with-alert-window-using-as3#comments</comments>
		<pubDate>Tue, 22 Jul 2008 18:01:09 +0000</pubDate>
		<dc:creator>jlagunas</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Alert]]></category>
		<category><![CDATA[Button]]></category>

		<guid isPermaLink="false">http://letsflex.com/?p=9</guid>
		<description><![CDATA[The following example shows you how to listen for a button click and show an alert window using actionscript 3.



&#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62;
&#60;mx:Application xmlns:mx=&#34;http://www.adobe.com/2006/mxml&#34; layout=&#34;absolute&#34; creationComplete=&#34;initApp(event);&#34; viewSourceURL=&#34;srcview/index.html&#34;&#62;

	&#60;mx:Script&#62;
		&#60;![CDATA[
			import mx.events.FlexEvent;
			import mx.controls.Alert;

			private function initApp(event:FlexEvent):void
			{
				myButton.addEventListener(MouseEvent.CLICK, clickHandler);
			}

			private function clickHandler(event:MouseEvent):void
			{
				var alert:Alert = Alert.show(&#34;you clicked me!&#34;);
			}
		]]&#62;
	&#60;/mx:Script&#62;

	&#60;mx:Button id=&#34;myButton&#34; label=&#34;click me&#34; horizontalCenter=&#34;0&#34; verticalCenter=&#34;0&#34;/&#62;
&#60;/mx:Application&#62;

VIEW SOURCE
]]></description>
			<content:encoded><![CDATA[<p>The following example shows you how to listen for a button click and show an alert window using actionscript 3.</p>
<p><span id="more-9"></span><br />
<iframe src="http://letsflex.com/examples/coding/button-click-AS3" width="100%" height="150" frameborder="0"></iframe></p>
<div class="codeContainer">
<pre class="code">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; layout=&quot;absolute&quot; creationComplete=&quot;initApp(event);&quot; viewSourceURL=&quot;srcview/index.html&quot;&gt;

	&lt;mx:Script&gt;
		&lt;![CDATA[
			import mx.events.FlexEvent;
			import mx.controls.Alert;

			private function initApp(event:FlexEvent):void
			{
				myButton.addEventListener(MouseEvent.CLICK, clickHandler);
			}

			private function clickHandler(event:MouseEvent):void
			{
				var alert:Alert = Alert.show(&quot;you clicked me!&quot;);
			}
		]]&gt;
	&lt;/mx:Script&gt;

	&lt;mx:Button id=&quot;myButton&quot; label=&quot;click me&quot; horizontalCenter=&quot;0&quot; verticalCenter=&quot;0&quot;/&gt;
&lt;/mx:Application&gt;</pre>
</div>
<div class="viewsourceContainer"><a href="http://letsflex.com/examples/coding/button-click-AS3/srcview/index.html">VIEW SOURCE</a></div>
]]></content:encoded>
			<wfw:commentRss>http://letsflex.com/actionscript/button-click-handler-with-alert-window-using-as3/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
