<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://dbbd.sg/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=220.255.7.165</id>
		<title>Wikicliki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://dbbd.sg/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=220.255.7.165"/>
		<link rel="alternate" type="text/html" href="http://dbbd.sg/wiki/index.php?title=Special:Contributions/220.255.7.165"/>
		<updated>2026-06-13T23:09:46Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.27.4</generator>

	<entry>
		<id>http://dbbd.sg/wiki/index.php?title=Actionscript_2_Sandbox&amp;diff=4007</id>
		<title>Actionscript 2 Sandbox</title>
		<link rel="alternate" type="text/html" href="http://dbbd.sg/wiki/index.php?title=Actionscript_2_Sandbox&amp;diff=4007"/>
				<updated>2009-05-04T14:16:04Z</updated>
		
		<summary type="html">&lt;p&gt;220.255.7.165: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;the readable stuff is at the [[Actionscript]] page, the sandbox is the-messing-around-with-snippets-section.&lt;br /&gt;
&lt;br /&gt;
* http://blog.soulwire.co.uk/flash/actionscript-3/webcam-motion-detection-tracking/&lt;br /&gt;
&lt;br /&gt;
* http://senocular.com/&lt;br /&gt;
* http://www.gotoandlearn.com/&lt;br /&gt;
* http://www.kirupa.com/developer/flash/index.htm&lt;br /&gt;
* http://www.actionscript.org/resource...ies/Tutorials/&lt;br /&gt;
&lt;br /&gt;
and one math website:&lt;br /&gt;
http://library.thinkquest.org/20991/home.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== level0 vs root ==&lt;br /&gt;
&lt;br /&gt;
http://forum.oxylusflash.com/sliding-list/324-scroll-when-loaded-into-parent-swf.html&lt;br /&gt;
&lt;br /&gt;
http://kb2.adobe.com/cps/146/tn_14686.html&lt;br /&gt;
&lt;br /&gt;
When a SWF file is loaded into the Flash player, it&amp;#039;s main timeline is loaded into level 0. In this movie and this movie only will _root and _level0 reference the same timeline. Additional SWF files can be loaded into additional levels using loadMovie or loadMovieNum. References of _root in those files then reference the level in which that SWF referencing _root was loaded. For example, if a SWF is loaded into level 2, a reference to _root in that SWF will reference the same timeline that _level2 references, but will not reference the same timeline as _level0. A reference to _root will only equal _level0 in the SWF that was first loaded into the player (level 0).&lt;br /&gt;
&lt;br /&gt;
If you are using loadMovie to load SWF files into movie clips instead of levels, _root in those movie clips will still reference the main timeline of the level, not the main timeline of the SWF that was loaded into the player. If you want _root to reference the main timeline of that SWF, you will want to use _lockroot.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== onRelease vs onMouseDown ==&lt;br /&gt;
&lt;br /&gt;
onMouseDown doesn&amp;#039;t matter what the mc is. the whole file is a fucking button. use onRelease for MCs............&lt;br /&gt;
&lt;br /&gt;
== ALIGNMENT IS QUITE IMPORTANT ==&lt;br /&gt;
&lt;br /&gt;
SO USE THE DAMN ALIGN PANEL MORE&lt;br /&gt;
think about registration points and dont just move them all.....&lt;br /&gt;
&lt;br /&gt;
== audio button ==&lt;br /&gt;
&lt;br /&gt;
because all my sounds were on the stage as events the global volume is the only way to do it&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// changes colour of audio button and controls global volume....&lt;br /&gt;
&lt;br /&gt;
var globalVolume:Sound = new Sound();&lt;br /&gt;
var audioState = 1;&lt;br /&gt;
&lt;br /&gt;
Color.prototype.clearRGB = function(){&lt;br /&gt;
     audiospecial.setTransform({ra:100, rb:0,ga:100,gb:0,ba:100,bb:0,aa:100,ab:0});&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
audiospecial.onRollOver = function() {&lt;br /&gt;
	var newColor = new Color(eval(audiospecial));&lt;br /&gt;
	newColor.setRGB(0xFFFFFF);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
audiospecial.onRollOut = function() {&lt;br /&gt;
	var newColor = new Color(eval(audiospecial));&lt;br /&gt;
	newColor.setRGB(0xFE6AFF);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
audiospecial.onMouseDown = function() {&lt;br /&gt;
if (audioState == 1){&lt;br /&gt;
audiospecial.gotoAndPlay(&amp;quot;soundoff&amp;quot;);&lt;br /&gt;
globalVolume.setVolume(0);&lt;br /&gt;
audioState = 0;&lt;br /&gt;
} else if (audioState == 0) {&lt;br /&gt;
audiospecial.gotoAndPlay(1);&lt;br /&gt;
globalVolume.setVolume(100);&lt;br /&gt;
audioState = 1;&lt;br /&gt;
}&lt;br /&gt;
else{&lt;br /&gt;
	null&lt;br /&gt;
}&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==failproof mouseover ==&lt;br /&gt;
on the main timeline &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;stop();&lt;br /&gt;
mc1.onRollOver = function() {&lt;br /&gt;
	mc1.gotoAndPlay(&amp;quot;open&amp;quot;);&lt;br /&gt;
};&lt;br /&gt;
mc1.onRollOut = function() {&lt;br /&gt;
	mc1.gotoAndPlay(&amp;quot;close&amp;quot;);&lt;br /&gt;
};&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
on mc1 - &lt;br /&gt;
* put a stop on frame 1&lt;br /&gt;
* frame 2 name it as open&lt;br /&gt;
*frame 10 (or whatever) name it as close&lt;br /&gt;
&lt;br /&gt;
== swapdepths ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mc.swapDepths(&amp;quot;1000&amp;quot;);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or each time you can up the depth using variable&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;on (press, release, dragOver, dragOut) {&lt;br /&gt;
_root.x +=5;&lt;br /&gt;
mc.swapDepths(_root.x);&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== loadmovie ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;loadMovie(&amp;quot;somecontent.jpg/gif/swf/png&amp;quot;, &amp;quot;_root.container&amp;quot;);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== ACTIONSCRIPT 2.0 ==&lt;br /&gt;
&lt;br /&gt;
BOOLEAN&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    var rollOverFish:Boolean = false&lt;br /&gt;
&lt;br /&gt;
    fish.onRollOver = function() {&lt;br /&gt;
       if (rollOverFish == false) {&lt;br /&gt;
          //Some Action&lt;br /&gt;
          rollOverFish = true;&lt;br /&gt;
       } else {&lt;br /&gt;
          null;&lt;br /&gt;
       }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OTHERS&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;quot;filename.as&amp;quot;          // includes the .as file at runtime (must be in same folder as .fla)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        /*  CONDITIONALS  */&lt;br /&gt;
&lt;br /&gt;
var message = &amp;quot;yellow&amp;quot;;                         // the equal sign assigns values to variables&lt;br /&gt;
trace (&amp;quot;big &amp;quot; + message + &amp;quot; truck&amp;quot;);            // prints &amp;quot;big yellow truck&amp;quot;&lt;br /&gt;
if (message == &amp;quot;yellow&amp;quot;) {                      // the double equal sign checks to see if variables are equal&lt;br /&gt;
trace (&amp;quot;yes, i did say big yellow truck.&amp;quot;);     // prints &amp;quot;yes, i did say big yellow truck&amp;quot;&lt;br /&gt;
trace (typeof message);                         // prints &amp;quot;string&amp;quot;&lt;br /&gt;
var x = a;                                      // prints &amp;quot;number&amp;quot;&lt;br /&gt;
trace (typeof a)&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
var x = 1;&lt;br /&gt;
while (x &amp;lt;= 5) {                // as long as x is less than 5...&lt;br /&gt;
trace (x);                      // return 1 in output&lt;br /&gt;
x = x + 1;                      // return 2 3 4 5 in output&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        /* BUTTONS IN A QUIZ */&lt;br /&gt;
&lt;br /&gt;
button1.onRelease = function () {         // on pressing button 1&lt;br /&gt;
this._parent.q1answer = 1;                // assigning 1 to q1 answer&lt;br /&gt;
this._parent.gotoAndStop(&amp;quot;q2&amp;quot;)            // after which we go to frame labelled as q2&lt;br /&gt;
}&lt;br /&gt;
if (q1answer == 3) {                      //  if answer was right&lt;br /&gt;
  totalCorrect = totalCorrect++;          //  increase number of total correct qns by one&lt;br /&gt;
}                                         //    you could even do something like&lt;br /&gt;
                                          //    if ( 3 &amp;lt; 300 ) { do something }&lt;br /&gt;
                                          //    if ( &amp;quot;a&amp;quot; &amp;lt; &amp;quot;z&amp;quot; ) { do something }&lt;br /&gt;
                                          //&lt;br /&gt;
     &lt;br /&gt;
&lt;br /&gt;
        /* FUNCTIONS IN DIFFERENT LAYERS/SCENES */&lt;br /&gt;
&lt;br /&gt;
function T1over() {                             // this code is placed on main stage&lt;br /&gt;
        _root.one_mc.gotoAndStop(2);            // but refers to a one_mc on the stage&lt;br /&gt;
        getURL(&amp;#039;javascript:modifyT1();&amp;#039;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
_root.one_mc.onRollOver = T1over;               // this would be same&lt;br /&gt;
&lt;br /&gt;
on (rollOver) {                                 // this placed on one_mc&lt;br /&gt;
        gotoAndStop(2);                         // is the same as above&lt;br /&gt;
        getURL(&amp;#039;javascript:modifyT1();&amp;#039;);       // OPTIONALLY use frame labels instead of frame no.&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
        /*  ROTATION  */&lt;br /&gt;
        &lt;br /&gt;
on (rollOver) {&lt;br /&gt;
        this._rotation = + 45;          // Values from 0 to 180 represent clockwise rotation;&lt;br /&gt;
}                                       // values from 0 to -180 represent counterclockwise rotation&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        /* LOADING IMAGES IN */&lt;br /&gt;
        &lt;br /&gt;
this.createEmptyMovieClip(&amp;quot;image_mc&amp;quot;, 1);       // to create a dynamically created mc&lt;br /&gt;
image_mc.loadMovie(&amp;quot;giraffe.jpg&amp;quot;);              // mc loads an image&lt;br /&gt;
&lt;br /&gt;
image_mc.removeMovieClip();                     // to remove the dynamically created mc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        /* CREATING TEXT FIELDS */&lt;br /&gt;
        &lt;br /&gt;
var score = 99;&lt;br /&gt;
this.createTextField(&amp;quot;score_txt&amp;quot;, 1, 150, 200, 200, 20);&lt;br /&gt;
score_txt.text = &amp;quot;  &amp;quot;+score+&amp;quot; points&amp;quot;;  // prints 99 points in score_txt field&lt;br /&gt;
score_txt.textColor = 0xFF0000;                        // text color is red&lt;br /&gt;
&lt;br /&gt;
                                // myMovieClip.createTextField (instanceName,depth,x,y,width,height)&lt;br /&gt;
                                //        instanceName  A string that identifies the instance name of the new text field.&lt;br /&gt;
                                //        x An integer that specifies the x coordinate of the new text field.&lt;br /&gt;
                                //        y An integer that specifies the y coordinate of the new text field.&lt;br /&gt;
                                &lt;br /&gt;
myFormat.underline  = true;&lt;br /&gt;
myFormat.Color = 0xFF0000;                  // alternatively, score_txt.textColor also works&lt;br /&gt;
myFormat.bold = true;&lt;br /&gt;
myFormat.size = 16;&lt;br /&gt;
myFormat.font = &amp;quot;Georgia&amp;quot;;                  // if you choose to set a font, make sure you include dummy field offstage&lt;br /&gt;
                                            // which uses your font, has font embedding turned on (character)&lt;br /&gt;
                                            // and if you use bold/italic/regular variation you must include each type&lt;br /&gt;
                                            &lt;br /&gt;
score_txt.setTextFormat(myFormat);          // applies format to all of score_txt&lt;br /&gt;
score_txt.setTextFormat(12, 27, myFormat);  // applies format to only the 12-27th character in score_txt. HARDCORE....&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
this.createTextField(&amp;quot;more_txt&amp;quot;, 1, 180, 250, 200, 20);&lt;br /&gt;
more_txt.html = true;                                           // creating a dynamic (highlightable) txtfield&lt;br /&gt;
more_txt.htmlText = &amp;quot;look its a&lt;br /&gt;
&amp;lt;font color=&amp;#039;#00ccff&amp;#039;&amp;gt;&amp;lt;u&amp;gt;                                       // you will have to format it all in html&lt;br /&gt;
&amp;lt;a href=&amp;#039;http://www.sg&amp;#039;&amp;gt;link&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/u&amp;gt;&amp;lt;/font&amp;gt;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
        /* LEARNING HOW TO DRAW */&lt;br /&gt;
&lt;br /&gt;
_root.lineStyle(1, 0x000000, 50);                        // line-thickness, colour, opacity&lt;br /&gt;
_root.moveTo(50, 100);                                                // cross hatch drawing&lt;br /&gt;
_root.lineTo(200, 100);                                                // first number is the horizontal value&lt;br /&gt;
_root.moveTo(50, 150);                                                // second number is the vertical value&lt;br /&gt;
_root.lineTo(200, 150);&lt;br /&gt;
_root.moveTo(150, 50);&lt;br /&gt;
_root.lineTo(150, 200);&lt;br /&gt;
_root.moveTo(100, 50);&lt;br /&gt;
_root.lineTo(100, 200);&lt;br /&gt;
&lt;br /&gt;
_root.lineStyle(5, 0x000000, 20);                        // drawing a square&lt;br /&gt;
_root.moveTo(50, 50);&lt;br /&gt;
_root.lineTo(200, 50);&lt;br /&gt;
_root.lineTo(200, 200);&lt;br /&gt;
_root.lineTo(50, 200);&lt;br /&gt;
_root.lineTo(50, 50);&lt;br /&gt;
&lt;br /&gt;
_root.lineStyle(10, 0x000000, 100);           // drawing a deformed circley thing with a fill.&lt;br /&gt;
                                              // note: to have no border, omit linestyle&lt;br /&gt;
_root.moveTo(125, 50);                        // move starting point from 0,0 to elsewhere&lt;br /&gt;
_root.beginFill(0x888888, 50);                // add a fill of 50% opacity. can&lt;br /&gt;
_root.curveTo(200,50, 200,125);               // _root.curveTo(controlX, controlY, anchorX, anchorY);&lt;br /&gt;
_root.curveTo(200,200, 125,200);&lt;br /&gt;
_root.curveTo(50,200, 50,125);&lt;br /&gt;
_root.curveTo(50,50, 125,50);&lt;br /&gt;
_root.endFill&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        /* drawing program */&lt;br /&gt;
&lt;br /&gt;
_root.createEmptyMovieClip(&amp;quot;line&amp;quot;,1);&lt;br /&gt;
&lt;br /&gt;
_root.onMouseDown = function() {&lt;br /&gt;
line.moveTo(_xmouse,_ymouse);&lt;br /&gt;
line.lineStyle(1,0x000000,100);&lt;br /&gt;
&lt;br /&gt;
this.onMouseMove = function() {&lt;br /&gt;
line.lineTo(_xmouse,_ymouse);&lt;br /&gt;
updateAfterEvent();&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        /* Loading external swfs */&lt;br /&gt;
&lt;br /&gt;
stop();                                         // place this on the frame where you want to stop &lt;br /&gt;
container_mc.loadMovie(&amp;#039;filename.swf&amp;#039;);         // create blank container_mc at 0,0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          /* DRAWING A GRID WITH AS  */&lt;br /&gt;
&lt;br /&gt;
stop();&lt;br /&gt;
var cols:Number = 50;&lt;br /&gt;
var rows:Number = 50;&lt;br /&gt;
var w:Number = stage.stageWidth/cols;&lt;br /&gt;
var h:Number = stage.stageHeight/rows;&lt;br /&gt;
var points:Array = Points.createPoints(rows, cols, w, h);&lt;br /&gt;
&lt;br /&gt;
//drawing rows&lt;br /&gt;
for (var i:Number=0; i&amp;lt;rows+1; i++) {&lt;br /&gt;
	graphics.lineStyle(1, 0xEEEEEE);&lt;br /&gt;
	graphics.moveTo(0, points[i*(cols-1)].y-1);&lt;br /&gt;
	graphics.lineTo(points[cols-1].x+w, points[i*(cols-1)].y-1);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// drawing cols&lt;br /&gt;
for (var j:Number=0; j&amp;lt;cols; j++) {&lt;br /&gt;
	graphics.lineStyle(1, 0xEEEEEE);&lt;br /&gt;
	graphics.moveTo(points[j].x-1, 0);&lt;br /&gt;
	graphics.lineTo(points[j].x-1, points[points.length-1].y+h);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== ACTIONSCRIPT 3.0 ==&lt;br /&gt;
&lt;br /&gt;
actionscript object-oriented programming (OOP)&lt;br /&gt;
&lt;br /&gt;
*Structure: main class (starts the program) &amp;gt; classes (blueprint which describes characteristic and behaviour of the object) &amp;gt; objects (interoperating instances of classes in the program)&lt;br /&gt;
&lt;br /&gt;
*store your flas and swfs in one directory (eg: /hulkdash/ ) &lt;br /&gt;
*store the actionscript source files in /hulkdash/src/&lt;br /&gt;
*main class code should be in the file hulkdash.as (filename matches class name)&lt;br /&gt;
*use packages&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
actionscript, that infuriatingly intractable marshmellow fluff...&lt;br /&gt;
so far i have only understood the most basic of concepts, but now i will try to learn it well.&lt;br /&gt;
&lt;br /&gt;
*[[Actionscript Sandbox]]&lt;br /&gt;
*[http://moock.org/lectures/groundUpAS3/ Moock&amp;#039;s Actionscript 3.0 from the Ground Up]&lt;br /&gt;
&lt;br /&gt;
*http://www.kirupa.com/developer/actionscript/spring.htm&lt;br /&gt;
*http://www.bit-101.com/tutorials/elasticity.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== alpha ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// set movie clip&amp;#039;s alpha (transparency) to 50% immediately&lt;br /&gt;
myMC._alpha = 50%&lt;br /&gt;
&lt;br /&gt;
// set up alphacounter, if alphacounter is undefined then it sets it to 99. otherwise alphacounter is to decrease to 0 and delete itself.&lt;br /&gt;
myMC.onEnterFrame = function (){&lt;br /&gt;
this.alphaCount = (this.alphaCount == undefined) ? 99 : --this.alphaCount;&lt;br /&gt;
this._alpha = this.alphaCount;&lt;br /&gt;
	if (this._alpha &amp;lt;= 0) {&lt;br /&gt;
	delete this.onEnterFrame;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// change it to ++ to make it go up&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Codehinting ==&lt;br /&gt;
&lt;br /&gt;
to keep with good practice you should keep to these common suffixes so that any programmer can read your code easily without finding it utterly incomprehensible.&lt;br /&gt;
&lt;br /&gt;
variables:&lt;br /&gt;
*must start with letters, underscore or dollarsign.&lt;br /&gt;
*no hyphens or other punctuation besides the underscore.&lt;br /&gt;
*cannot start with a number.&lt;br /&gt;
*are case-insensitive, but keep it constant or you might get confused&lt;br /&gt;
&lt;br /&gt;
*xxx_str   // means the variable contains a string&lt;br /&gt;
*xxx_arr // means the variable contains an array&lt;br /&gt;
&lt;br /&gt;
*[http://livedocs.adobe.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&amp;amp;file=00001151.html More about using suffixes to trigger code hints]&lt;br /&gt;
&lt;br /&gt;
== Conditionals ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;var message = &amp;quot;yellow&amp;quot;;&lt;br /&gt;
trace (&amp;quot;big &amp;quot; + message + &amp;quot; truck&amp;quot;);                // prints &amp;quot;big yellow truck&amp;quot;&lt;br /&gt;
if (message == &amp;quot;yellow&amp;quot;) {&lt;br /&gt;
trace (&amp;quot;yes, i did say big yellow truck.&amp;quot;);        // prints &amp;quot;yes, i did say big yellow truck&amp;quot;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;= assigning value&lt;br /&gt;
== comparing values&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== loops ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td valign=top&amp;gt;this sequence... &amp;lt;pre&amp;gt;trace (101);&lt;br /&gt;
trace (102);&lt;br /&gt;
trace (103);&lt;br /&gt;
trace (104);&lt;br /&gt;
trace (105);&amp;lt;/pre&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td valign=top&amp;gt;is equal to:&lt;br /&gt;
&amp;lt;pre&amp;gt;var x = 101;&lt;br /&gt;
trace (x);&lt;br /&gt;
x = x + 1;&lt;br /&gt;
trace (x);&lt;br /&gt;
x = x + 1;&lt;br /&gt;
trace (x);&lt;br /&gt;
x = x + 1;&lt;br /&gt;
trace (x);&lt;br /&gt;
x = x + 1;&lt;br /&gt;
trace (x);&amp;lt;/pre&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td valign=top&amp;gt;is also equal to:&lt;br /&gt;
&amp;lt;pre&amp;gt;var x = 101;&lt;br /&gt;
while (x &amp;lt;= 105) {     // as long as x is less than 105...&lt;br /&gt;
trace (x);&lt;br /&gt;
x = x + 1;           // ...continue to trace x but add one each time&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td valign=top&amp;gt;they all print:&lt;br /&gt;
&amp;lt;pre&amp;gt;101&lt;br /&gt;
102&lt;br /&gt;
103&lt;br /&gt;
104&lt;br /&gt;
105&amp;lt;/pre&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== functions ==&lt;br /&gt;
&lt;br /&gt;
sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;function area(height, width){&lt;br /&gt;
return height * width;&lt;br /&gt;
}&lt;br /&gt;
area1 = area(10,15);&lt;br /&gt;
area2 = area(10,20);&lt;br /&gt;
area3 = area(10,20);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== event based execution ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;someObject.onSomeEvent = someFunction;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
for example:&lt;br /&gt;
&amp;lt;pre&amp;gt;skaGirl.onRelease = dirtyskanking;            // the object named skaGirl will dirtyskank when mouse is released&lt;br /&gt;
&lt;br /&gt;
function dirtyskanking () {&lt;br /&gt;
this._parent._rotation = 360;                     // defines the rotation of the dirtyskanking.&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== sample ==&lt;br /&gt;
&lt;br /&gt;
=== quiz ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button1.onRelease = function () {         // on pressing button 1&lt;br /&gt;
this._parent.q1answer = 1;                // assigning 1 to q1 answer&lt;br /&gt;
this._parent.gotoAndStop(&amp;quot;q2&amp;quot;)            // after which we go to frame labelled as q2&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
if (q1answer == 3) {                      //  if answer was right&lt;br /&gt;
  totalCorrect = totalCorrect++;          //  increase number of total correct qns by one&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== confused about root, this, and parent? so am i! ==&lt;br /&gt;
&lt;br /&gt;
this piece of code would work ON a frame on the main stage, one_mc being an object onnit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;function T1over() {&lt;br /&gt;
	_root.one_mc.gotoAndStop(2);&lt;br /&gt;
	getURL(&amp;#039;javascript:modifyT1();&amp;#039;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
_root.one_mc.onRollOver = T1over;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== actionscript and javascript ==&lt;br /&gt;
&lt;br /&gt;
*[http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_15683 flash to/from javascript call]&lt;br /&gt;
*[http://board.flashkit.com/board/archive/index.php/t-578023.html halp i am so confused]&lt;br /&gt;
&lt;br /&gt;
== tips ==&lt;br /&gt;
&lt;br /&gt;
* use frame labels rather than frame numbers. you could call a starting frame &amp;quot;init&amp;quot;.&lt;br /&gt;
* dont use too many functions&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
*[http://livedocs.adobe.com/flashlite/2/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&amp;amp;file=00000642.html preloader]&lt;br /&gt;
*[http://www.sephiroth.it/python/sepy.php SEPY actionscript editor]&lt;br /&gt;
*[http://www.mtasc.org/ Motion-Twin ActionScript 2 Open Source free compiler.]&lt;br /&gt;
*[http://code.google.com/p/swfobject/ SWFobject]&lt;br /&gt;
*[http://hosted.zeh.com.br/mctween/index.html MC Tween - Best way to tween]&lt;br /&gt;
*[http://code.google.com/p/tweener/ Tweener - New way to tween]&lt;br /&gt;
&lt;br /&gt;
*[http://labs.adobe.com/wiki/index.php/ActionScript_3:resources:apis:libraries actionscript apis (youtube, odeo)]&lt;/div&gt;</summary>
		<author><name>220.255.7.165</name></author>	</entry>

	</feed>