<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4061964841984016538</id><updated>2024-08-31T01:49:24.614-07:00</updated><category term="actionscript"/><category term="air"/><category term="flash"/><category term="swf"/><category term="as3"/><category term="load swf"/><category term="movieclip"/><category term="access"/><category term="addchild"/><category term="animation"/><category term="bitmap"/><category term="chache"/><category term="child"/><category term="clipboard"/><category term="copy"/><category term="data"/><category term="effect"/><category term="elements"/><category term="font"/><category term="image"/><category term="issue"/><category term="load xml"/><category term="properties"/><category term="refresh"/><category term="system"/><category term="typewriter"/><category term="typewriter animation"/><category term="typewriter effect"/><category term="typewriter sound"/><category term="urlloader"/><category term="urlrequest"/><category term="xml"/><title type='text'>Flash and ActionScript </title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://theactionscript.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4061964841984016538/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://theactionscript.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>CODEMYCODE</name><uri>http://www.blogger.com/profile/10874687956027617222</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>4</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4061964841984016538.post-662820196088753262</id><published>2012-09-21T03:06:00.001-07:00</published><updated>2012-09-21T03:07:13.550-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="actionscript"/><category scheme="http://www.blogger.com/atom/ns#" term="air"/><category scheme="http://www.blogger.com/atom/ns#" term="animation"/><category scheme="http://www.blogger.com/atom/ns#" term="as3"/><category scheme="http://www.blogger.com/atom/ns#" term="effect"/><category scheme="http://www.blogger.com/atom/ns#" term="flash"/><category scheme="http://www.blogger.com/atom/ns#" term="font"/><category scheme="http://www.blogger.com/atom/ns#" term="swf"/><category scheme="http://www.blogger.com/atom/ns#" term="typewriter"/><category scheme="http://www.blogger.com/atom/ns#" term="typewriter animation"/><category scheme="http://www.blogger.com/atom/ns#" term="typewriter effect"/><category scheme="http://www.blogger.com/atom/ns#" term="typewriter sound"/><title type='text'>Typewriter Effect in Flash ActionScript AS3</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
Problem Statement&lt;/h3&gt;
&lt;div&gt;
I wish to display text animation in typewriter format.&amp;nbsp;&lt;/div&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
Solution&lt;/h3&gt;
&lt;div&gt;
Use Timer to display letters after typing intervals. Play typing sound each time you display the letter.&lt;/div&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
Source Code&lt;/h3&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;import fl.text.TLFTextField;
import flash.utils.Timer;
import flash.events.TimerEvent;
import flash.events.Event;

const WRITE_TIME:Number = 50;
const BLINK_TIME:Number = 200;
var typewriter_msg:String;
var typewriter_complete_idx:Number=-1;
var blink_timer:Timer = new Timer(BLINK_TIME,0);
var tlf:TLFTextField = new TLFTextField();
tlf.width = stage.stageWidth;
stage.addChild(tlf);

var mySound:Sound = new Sound();
mySound.load(new URLRequest(&quot;type.mp3&quot;));


show_typewriter_msg(&quot;This is a sample message&quot;);

