Posts

Showing posts with the label ActionScript

How to get title from IFrame document

HTML code :   < div id = "main-content" > < iframe name = "cstage" src = "home.html" width = "100%" height = "100%" id = "main-content-iframe" frameborder = "0" > If you 're seeing this message, it means IFrames are not supported; Please enable IFrames or upgrade to a compatible browser that supports IFrames.</iframe> </div> jQuery code:   alert($(' #main-content-iframe').contents().find("title").text());     Note: Make sure home.html come from the same domain as your main page.

String Search & Replace (AS2 & AS3)

function strReplace($str:String, $search:String, $replace:String):String { return $str.split($search).join($replace); } var str:String = new String(); str = "we are Khmer!" trace(strReplace(str,"we","We")); The "split" function splits the string at the word ($search) you're searching for. And the "join" inserts the new word ($replace) between the elements, concatenates them, and returns the resulting string

Loading XML data using ActionScript 3.0

Image
Using XML is one of the best ways for structuring external content in a logical format that is easy to understand, process, and update. This tutorial will teach you the basics on how to load and process XML in Flash using ActionScript 3.0. You are assumed to have basic knowledge of ActionScript in order to follow this tutorial. Here is sample code loading XML in ActionScript 3 Here is sample XML code Download here

Retrieve Flash Variables in Actionscript 3

Image
In Actionscript 3 variables that are passed in through query string have been moved to the parameters property of LoaderInfo instance. Here’s a real simple way to retrieve flash variable in Actionscript 3 1. To access the query string fileName in Actionscript 3 , all you have to do in your actionscript 3 source code is 2. Here Html Code access Flash variables Download here