Cool Tools and Tricks in Flash // for referring to a variable nested inside a movie clip: _root.parent.child.variable = "value"; // string example // for getting the position of a movie clip element on the screen: getProperty ( target, _x ); // The X position (in pixels) of the target clip. getProperty ( target, _y ); // The Y position (in pixels) of the target clip. getProperty ( target, _width ); // The width (in pixels) of the target clip. getProperty ( target, _height ); // The height (in pixels) of the target clip. getProperty ( target, _rotation ); // The rotation (in degrees) of the target clip. getProperty ( target, _target ); // The full path (from _root) to the target clip. getProperty ( target, _name ); // The instance name of the target clip. getProperty ( target, _xscale ); // target clip X scale / original clip X scale x 100 (in %). getProperty ( target, _yscale ); // target clip Y scale / original clip Y scale x 100 (in %). getProperty ( target, _alpha ); // The alpha fade level (in percent) of the target clip. getProperty ( target, _visible ); // The visibility of the target clip (Boolean). getProperty ( target, _droptarget ); // The instance name of the clip upon which a draggable clip is dropped. getProperty ( target, _currentframe); // The frame at which the playhead currently rests in the target clip. getProperty ( target, _totalframes ); // The total number of frames in the target clip. getProperty ( target, _framesloaded); // The number of frames currently loaded in the target clip. // Infix notation of same (I prefer this notation.) target._x ; // The X position (in pixels) of the target clip. target._y ; // Etc. as above. target._width ; target._height ; target._rotation ; target._target ; target._name ; target._xscale ; target._yscale ; target._alpha ; target._visible ; target._droptarget ; target._currentframe; target._totalframes ; target._framesloaded; // for setting the position of a movie clip element on the screen: // target may have quotes on occassion, value does not. setProperty( target, _x , value); // The X position (in pixels) of the target clip. setProperty( target, _y , value); // Etc. as above. setProperty( target, _width , value); setProperty( target, _height , value); setProperty( target, _rotation , value); setProperty( target, _target , value); setProperty( target, _name , value); setProperty( target, _xscale , value); setProperty( target, _yscale , value); setProperty( target, _alpha , value); setProperty( target, _visible , value); setProperty( target, _droptarget , value); setProperty( target, _currentframe, value); setProperty( target, _totalframes , value); setProperty( target, _framesloaded, value); // Infix notation of same (I prefer this notation.) // target may have quotes on occassion, value does not. target._x = value; // The X position (in pixels) of the target clip. target._y = value; // Etc. as above. target._width = value; target._height = value; target._rotation = value; target._target = value; target._name = value; target._xscale = value; target._yscale = value; target._alpha = value; target._visible = value; target._droptarget = value; target._currentframe = value; target._totalframes = value; target._framesloaded = value; // clip example on (release) { setProperty ("_level0.myCuteClip", _x, value); // value could be from a textField var. } // clip example (I prefer) on (release) { _level0.myCuteClip._x, xpos); } // A neat trick for opening up a URL is here: // http://www.actionscript.org/tutorials/beginner/PopUp_window_within_flash/index.shtm // Could be useful! // Building your own drop down menus: // http://www.actionscript.org/tutorials/beginner/Drop_down_menu/index.shtml // Objects like buttons can be grouped using the group operator CTRL-G // A button for bookmarking a specific site: on (release) { getURL("javascript:window.external.AddFavorite('http://www.wdv.com','WDV Web Site');"); } // Clips can be dragged and dropped on other clips, which is a fantastic tool // See http://www.actionscript.org/tutorials/beginner/drag-n-drop/index.shtml // You can use Flash to run executables on your machine using the FSCommand. // This could be the basis for configuring a multi-screen environment from // a single control console. // See: http://www.actionscript.org/tutorials/beginner/Launch_Applications_using_Flash/index.shtml // Typewriter effect (Newspaper, or the Matrix kind of feel) // See: http://www.actionscript.org/tutorials/beginner/DOS_Cursor_Text_Effect/index.shtml // Super Neat Include // You can use #include "foo.as" to include a file that is shared among many applications. // I can use it to factor out the user changeable parts of the timer. // The .as suffix is optional. // No semicolon: #include "timerUserConfig.as" // Actions // Configure the player from an ActionScript // fscommand ("fullscreen", "true"); fscommand ("allowscale", "true"); fscommand ("showmenu", "true"); fscommand ("trapallkeys", "true"); fscommand ("exec"); fscommand ("quit"); // // Remember that trace is always available and extremely useful for debugging. trace("my value: " + myValue); // with statement // the with statement addresses an object, // the object is subject to the statements within the curly brackets ({}) // after the with object is identified. // Multiple statements can accompany the with action on (release) { with (_root.show) { _rotation=56; _alpha=76; } } // if you want the buttons or user interaction targets to move // consider this interesting example. // It opens up the possibility of the enigmatic porthole // or round combination interface. // See: http://www.actionscript.org/tutorials/beginner/Navigation_Circle/index.shtml // Stopped at Tutorial 21 of 50