|
Creating Your own Parameter Commands |
|
New in V1.1 is the ability to not only call functions from the editor but also, attach library
items, and load external files from the editor. This may sound difficult but it is actually very simple and opens limitless possibilities and power from the Flashblocks editor.
Calling your own Functions from a Flashblocks Block
- Place a function on the first frame and root of your flash movie –
something like this:
testFunction (mc, v) {
trace ("mc:"+mc);
trace ("v:"+v);
}
- Now test the flash movie and enter Flashblocks edit mode
- Click Parameters from the Flashblocks menu and Enter testFunction(Works!)
in the parameter field.
- Click Save and restart the movie
- the flashblock location and the word Works! should appear in the Flash output window
Attaching Linked Library Items to a Flashblocks Block
- Create a movie clip (Ctrl-F8) call it cmsObjTest
- in the first frame create a function like this:
trace (this.param);
- Right click on this new Movie Clip in the library and select Linkage..
- Select "Export for Actionscript." cmsObjTest
should appear in the identifier field. Press the Ok Button
- Now test the flash movie and enter Flashblocks edit mode
- Click Parameters from the Flashblocks menu and Enter cmsObjTest(Works!)
in the parameter field.
- Click Save and restart the movie
- Works! should appear in the Flash output window
Loading a Swf, Jpg, or mp3 into a flashblocks Block
- We will create an Swf and pass a variable to it
- Create a new blank flash movie and place any thing on the stage
- In the first frame write the actionscript:
trace(_parent.param)
- Publish the Flash movie, in the same directory as your flashblocks flash
movie, with the name testFile.swf
- Now test the flashblocks flash movie and enter Flashblocks edit mode
- Click Parameters from the Flashblocks menu and Enter testFile.swf(Works!)
in the parameter field.
- Click Save and restart the movie
- Your testFile.swf movie should appear in the block and Works!
should appear in the Flash output window
- Of course we can load any Swf, Jpg, or mp3 into the Flashblocks block
NoteFlashblocks looks for a Parameter Commands in this order:
- function: Flashblocks looks for _root.pcfunction(var)
- attachMC: Flashblocks looks in the library for the command
- LoadMovie: Flashblocks attempts to load the external file.
|