function show_typewriter_msg(msg:String)
{
 stop_blinking();
 typewriter_msg = msg;
 tlf.text = &quot;_&quot;;
 
 var timer:Timer = new Timer(WRITE_TIME,1); 
 timer.addEventListener(TimerEvent.TIMER, write_next_letter);
 timer.start();
}
function write_next_letter(e:TimerEvent)
{
 e.target.removeEventListener(TimerEvent.TIMER, write_next_letter);
  
 if(typewriter_complete_idx &amp;lt; typewriter_msg.length-1)
 {
  typewriter_complete_idx++;
  if( typewriter_msg.substr(typewriter_complete_idx,1) != &quot; &quot;)
  {
   mySound.play();
  }
  tlf.text = typewriter_msg.substr(0,typewriter_complete_idx+1);
  var timer:Timer = new Timer(WRITE_TIME,1); 
  timer.addEventListener(TimerEvent.TIMER, write_cursor);
  timer.start();
 }
 else
 {
  keep_blinking();
 }
}
function write_cursor(e:TimerEvent)
{
 e.target.removeEventListener(TimerEvent.TIMER, write_cursor);

 tlf.appendText(&quot;_&quot;);
 var timer:Timer = new Timer(WRITE_TIME,1); 
 timer.addEventListener(TimerEvent.TIMER, write_next_letter);
 timer.start();
}
function stop_blinking()
{
 blink_timer.removeEventListener(TimerEvent.TIMER, blink_cursor);
 blink_timer.stop();
}
function keep_blinking()
{
 blink_timer.addEventListener(TimerEvent.TIMER, blink_cursor);
 blink_timer.start();
}
function blink_cursor(e:TimerEvent)
{
 if(tlf.text.indexOf(&quot;_&quot;) &amp;gt;-1)
 {
  tlf.text = typewriter_msg;
 }
 else
 {
  tlf.appendText(&quot;_&quot;);
 }
}
&lt;/pre&gt;
&lt;br /&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
Download Source Files&lt;/h3&gt;
You can download source files from &lt;a href=&quot;http://code.google.com/p/typewriter-effect-in-flash-actionscript-as3/downloads/list&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://theactionscript.blogspot.com/feeds/662820196088753262/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theactionscript.blogspot.com/2012/09/typewriter-effect-in-flash-actionscript.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4061964841984016538/posts/default/662820196088753262'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4061964841984016538/posts/default/662820196088753262'/><link rel='alternate' type='text/html' href='http://theactionscript.blogspot.com/2012/09/typewriter-effect-in-flash-actionscript.html' title='Typewriter Effect in Flash ActionScript AS3'/><author><name>CODEMYCODE</name><uri>http://www.blogger.com/profile/10874687956027617222</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4061964841984016538.post-8252628795098461510</id><published>2012-08-31T21:52:00.001-07:00</published><updated>2012-09-21T03:08:52.355-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="actionscript"/><category scheme="http://www.blogger.com/atom/ns#" term="air"/><category scheme="http://www.blogger.com/atom/ns#" term="chache"/><category scheme="http://www.blogger.com/atom/ns#" term="flash"/><category scheme="http://www.blogger.com/atom/ns#" term="issue"/><category scheme="http://www.blogger.com/atom/ns#" term="load swf"/><category scheme="http://www.blogger.com/atom/ns#" term="load xml"/><category scheme="http://www.blogger.com/atom/ns#" term="refresh"/><category scheme="http://www.blogger.com/atom/ns#" term="swf"/><category scheme="http://www.blogger.com/atom/ns#" term="urlloader"/><category scheme="http://www.blogger.com/atom/ns#" term="urlrequest"/><category scheme="http://www.blogger.com/atom/ns#" term="xml"/><title type='text'></title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;Flash AS3 URLRequest and URLLoader Cache Issue&lt;/h2&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;Problem Statement&lt;/h3&gt;&lt;div&gt;I am loading a page from a url, which I dont want to be cahced. I want a refreshed copy each time I try to load it.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;h3&gt;Solution&lt;/h3&gt;&lt;div&gt;Simply change URLRequestHeader values to set &lt;b&gt;no-cache&lt;/b&gt; mode&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;Source Code&lt;/h3&gt;&lt;div&gt;&lt;pre class=&quot;prettyprint&quot;&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;var ldr:URLLoader = new URLLoader();&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;var req:URLRequest = new URLRequest(link );&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;var header:URLRequestHeader = new URLRequestHeader(&quot;pragma&quot;, &quot;no-cache&quot;);&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;req.requestHeaders.push(header);&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;ldr.addEventListener(Event.COMPLETE,onURLLoaded);&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theactionscript.blogspot.com/feeds/8252628795098461510/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theactionscript.blogspot.com/2012/08/flash-as3-urlrequest-and-urlloader.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4061964841984016538/posts/default/8252628795098461510'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4061964841984016538/posts/default/8252628795098461510'/><link rel='alternate' type='text/html' href='http://theactionscript.blogspot.com/2012/08/flash-as3-urlrequest-and-urlloader.html' title=''/><author><name>CODEMYCODE</name><uri>http://www.blogger.com/profile/10874687956027617222</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4061964841984016538.post-3113350458816290888</id><published>2012-08-26T19:29:00.002-07:00</published><updated>2012-08-26T19:31:01.026-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="actionscript"/><category scheme="http://www.blogger.com/atom/ns#" term="air"/><category scheme="http://www.blogger.com/atom/ns#" term="as3"/><category scheme="http://www.blogger.com/atom/ns#" term="bitmap"/><category scheme="http://www.blogger.com/atom/ns#" term="clipboard"/><category scheme="http://www.blogger.com/atom/ns#" term="copy"/><category scheme="http://www.blogger.com/atom/ns#" term="data"/><category scheme="http://www.blogger.com/atom/ns#" term="flash"/><category scheme="http://www.blogger.com/atom/ns#" term="image"/><category scheme="http://www.blogger.com/atom/ns#" term="load swf"/><category scheme="http://www.blogger.com/atom/ns#" term="movieclip"/><category scheme="http://www.blogger.com/atom/ns#" term="swf"/><category scheme="http://www.blogger.com/atom/ns#" term="system"/><title type='text'>How to copy image from clipboard ( Flash AS3 )</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;Problem Statement&lt;/h3&gt;I want to copy image from clipboard directly to Flash. How to do it?&lt;br /&gt;
&lt;br /&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;Solution&lt;/h3&gt;&lt;div&gt;Simply create a clipboard instance and&amp;nbsp;retrieve&amp;nbsp;data in bitmap format. Then create a bitmap using that data!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;Source Code - Flash / AS3 / ActionScript&lt;/h3&gt;&lt;pre class=&quot;prettyprint&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;import flash.display.MovieClip;&lt;/div&gt;&lt;div&gt;import flash.desktop.Clipboard;&lt;/div&gt;&lt;div&gt;import flash.desktop.ClipboardFormats;&lt;/div&gt;&lt;div&gt;import flash.desktop.ClipboardTransferMode;&lt;/div&gt;&lt;div&gt;import flash.display.Bitmap;&lt;/div&gt;&lt;div&gt;import flash.display.BitmapData;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;public function copy_from_clipboard()&lt;/div&gt;&lt;div&gt;{&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;var systemClipboard:Clipboard = Clipboard.generalClipboard;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;var bmd:BitmapData = BitmapData( systemClipboard.getData(ClipboardFormats.BITMAP_FORMAT));&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;bmp = new Bitmap(bmd, &quot;auto&quot;,true);&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;stage.addChild(bmp);&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://theactionscript.blogspot.com/feeds/3113350458816290888/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theactionscript.blogspot.com/2012/08/how-to-copy-image-from-clipboard-flash.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4061964841984016538/posts/default/3113350458816290888'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4061964841984016538/posts/default/3113350458816290888'/><link rel='alternate' type='text/html' href='http://theactionscript.blogspot.com/2012/08/how-to-copy-image-from-clipboard-flash.html' title='How to copy image from clipboard ( Flash AS3 )'/><author><name>CODEMYCODE</name><uri>http://www.blogger.com/profile/10874687956027617222</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4061964841984016538.post-4015354101713506231</id><published>2012-08-23T00:55:00.000-07:00</published><updated>2012-08-26T19:25:28.541-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="access"/><category scheme="http://www.blogger.com/atom/ns#" term="actionscript"/><category scheme="http://www.blogger.com/atom/ns#" term="addchild"/><category scheme="http://www.blogger.com/atom/ns#" term="air"/><category scheme="http://www.blogger.com/atom/ns#" term="as3"/><category scheme="http://www.blogger.com/atom/ns#" term="child"/><category scheme="http://www.blogger.com/atom/ns#" term="elements"/><category scheme="http://www.blogger.com/atom/ns#" term="flash"/><category scheme="http://www.blogger.com/atom/ns#" term="load swf"/><category scheme="http://www.blogger.com/atom/ns#" term="movieclip"/><category scheme="http://www.blogger.com/atom/ns#" term="properties"/><category scheme="http://www.blogger.com/atom/ns#" term="swf"/><title type='text'>How to access elements in child swf</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
Accessing child SWF elements&lt;/h2&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
Problem Statement&lt;/h3&gt;
I want to load a child SWF and then access elements or movieclips in parent SWF. How to do it?&lt;br /&gt;
&lt;br /&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
Solution&lt;/h3&gt;
&lt;div&gt;
In child FLA (from which the child SWF is generated), make sure you have a document class.&lt;/div&gt;
Load the SWF in parent using Loader.&lt;br /&gt;
Then typecast loader content to child Document.&lt;br /&gt;
You can start using this typecasted object to access public elements of child SWF.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
Source Code - Flash / AS3 / ActionScript&lt;/h3&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;/*CHILD DOCUMENT CLASS START*/
package  
{
 import flash.display.MovieClip;
 import fl.controls.Button;
 import flash.events.Event;

 public class MyChild extends MovieClip 
 {
  public var btn:Button;
  public function MyChild() 
  {
    btn = new Button();
    addChild(btn);
    btn.x = btn.y = 50;
    btn.label = &quot;Child&quot;;
  }
 }
 
}
/*CHILD DOCUMENT CLASS END*/&lt;/pre&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&lt;/pre&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;/*PARENT DOCUMENT CLASS START*/
package  
{
 import flash.display.MovieClip;
 import flash.events.Event;
 import flash.display.Loader;
 import flash.net.URLRequest;
 import fl.controls.Button;
 import flash.events.MouseEvent;

 public class MyParent extends MovieClip 
 {
  var mychild:MyChild;
  public function MyParent() 
  {
   addEventListener(Event.ADDED_TO_STAGE,onAddedToStage);
  }
  public function onAddedToStage(e:Event)
  {
   var loader:Loader = new Loader();
   var url_request:URLRequest = new URLRequest(&quot;MyChild.swf&quot;);
   loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onChildSWFLoaded);
   loader.load(url_request);
  }
  public function onChildSWFLoaded(e:Event)
  {
   trace(&quot;onChildSWFLoaded&quot;);
   //add child before referencing. Else you&#39;d get Security Error
   stage.addChild(e.target.content);
   mychild = MyChild(e.target.content);
   mychild.btn.addEventListener(MouseEvent.CLICK,onBtnClicked);
  }
  public function onBtnClicked(e:MouseEvent)
  {
   mychild.btn.label = &quot;Hello&quot;;
  }
 }
 
}
&lt;div&gt;
/*PARENT DOCUMENT CLASS END*/&lt;/div&gt;
&lt;/pre&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
Source Files&lt;/h3&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;a href=&quot;http://code.google.com/p/adding-child-swf-to-parent-and-accessing-child-elements/downloads/list&quot;&gt;Download From Here&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://theactionscript.blogspot.com/feeds/4015354101713506231/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://theactionscript.blogspot.com/2012/08/how-to-refer-elements-in-child-swf.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4061964841984016538/posts/default/4015354101713506231'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4061964841984016538/posts/default/4015354101713506231'/><link rel='alternate' type='text/html' href='http://theactionscript.blogspot.com/2012/08/how-to-refer-elements-in-child-swf.html' title='How to access elements in child swf'/><author><name>CODEMYCODE</name><uri>http://www.blogger.com/profile/10874687956027617222</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>