additional action script 3.0
DESCRIPTION
TRANSCRIPT
![Page 1: Additional action script 3.0](https://reader036.vdocuments.us/reader036/viewer/2022062614/54624c88b1af9fba388b4d9a/html5/thumbnails/1.jpg)
Additional Action Script 3.0Understanding the
loaderClass
![Page 2: Additional action script 3.0](https://reader036.vdocuments.us/reader036/viewer/2022062614/54624c88b1af9fba388b4d9a/html5/thumbnails/2.jpg)
Additional interaction wish list for our project
Load an external swf file
Load and external text file
Making the text file scrollable via buttons
![Page 3: Additional action script 3.0](https://reader036.vdocuments.us/reader036/viewer/2022062614/54624c88b1af9fba388b4d9a/html5/thumbnails/3.jpg)
var myLoader:Loader = new Loader( );
CLASSa blueprint or cookie cutter
Creates a new variable named myLoader with a data type of
Loadernew instance of the Loader Class
![Page 4: Additional action script 3.0](https://reader036.vdocuments.us/reader036/viewer/2022062614/54624c88b1af9fba388b4d9a/html5/thumbnails/4.jpg)
var myLoader:Loader = new Loader();
myLoader.load
FUNCTIONa task, such as loading an external
swf file
![Page 5: Additional action script 3.0](https://reader036.vdocuments.us/reader036/viewer/2022062614/54624c88b1af9fba388b4d9a/html5/thumbnails/5.jpg)
URLRequesta request to load an external swf file
var myLoader:Loader = new Loader();
myLoader.load(new URLRequest("the name of your swf file goes here.swf"));
![Page 6: Additional action script 3.0](https://reader036.vdocuments.us/reader036/viewer/2022062614/54624c88b1af9fba388b4d9a/html5/thumbnails/6.jpg)
var myLoader:Loader = new Loader();
myLoader.load(new URLRequest("the name of your swf file goes here.swf"));
addChild(myLoader);
addChildadds the swf to the family
![Page 7: Additional action script 3.0](https://reader036.vdocuments.us/reader036/viewer/2022062614/54624c88b1af9fba388b4d9a/html5/thumbnails/7.jpg)
unloadremove the swf from the timeline
![Page 8: Additional action script 3.0](https://reader036.vdocuments.us/reader036/viewer/2022062614/54624c88b1af9fba388b4d9a/html5/thumbnails/8.jpg)
var content_req:URLRequest = new URLRequest(“name of your text file goes here.txt” );
CLASSa blueprint or cookie cutter
Creates a new variable named content_req with a data type of
URLRequestnew instance of the URLRequest Class which specifies the name of the text file
![Page 9: Additional action script 3.0](https://reader036.vdocuments.us/reader036/viewer/2022062614/54624c88b1af9fba388b4d9a/html5/thumbnails/9.jpg)
var content_req:URLRequest = new URLRequest(“name of your text file goes here.txt” );
var content_ldr:URLLoader = new URLLoader(“content_req” );
CLASSa blueprint or cookie cutter
![Page 10: Additional action script 3.0](https://reader036.vdocuments.us/reader036/viewer/2022062614/54624c88b1af9fba388b4d9a/html5/thumbnails/10.jpg)
Event listener
var content_req:URLRequest = new URLRequest(“name of your text file goes here.txt” );
var content_ldr:URLLoader = new URLLoader(“content_req” );
content_ldr.addEventListener(Event.COMPLETE, onComplete);
![Page 11: Additional action script 3.0](https://reader036.vdocuments.us/reader036/viewer/2022062614/54624c88b1af9fba388b4d9a/html5/thumbnails/11.jpg)
var content_req:URLRequest = new URLRequest(“name of your text file goes here.txt” );
var content_ldr:URLLoader = new URLLoader(“content_req” );
content_ldr.addEventListener(Event.COMPLETE, onComplete);
function onComplete(event:Event):void{ instance name of text box.text = event.target.data;}
FUNCTIONa task, such as loading external text
file
![Page 12: Additional action script 3.0](https://reader036.vdocuments.us/reader036/viewer/2022062614/54624c88b1af9fba388b4d9a/html5/thumbnails/12.jpg)
function scrollUp(event:MouseEvent):void{instance name of text box.scrollV -= 2;}
FUNCTIONa task, such as a scrolling dynamic text
file
![Page 13: Additional action script 3.0](https://reader036.vdocuments.us/reader036/viewer/2022062614/54624c88b1af9fba388b4d9a/html5/thumbnails/13.jpg)
function scrollDown(event:MouseEvent):void{instance name of text box.scrollV += 2;}
FUNCTIONa task, such as a scrollable dynamic text file
function scrollUp(event:MouseEvent):void{instance name of text box.scrollV -= 2;}
![Page 14: Additional action script 3.0](https://reader036.vdocuments.us/reader036/viewer/2022062614/54624c88b1af9fba388b4d9a/html5/thumbnails/14.jpg)
Event listener
instance name of scroll up button.addEventListener(MouseEvent.CLICK, function name for up);instance name of scroll down button.addEventListener(MouseEvent.CLICK, function name for down);
function scrollDown(event:MouseEvent):void{instance name of text box.scrollV += 2;}
function scrollUp(event:MouseEvent):void{instance name of text box.scrollV -= 2;}
![Page 15: Additional action script 3.0](https://reader036.vdocuments.us/reader036/viewer/2022062614/54624c88b1af9fba388b4d9a/html5/thumbnails/15.jpg)
HTMLinstructions for the browser on displaying your
content
TAGS
<b> content is here </b> bold
<font color> content is here </font color>
<font face> content is here </font face>
<i> content goes here </i>