55
1 FlasEff2 ActionScript 3.0 Usage Apply FlashEff2 patterns by script Important ! For applying FlashEff2 with code you must use the FlashEff2Code component found in the Components panel. Both, the FlashEff2 and FlashEff2Code components contain the same properties and methods and dispatch the same events. This is a modified version of the FlashEff2 component, which contains all the necessary assets embedded into it. This way you only need to use the FlashEff2Code component and the desired FlashEff2 pattern (they need to be in the Library), without the extra assets the regular FlashEff2 component needs: the presets and easing functions. The downside of the FlashEff2Code is the larger size compared to the FlashEff2 component (up to 6 kB larger). Creating FlashEff2 animations with actionscript is not so difficult and requires a few steps: 1. Create a FlashEff2Code instance To create FlashEff2Code instance simply instantiate the FlashEff2Code class. In order to do this, the FlashEff2Code component must be placed in the Library of your project. Also the FlashEff2Code component must be added to the display list otherwise it will not work. Finally it must be applied on the target display object (Sprite, MovieClip or dynamic TextField). var myEffect:FlashEff2Code = new FlashEff2Code(); myEffect.showAutoPlay = true; myEffect.hideDelay = 3; addChild(myEffect); ... set up the FlashEff2 pattern ... myEffect._targetInstanceName = "myClip"; 2. Apply the FlashEff2 pattern FlashEff2 patterns can be applied in two different ways: either by creating an instance of that pattern and assigning it to the FlashEff2Code instance or by setting the pattern class name. import com.jumpeye.flashEff2.symbol.alpha.FESAlpha; var myPattern:FESAlpha = new FESAlpha(); myPattern.tweenDuration = 0.5; myEffect.showTransition = myPattern; ... or ... myEffect.showTransitionName = "com.jumpeye.flashEff2.symbol.alpha.FESAlpha";

ActionScript3.0 Usage

Embed Size (px)

Citation preview

Page 1: ActionScript3.0 Usage

1

FlasEff2ActionScript3.0Usage

ApplyFlashEff2patternsbyscriptImportant!ForapplyingFlashEff2withcodeyoumustusetheFlashEff2CodecomponentfoundintheComponentspanel.Both,theFlashEff2andFlashEff2Codecomponentscontainthesamepropertiesandmethodsanddispatchthesameevents.ThisisamodifiedversionoftheFlashEff2component,whichcontainsallthenecessaryassetsembeddedintoit.ThiswayyouonlyneedtousetheFlashEff2CodecomponentandthedesiredFlashEff2pattern(theyneedtobeintheLibrary),withouttheextraassetstheregularFlashEff2componentneeds:thepresetsandeasingfunctions.ThedownsideoftheFlashEff2CodeisthelargersizecomparedtotheFlashEff2component(upto6kBlarger).CreatingFlashEff2animationswithactionscriptisnotsodifficultandrequiresafewsteps:1.CreateaFlashEff2CodeinstanceTocreateFlashEff2CodeinstancesimplyinstantiatetheFlashEff2Codeclass.Inordertodothis,theFlashEff2CodecomponentmustbeplacedintheLibraryofyourproject.AlsotheFlashEff2Codecomponentmustbeaddedtothedisplaylistotherwiseitwillnotwork.Finallyitmustbeappliedonthetargetdisplayobject(Sprite,MovieClipordynamicTextField).var myEffect:FlashEff2Code = new FlashEff2Code(); myEffect.showAutoPlay = true; myEffect.hideDelay = 3; addChild(myEffect);

...setuptheFlashEff2pattern...myEffect._targetInstanceName = "myClip";

2.ApplytheFlashEff2patternFlashEff2patternscanbeappliedintwodifferentways:eitherbycreatinganinstanceofthatpatternandassigningittotheFlashEff2Codeinstanceorbysettingthepatternclassname.import com.jumpeye.flashEff2.symbol.alpha.FESAlpha; var myPattern:FESAlpha = new FESAlpha(); myPattern.tweenDuration = 0.5; myEffect.showTransition = myPattern;

...or...myEffect.showTransitionName = "com.jumpeye.flashEff2.symbol.alpha.FESAlpha";

Page 2: ActionScript3.0 Usage

2

myEffect.showTransition.tweenDuration = 0.5;

3.ChecktoseewhenthetransitionendsThebeginningandendingofaneffectisannouncedbythecomponentthroughevents.YouneedtoaddlistenersfortheFLASHEFFEvents.TRANSITION_START(theeventforthebeginningoftheeffect)andFLASHEFFEvents.TRANSITION_END(theeventfortheendoftheeffect)events.import com.jumpeye.Events.FLASHEFFEvents; myEffect.addEventListener(FLASHEFFEvents.TRANSITION_START, effectStarting); myEffect.addEventListener(FLASHEFFEvents.TRANSITION_END, effectEnding); function effectStarting(evt:FLASHEFFEvents):void { trace("The effect has started"); } function effectEnding(evt:FLASHEFFEvents):void { trace("The effect has endded"); }

ExamplesCreatealoopingshow/hideeffectCreateanewActionScript3.0file,settheframerateto30fpsandplaceanimageonthestage.ConvertitintoaMovieClipandgiveittheinstancenameof"myImage".OpentheComponentsPanelanddragtheFlashEff2Codecomponent(FlashEff2folder)overtheLibrarypanel.DosowiththeFESBrightSquaresandFESEqualizerpatternstoo(FlashEff2Patternsfolder).WewillbecreatingashoweffectusingtheFESBrightSquarespatternandahideeffectusingtheFESEqualizerpattern.Next,inthetimelinepanel,createanewlayerandnameit"Actions".Thisiswhereyouwillbeplacingthecode.Selectthefirstframeinthe"Actions"layer,opentheActionspanel(F9)andpastethecodebelowinthepanel:// Import the necessary classes. import com.jumpeye.Events.FLASHEFFEvents; import com.jumpeye.flashEff2.symbol.brightSquares.FESBrightSquares; import com.jumpeye.flashEff2.symbol.equalizer.FESEqualizer; // Create the FlashEff2Code instance and add it to the stage. The FlashEff2Code // component must be in the display list in order for it to work. var effect:FlashEff2Code = new FlashEff2Code(); effect.addEventListener(FLASHEFFEvents.TRANSITION_END, replay); addChild(effect); // Create the show pattern instance (FESBrightSquares) and set it // so the effect looks as you like. var showEffect:FESBrightSquares = new FESBrightSquares();

Page 3: ActionScript3.0 Usage

3

showEffect.scaleXAmount = 1.5; showEffect.scaleYAmount = 1.5; showEffect.preset = 19; // random showEffect.tweenDuration = 2; // Create the hide pattern instance (FESEqualizer) and set it // so the effect looks as you like. var hideEffect:FESEqualizer = new FESEqualizer(); hideEffect.squareWidth = 15; hideEffect.squareHeight = 15; hideEffect.preset = 3; // T2B hideEffect.tweenDuration = 3; // Assign the show and hide transitions to the FlashEff2Code instance. effect.showTransition = showEffect; effect.hideTransition = hideEffect; // There will be a 3 seconds pause between the show and hide transitions. effect.hideDelay = 3; // Set the target object to the FlashEff2Code instance. Once you do this, // the show effect will start immediately (except the case when the // show effect has a delay too). effect._targetInstanceName = "myImage"; // When the "hide" transition ends, start the show effect again. function replay(evt:FLASHEFFEvents):void { if (effect.currentTransitionType == "hide") { effect.show(); } }

TestyourclipbypressingCtr+EnterforWindowsorCmd+EnteronMacOS.ApplyaFlashEff2filterCreateanewActionScript3.0file,settheframerateto30fpsandplaceanimageonthestage.ConvertitintoaMovieClipandgiveittheinstancenameof"myImage".OpentheComponentsPanelanddragtheFlashEff2Codecomponent(FlashEff2folder)overtheLibrarypanel.DosowiththeFEFReflectionpatterntoo(FlashEff2Patternsfolder).Wewillbeapplyingareflectiontothetargetimage,throughtheFlashEff2Codecomponent.Next,inthetimelinepanel,createanewlayerandnameit"Actions".Thisiswhereyouwillbeplacingthecode.Selectthefirstframeinthe"Actions"layer,opentheActionspanel(F9)andpastethecodebelowinthepanel:// Import the necessary classes. import com.jumpeye.Events.FLASHEFFEvents; import com.jumpeye.flashEff2.filter.reflection.FEFReflection; // Create the FlashEff2Code instance and add it to the stage. The FlashEff2Code // component must be in the display list in order for it to work. var effect:FlashEff2Code = new FlashEff2Code(); addChild(effect); // Create the reflection filter instance and set it up as you need.

Page 4: ActionScript3.0 Usage

4

var reflection:FEFReflection = new FEFReflection(); reflection.refresh = false; reflection.reflectionAlpha = 0.8; reflection.reflectionRatio = 160; // Add the filter to the FlashEff2Code instance. effect.addFilter(reflection); // Set the target object to the FlashEff2Code instance. Once you do this, // the filter will be applied immediately. effect._targetInstanceName = "myImage";

TestyourclipbypressingCtr+EnterforWindowsorCmd+EnteronMacOS.CreateaFlashEff2buttonCreateanewActionScript3.0file,settheframerateto30fpsanddrawagraphicalobjectthatwillbeusedasbutton.Selecttheobject,convertitintoaMovieClipandgiveittheinstancenameof"myButton".OpentheComponentsPanelanddragtheFlashEff2Codecomponent(FlashEff2folder)overtheLibrarypanel.DosowiththeFEBEffectpatterntoo(FlashEff2Patternsfolder).Allthebuttoneffectsareappliedusingasinglepattern.Now,applyingsettingsontheFEBEffectpatterninstanceisdonethroughXMLobjects.EachFlashEff2buttonhassixstates(up,over,down,selectedup,selectedoverandselecteddown)andyoucanapplydifferentsettingsforeachofthestates.Thishowever,isdonenotbyassigningvaluestothepatternparametersbutbyassigninganXMLobjecttoeachofthesixstates,thatactuallyarethebuttonparameters(upState,overState,downState,selectedUpState,selecetdOverStateandselectedDownState).YoucanseeallthepossiblebuttonsettingsinsidetheFlashEff2Panel>Buttontab.Itisnotrequiredtosetallthestatesofthebutton.FlashEff2willautomaticallyapplytheexistingstates(ifitispossible)orwillleavethetargetdisplayobjectintheoriginalformifabuttonstatecannotbeapplied.Forexample,ifthedownstateisnotset,thecomponentwillapplytheoverstate(ifthisoneexists)ortheupstate.Note:ThisiswhyitishardertocreatethebuttoneffectsbycodeandwerecommendusingtheFlashEff2Paneltoapplybuttoneffects.TheeasiestwaytogettheXMLobjectcorrespondingtothebuttonstatesistomakethebuttonsettingsfirstusingtheFlashEff2PanelandthenclickontheCopybutton.ThiswillcopytheXMLobjectcorrespondingtotheentireFlashEff2instanceintotheclipboardandfromthereyoucanpasteitintoanytexteditoryoulike.Then,simplycopythecontentsofthe<value>nodesinsidethe<upState>,<overState>,<downState>,<selectedUpState>,<selectedOverState>and<selectedDownState>nodesandpastethemintothecodeinyour.flafile.Next,inthetimelinepanel,createanewlayerandnameit"Actions".Thisiswhereyouwillbeplacingthecode.Selectthefirstframeinthe"Actions"layer,opentheActionspanel(F9)andpastethecodebelowinthepanel:

Page 5: ActionScript3.0 Usage

5

// Import the necessary classes. import com.jumpeye.Events.FLASHEFFEvents; import com.jumpeye.flashEff2.buttonEffect.FEBEffect; // Create the FlashEff2Code instance and add it to the stage. The FlashEff2Code // component must be in the display list in order for it to work. var effect:FlashEff2Code = new FlashEff2Code(); addChild(effect); var overStateXML:XML = <value> <tweenDuration> <type>Number</type> <value>0.3</value> <defaultValue>0.3</defaultValue> <enterValue>0.3</enterValue> </tweenDuration> <tweenType> <type>String</type> <value>Quadratic</value> <defaultValue>Quadratic</defaultValue> <enterValue>Quadratic</enterValue> </tweenType> <easeType> <type>String</type> <value>easeOut</value> <defaultValue>easeOut</defaultValue> <enterValue>easeOut</enterValue> </easeType> <glowFilter> <type>Object</type> <value> <color> <type>uint</type> <value>26367</value> <defaultValue>14492194</defaultValue> </color> <alpha> <type>Number</type> <value>1</value> <defaultValue>1</defaultValue> </alpha> <blurX> <type>Number</type> <value>10</value> <defaultValue>10</defaultValue> </blurX> <blurY> <type>Number</type> <value>10</value> <defaultValue>10</defaultValue> </blurY> <strength> <type>Number</type> <value>3</value> <defaultValue>2</defaultValue> </strength> <quality> <type>Number</type> <value>3</value>

Page 6: ActionScript3.0 Usage

6

<defaultValue>2</defaultValue> </quality> <inner> <type>Boolean</type> <value>false</value> <defaultValue>false</defaultValue> </inner> <knockout> <type>Boolean</type> <value>false</value> <defaultValue>false</defaultValue> </knockout> </value> </glowFilter> </value>; var downStateXML:XML = <value> <tweenDuration> <type>Number</type> <value>0.15</value> <defaultValue>0.15</defaultValue> <enterValue>0.3</enterValue> </tweenDuration> <tweenType> <type>String</type> <value>Strong</value> <defaultValue>Strong</defaultValue> <enterValue>Quadratic</enterValue> </tweenType> <easeType> <type>String</type> <value>easeOut</value> <defaultValue>easeOut</defaultValue> <enterValue>easeOut</enterValue> </easeType> <glowFilter> <type>Object</type> <value> <color> <type>uint</type> <value>0</value> </color> <alpha> <type>Number</type> <value>0.7</value> </alpha> <blurX> <type>Number</type> <value>8</value> </blurX> <blurY> <type>Number</type> <value>8</value> </blurY> <quality> <type>Number</type> <value>2</value> </quality> <inner> <type>Boolean</type> <value>true</value>

Page 7: ActionScript3.0 Usage

7

</inner> <knockout> <type>Boolean</type> <value>false</value> </knockout> <strength> <type>Number</type> <value>2</value> </strength> </value> </glowFilter> <blurFilter> <type>Object</type> <value> <blurX> <type>Number</type> <value>4</value> </blurX> <blurY> <type>Number</type> <value>4</value> </blurY> <quality> <type>Number</type> <value>1</value> </quality> </value> </blurFilter> </value>; // Create the button pattern instance. var btnEffect:FEBEffect = new FEBEffect(); // The up state of the button will have no effects so the upState // property will not be set. btnEffect.overState = overStateXML; btnEffect.downState = downStateXML; // Apply the button pattern to the FlashEff2Code instance. effect.buttonEffect = btnEffect; effect.useHandCursor = true; // Set the target object to the FlashEff2Code instance. Once you do this, // the button pattern will be immediately applied. effect._targetInstanceName = "myButton";

TestyourclipbypressingCtr+EnterforWindowsorCmd+EnteronMacOS.Createaloopingshow/hideeffectontextCreateanewActionScript3.0fileandsettheframerateto30fps.ThisexampleshowsyouhowtocreateandsetupatextfieldtobeusedwithFlashEff2.OpentheComponentsPanelanddragtheFlashEff2Codecomponent(FlashEff2folder)overtheLibrarypanel.DosowiththeFETMagneticWindandFETXYScalepatternstoo(FlashEff2Patternsfolder).WewillbecreatingashoweffectusingtheFETMagneticWindpatternandahideeffectusingtheFETXYScalepattern.

Page 8: ActionScript3.0 Usage

8

Thefontusedforthetextis"LucidaSans"sothisfontshouldbeplacedintotheLibraryPaneltobecompiledintothefinal.swfclip.ToembedafontintotheLibrary,pleasefollowourtutorialontheJumpeyeComponentssite:http://www.jumpeyecomponents.com/Flash‐Components/Transition‐Effects/TxEff‐Full‐License‐123/embed‐fonts.htm.Next,inthetimelinepanel,selectthecurrentlayerandnameit"Actions".Thisiswhereyouwillbeplacingthecode.Thisfilewillnotcontainobjectsonthestage,insteadtheywillbecreatedbycode.Selectthefirstframeinthe"Actions"layer,opentheActionspanel(F9)andpastethecodebelowinthepanel:// Import the necessary classes. import com.jumpeye.Events.FLASHEFFEvents; import com.jumpeye.flashEff2.text.magneticWind.FETMagneticWind; import com.jumpeye.flashEff2.text.xyscale.FETXYScale; // Create the text format for the font. var txtFormat:TextFormat = new TextFormat(); txtFormat.font = "Lucida Sans"; txtFormat.align = "center"; txtFormat.color = 0x0099FF; txtFormat.size = 40; // Create the text field, set it up and add it to the display list. var myText:TextField = new TextField(); myText.type = "dynamic"; myText.embedFonts = true; myText.antiAliasType = "advanced"; myText.multiline = true; myText.wordWrap = true; myText.autoSize = "center"; addChild(myText); // Add the text into the text field (text should be as HTML). myText.defaultTextFormat = txtFormat; myText.htmlText = "The quick brown fox jumps over the lazy dog"; // Center the text field on the stage. myText.width = 350; myText.x = (stage.stageWidth - myText.width) / 2; myText.y = (stage.stageHeight - myText.height) / 2; // Create the FlashEff2Code instance and add it to the stage. The FlashEff2Code // component must be in the display list in order for it to work. var effect:FlashEff2Code = new FlashEff2Code(); effect.addEventListener(FLASHEFFEvents.TRANSITION_END, replay); addChild(effect); // Create the show pattern instance (FESBrightSquares) and set it // so the effect looks as you like. var showEffect:FETMagneticWind = new FETMagneticWind(); showEffect.randomX = 200; showEffect.randomY = 50; showEffect.groupDuration = 1.5; showEffect.tweenDuration = 2; // Create the hide pattern instance (FESEqualizer) and set it // so the effect looks as you like. var hideEffect:FETXYScale = new FETXYScale(); hideEffect.positionX = -15;

Page 9: ActionScript3.0 Usage

9

hideEffect.positionY = -50; hideEffect.preset = 9; // char: random hideEffect.groupDuration = 1.5; hideEffect.tweenDuration = 2; // Assign the show and hide transitions to the FlashEff2Code instance. effect.showTransition = showEffect; effect.hideTransition = hideEffect; // There will be a 3 seconds pause between the show and hide transitions. effect.hideDelay = 3; // Set the target text field to the FlashEff2Code instance. Once you do this, // the show effect will start immediately (except the case when the // show effect has a delay too). effect.target = myText; // When the "hide" transition ends, start the show effect again. function replay(evt:FLASHEFFEvents):void { if (effect.currentTransitionType == "hide") { effect.show(); } }

TestyourclipbypressingCtr+EnterforWindowsorCmd+EnteronMacOS.

Properties

Property Type/FlashEff2panel

Description

_targetInstanceName StringYes

Theinstancenameofthetargetobjectonwhichtheeffectwillbeapplied.IfthetargetobjectandtheFlashEff2Codeinstancedonothavethesamedirectparent,thenthetargetpropertyshouldbeusedinsteadof_targetInstanceName,tosetthereferencetothetargetobjectusingitspathonthetimeline.Oncethispropertyisset,thecomponentimmediatelytriestoapplytheeffects,onlyiftheshowAutoPlayorhideAutoPlaypropertyissettotrue.ThispropertymustbesetafterboththetargetobjectandtheFlashEff2Codecomponentwereaddedtothedisplaylist.ExampleThenextexampleappliesashowtransitionbasedontheAlphapattern(FESAlpha),toaclip(symbol)calledmyClip.CreateamoviecliponthestageandgiveitaninstancenameofmyClip.Next,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFESAlphapatternintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:var myEffect:FlashEff2Code = new FlashEff2Code(); myEffect.showTransitionName = "com.jumpeye.flashEff2.symbol.alpha.FESAlpha"; this.addChild(myEffect); myEffect._targetInstanceName = "myClip"; trace(myEffect._targetInstanceName); // myClip

Page 10: ActionScript3.0 Usage

10

buttonEffect IFlashEffButtonEffectNo

AreferencetotheinstanceoftheFEBEffectpatterncurrentlyappliedtothetargetobject,throughthecurrentinstanceofFlashEff2.Thisreferenceiscreatedseparatelybyusingthepattern'sconstructor.SettingstothebuttonpatterncanonlybemadebyusingXML.ExampleThenextexamplewillcreateabuttonfromasimplemovieclip,usingFlashEff2Code.Createamoviecliponthestagethatwillbeusedasbuttonandgiveittheinstancenameof"myButton".Next,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFEBEffectpatternintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:import com.jumpeye.flashEff2.buttonEffect.FEBEffect; var overState:XML = <value> <tweenDuration> <type>Number</type> <value>1</value> <defaultValue>1</defaultValue> </tweenDuration> <tweenType> <type>String</type> <value>Strong</value> <defaultValue>Strong</defaultValue> </tweenType> <easeType> <type>String</type> <value>easeOut</value> <defaultValue>easeOut</defaultValue> </easeType> <blurFilter> <type>Object</type> <value/> </blurFilter> <glowFilter> <type>Object</type> <value> <color hasCheck="false"> <type>uint</type> <value>26367</value> <defaultValue>14492194</defaultValue> </color> <alpha hasCheck="false"> <type>Number</type> <value>1</value> <defaultValue>1</defaultValue> </alpha> <blurX hasCheck="false"> <type>Number</type> <value>12</value> <defaultValue>10</defaultValue> </blurX> <blurY hasCheck="false"> <type>Number</type> <value>12</value> <defaultValue>10</defaultValue> </blurY> <strength hasCheck="false"> <type>Number</type> <value>2</value> <defaultValue>2</defaultValue> </strength> <quality hasCheck="false"> <type>Number</type>

Page 11: ActionScript3.0 Usage

11

<value>2</value> <defaultValue>2</defaultValue> </quality> <inner hasCheck="false"> <type>Boolean</type> <value>false</value> <defaultValue>false</defaultValue> </inner> <knockout hasCheck="false"> <type>Boolean</type> <value>false</value> <defaultValue>false</defaultValue> </knockout> </value> </glowFilter> </value>; var selectedUpState:XML = <value> <blurFilter> <type>Object</type> <value/> </blurFilter> <glowFilter> <type>Object</type> <value> <color hasCheck="false"> <type>uint</type> <value>52224</value> </color> <alpha hasCheck="false"> <type>Number</type> <value>1</value> </alpha> <blurX hasCheck="false"> <type>Number</type> <value>12</value> </blurX> <blurY hasCheck="false"> <type>Number</type> <value>12</value> </blurY> <quality hasCheck="false"> <type>Number</type> <value>2</value> </quality> <inner hasCheck="false"> <type>Boolean</type> <value>false</value> </inner> <knockout hasCheck="false"> <type>Boolean</type> <value>false</value> </knockout> <strength hasCheck="false"> <type>Number</type> <value>2</value> </strength> </value> </glowFilter> <tweenDuration> <type>Number</type> <value>0.3</value> <defaultValue>0.3</defaultValue> </tweenDuration> <tweenType> <type>String</type> <value>Quadratic</value> <defaultValue>Quadratic</defaultValue> </tweenType> <easeType> <type>String</type> <value>easeOut</value> <defaultValue>easeOut</defaultValue> </easeType> </value>;

Page 12: ActionScript3.0 Usage

12

// Create the button effect for the target // movie clip (myButton). var btn:FEBEffect = new FEBEffect(); btn.overState = overState; btn.selectedUpState = selectedUpState; // Create the FlashEff2Code instance and // add it to the display list. var effect:FlashEff2Code = new FlashEff2Code(); effect.useHandCursor = true; effect.buttonEffect = btn; addChild(effect); // Apply the FlashEff2Code instance to the // movie clip. effect._targetInstanceName = "myButton";

commands ArrayNo

[read‐only]ThelistofCommandpatternsappliedtothetargetobject.Thepatternsareinsertedintothelistintheordertheyareappliedtothetargetobject.Ifyouneedthereferencetothethirdpatternapplied,youcanretrieveitjustlikeyouwouldretrieveanyitemfromanArrayobject:var myCommand:FECNavigateToURL = myEffect.commands[2]; IntheFlashEff2panel,CommandpatternscanbeselectedfromtheCommandsareaintheButtontab.ExampleThisexamplelistsallthecommandsappliedtothetargetobject,inthiscase,asinglenavigateToURLcommand(FECNavigateToURL).CreateamoviecliponthestageandgiveitaninstancenameofmyClip.Next,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFECNavigateToURLpatternintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:import com.jumpeye.flashEff2.command.navigateToURL.FECNavigateToURL; var myPattern:FECNavigateToURL = new FECNavigateToURL(); myPattern.url = "http://www.flasheff.com/"; var myEffect:FlashEff2Code = new FlashEff2Code (); myEffect.addCommand(myPattern, "release"); this.addChild(myEffect); myEffect._targetInstanceName = "myClip"; for(var i:int = 0; i < myEffect.commands.length; i++) trace(i+" :: "+myEffect.commands[i]); // 0 :: [object FECNavigateToURL]

currentTransitionType StringNo

[read‐only]Specifiesthetypeofthecurrenttransitiononasymbolortextobject.Possiblevaluesareshow,hideandswap.UsefulwhenaFLASHEFFEvents.TRANSITION_ENDisdispatchedandyouwanttofindoutthetypeoftransitionthathasjustfinished.

Page 13: ActionScript3.0 Usage

13

ExampleThenextexampleappliesashowtransitionbasedontheAlphapattern(FESAlpha),toaclip(symbol)calledmyClip.TheFlashEff2Codecomponentinstancewilldispatcheventswhenthetransitionstartsandwhenitends.CreateamoviecliponthestageandgiveitaninstancenameofmyClip.Next,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFETAlphapatternintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:import com.jumpeye.flashEff2.symbol.alpha.FESAlpha; import com.jumpeye.Events.FLASHEFFEvents; var myPattern:FESAlpha = new FESAlpha(); var myEffect:FlashEff2Code = new FlashEff2Code (); myEffect.showTransition = myPattern; this.addChild(myEffect); myEffect._targetInstanceName = "myClip"; myEffect.addEventListener(FLASHEFFEvents.TRANSITION_START, transitionStartHandler); myEffect.addEventListener(FLASHEFFEvents.TRANSITION_END, transitionEndHandler); function transitionStartHandler(evtObj:FLASHEFFEvents):void { trace("The "+evtObj.target.currentTransitionType+" transition has started."); } function transitionEndHandler(evtObj:FLASHEFFEvents):void { trace("The "+evtObj.target.currentTransitionType+" transition has ended."); }

drawAfterFilters BooleanYes

Iftrue,thebuttoneffectwillbeappliedontheentiretargetobject,includinganyauxiliaryelementsitmighthave,likefilterpatterns.Otherwisethebuttonpatternwillbeappliedonlytothetargetobject,withoutaffectingtheotherpatternsitmighthave,forexamplefilterpatterns.Forexample,ifareflectionfilterhasbeenappliedtothetargetobjectanddrawAfterFiltersistrue,theFEBScalebuttonpatternwillscalethetargetobject,includingthereflection,onrolloverandpressmouseactions.Thedefaultvalueistrue.Example

Page 14: ActionScript3.0 Usage

14

Thisexampleaddsabuttonfilter(FEBScale)whichscalesthetargetonmouseactions.Thetargetobject,inthiscase,alsohasareflectionfilterappliedonit(FEFReflection).CreateamoviecliponthestageandgiveitaninstancenameofmyClip.Next,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFEFReflectionpatternintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:import com.jumpeye.flashEff2.filter.reflection.FEFReflection; import com.jumpeye.flashEff2.buttonEffect.scale.FEBScale; var reflection:FEFReflection = new FEFReflection(); var myEffect:FlashEff2Code = new FlashEff2Code (); myEffect.addFilter(reflection); var myPattern:FEBScale = new FEBScale(); myPattern.tweenDuration = 0.25; myEffect.buttonEffect = myPattern; myEffect.drawAfterFilters = false; this.addChild(myEffect); myEffect._targetInstanceName = "myClip";

filterList ArrayNo

ThelistofFilterpatternsappliedtothetargetobject.Thepatternsareinsertedintothelistintheordertheyareappliedtothetargetobject.Ifyouneedthereferencetothethirdfilterapplied,youcanretrieveitjustlikeyouwouldretrieveanyitemfromanArrayobject:var myFilter:FilterEffect = myEffect.filterList[2]; IntheFlashEff2panel,thedesiredpanelcanbeselectedfromtheFiltertab‐>Patternlist.ExampleThisexamplelistsallthefiltersappliedtothetargetobject,inthiscase,asinglereflectionfilter(FEFReflection).CreateamoviecliponthestageandgiveitaninstancenameofmyClip.Next,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFEFReflectionpatternintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:import com.jumpeye.flashEff2.filter.reflection.FEFReflection; var myPattern:FEFReflection = new FEFReflection(); var myEffect:FlashEff2Code = new FlashEff2Code(); myEffect.addFilter(myPattern); this.addChild(myEffect); myEffect._targetInstanceName = "myClip"; for(var i:int = 0; i <

Page 15: ActionScript3.0 Usage

15

myEffect.filterList.length; i++) trace(i+" :: "+myEffect.filterList[i]); // 0 :: [object FEFReflection]

groupName StringNo

Thegroupnameforthetargetdisplayobjectthatwillbeusedasaradiobuttoninstance.Youcanusethispropertytogetorsetagroupnamefortargetdisplayobjectsusedasradiobuttoninstancesorforaradiobuttongroup.Youcanhavemultipleradiobuttongroupsbysettingdifferentgroupnamestoyourtargetdisplayobjects.Eachradiobuttongroupwillworkindependentlyoftheothersandeachgroupwillhaveasingletargetobjectintheselectedstate,atonemoment.Thedefaultvalueis"feGroup".ExampleThenextexamplewillcreateagroupofradiobuttonsusingFlashEff2.Createamoviecliponthestagethatwillbeusedasbuttonandduplicateit.Giveeachoneaninstancename:"button1"and"button2".Next,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFEBEffectpatternintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:import com.jumpeye.flashEff2.buttonEffect.FEBEffect; var overState:XML = <value> <tweenDuration> <type>Number</type> <value>1</value> <defaultValue>1</defaultValue> </tweenDuration> <tweenType> <type>String</type> <value>Strong</value> <defaultValue>Strong</defaultValue> </tweenType> <easeType> <type>String</type> <value>easeOut</value> <defaultValue>easeOut</defaultValue> </easeType> <blurFilter> <type>Object</type> <value/> </blurFilter> <glowFilter> <type>Object</type> <value> <color hasCheck="false"> <type>uint</type> <value>26367</value> <defaultValue>14492194</defaultValue> </color> <alpha hasCheck="false"> <type>Number</type> <value>1</value> <defaultValue>1</defaultValue> </alpha> <blurX hasCheck="false"> <type>Number</type> <value>12</value> <defaultValue>10</defaultValue>

Page 16: ActionScript3.0 Usage

16

</blurX> <blurY hasCheck="false"> <type>Number</type> <value>12</value> <defaultValue>10</defaultValue> </blurY> <strength hasCheck="false"> <type>Number</type> <value>2</value> <defaultValue>2</defaultValue> </strength> <quality hasCheck="false"> <type>Number</type> <value>2</value> <defaultValue>2</defaultValue> </quality> <inner hasCheck="false"> <type>Boolean</type> <value>false</value> <defaultValue>false</defaultValue> </inner> <knockout hasCheck="false"> <type>Boolean</type> <value>false</value> <defaultValue>false</defaultValue> </knockout> </value> </glowFilter> </value>; var selectedUpState:XML = <value> <blurFilter> <type>Object</type> <value/> </blurFilter> <glowFilter> <type>Object</type> <value> <color hasCheck="false"> <type>uint</type> <value>52224</value> </color> <alpha hasCheck="false"> <type>Number</type> <value>1</value> </alpha> <blurX hasCheck="false"> <type>Number</type> <value>12</value> </blurX> <blurY hasCheck="false"> <type>Number</type> <value>12</value> </blurY> <quality hasCheck="false"> <type>Number</type> <value>2</value> </quality> <inner hasCheck="false"> <type>Boolean</type> <value>false</value> </inner> <knockout hasCheck="false"> <type>Boolean</type> <value>false</value> </knockout> <strength hasCheck="false"> <type>Number</type> <value>2</value> </strength> </value> </glowFilter> <tweenDuration> <type>Number</type> <value>0.3</value> <defaultValue>0.3</defaultValue>

Page 17: ActionScript3.0 Usage

17

</tweenDuration> <tweenType> <type>String</type> <value>Quadratic</value> <defaultValue>Quadratic</defaultValue> </tweenType> <easeType> <type>String</type> <value>easeOut</value> <defaultValue>easeOut</defaultValue> </easeType> </value>; // Create the button effect for the first // movie clip (button1). var btn1:FEBEffect = new FEBEffect(); btn1.overState = overState; btn1.selectedUpState = selectedUpState; // Create the button effect for the second // movie clip (button2). var btn2:FEBEffect = new FEBEffect(); btn2.overState = overState; btn2.selectedUpState = selectedUpState; // Create the first FlashEff2 instance and // add it to the display list. var effect1:FlashEff2Code = new FlashEff2Code(); effect1.useHandCursor = true; effect1.groupName = "myGroup"; effect1.buttonEffect = btn1; addChild(effect1); // Create the second FlashEff2 instance and // add it to the display list. var effect2:FlashEff2Code = new FlashEff2Code(); effect2.useHandCursor = true; effect2.groupName = "myGroup"; effect2.buttonEffect = btn2; addChild(effect2); // Apply the two FlashEff2 instances to the // two movie clips. effect1._targetInstanceName = "button1"; effect2._targetInstanceName = "button2";

hideAutoPlay BooleanNo

Thispropertycontrolsthehidetransitionappliedtothetargetobject(symbolortextfield).Iftrue,thetransitionwillbeappliedafterthetimedelayspecifiedathideDelayandafterallthenecessarypropertieswereset.Iffalse,thehidetransitionwillhavetobecalledthroughActionScriptcode,usingthetransitionEffect()orhide()methods.ThispropertycanalsobesetintheFlashEff2panelbyselectingthe"autoPlay"optionintheHidetab.Thedefaultvalueistrue.ExampleThenextexampleappliesautomaticallyashowtransitionbasedon

Page 18: ActionScript3.0 Usage

18

theAlphapattern(FESAlpha),onatargetclip(symbol)calledmyClip.SincehideAutoPlayissettofalse,thehidetransitionwillnotoccurautomatically.We'llhavetospecificallytellthecomponenttohidetheclipwhenamouseclickisexecutedonit.CreateamoviecliponthestageandgiveitaninstancenameofmyClip.Next,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFESAlphapatternintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:var myEffect:FlashEff2Code = new FlashEff2Code(); myEffect.showTransitionName = "com.jumpeye.flashEff2.symbol.alpha.FESAlpha"; myEffect.hideTransitionName = "com.jumpeye.flashEff2.symbol.alpha.FESAlpha"; this.addChild(myEffect); myEffect.showAutoPlay = true; myEffect.hideAutoPlay = false; myEffect._targetInstanceName = "myClip"; myClip.addEventListener(MouseEvent.CLICK, clickHandler); function clickHandler(event:MouseEvent):void { myEffect.hide(); }

hideDelay NumberYes

Thetimeinterval,measuredinseconds,untilthehidetransitionshouldstart.ThispropertyisusedonlyifhideAutoPlayistrue.Thepropertyalsoacceptsfloatingpointnumbers,soyoucansettimeintervalswithmillisecondsprecision.ThispropertycanbesetintheFlashEff2panel‐>Hidetab‐>"delay"option.Thedefaultvalueis2.ExampleThenextexampleappliesahidetransitionbasedontheAlphapattern(FESAlpha),onatargetclip(symbol)calledmyClip,aftera5secondsdelay.CreateamoviecliponthestageandgiveitaninstancenameofmyClip.Next,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFESAlphapatternintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:var myEffect:FlashEff2Code = new FlashEff2Code(); myEffect.hideTransitionName = "com.jumpeye.flashEff2.symbol.alpha.FESAlpha"; this.addChild(myEffect); myEffect.hideDelay = 5; myEffect._targetInstanceName = "myClip";

hideTransition IFlashEffSymbolTextNo

Areferencetotheinstanceofthepatternusedforthehidetransition.Whenusedfromcode,thisreferenceiscreatedseparatelybyusingthepattern'sconstructor.Otherwisethehidepatterncanbe

Page 19: ActionScript3.0 Usage

19

selectedfromFlashEff2panel‐>Hidetab‐>Patternlist.ExampleThenextexampleappliesahidetransitionbasedontheAlphapattern(FESAlpha),toaclip(symbol)calledmyClip.CreateamoviecliponthestageandgiveitaninstancenameofmyClip.Next,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFESAlphapatternintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:import com.jumpeye.flashEff2.symbol.alpha.FESAlpha; var myPattern:FESAlpha = new FESAlpha(); var myEffect:FlashEff2Code = new FlashEff2Code(); myEffect.hideTransition = myPattern; myEffect.hideDelay = 0; this.addChild(myEffect); myEffect._targetInstanceName = "myClip";

hideTransitionName StringNo

Thefullpathandclassnameofthepatternusedforthehidetransition.Thishidetransitionswitchesthetargetfromavisiblestatetoaninvisiblestate,usinganeffectprovidedbytheselectedpattern.Ifyouneedtoapplyahidetransitiononatargetobject,firstyouhavetosetthatpatterntotheFlashEff2CodeinstanceeitherbysettingthehideTransitionNameorthehideTransitionpropertyorbyselectingapatterninFlashEff2panel‐>Hidetab‐>Patternlist.ExampleThenextexampleappliesahidetransitionbasedontheAlphapattern(FESAlpha),toaclip(symbol)calledmyClip.Thetransitionisappliedwithatwosecondsdelaybecause,bydefault,hideDelayis2.Ifyouwouldliketheeffecttorunimmediately,setthehideDelaypropertyto0.CreateamoviecliponthestageandgiveitaninstancenameofmyClip.Next,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFESAlphapatternintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:var myEffect:FlashEff2Code = new FlashEff2Code(); myEffect.hideTransitionName = "com.jumpeye.flashEff2.symbol.alpha.FESAlpha"; this.addChild(myEffect); myEffect._targetInstanceName = "myClip";

isTargetVisibleAtEnd BooleanNo

Controlsthewaythetextlooksaftertheeffectappliedonithasended.Iftrue,thetextwillbedisplayedintheoriginalform(mightslightlydifferinpositionfromthetextwitheffect).Iffalse,thetextwillremaininthefinalstateaftertheeffecthasended.Thisfinalstateisnotnecessarilytheoriginaltextfield,itmightbyonlyacopyofit,onwhichtheactualeffectwasapplied.

Page 20: ActionScript3.0 Usage

20

IfremoveEffect()iscalledduringtheshowonthetextfieldandthepropertyissettotrueafterthetransitionstops,theobjectdisplayedwillbetheoriginaltextfieldandnottheBitmapcopyofit.Ifthepropertyissettotrue,itisrecommendedthatthexandycoordinatesofthetargetobjectareintegervalues,otherwiseyoumayexperiencesomepositionshiftingafterthetransitionhasendedandthetargettextfieldisdisplayedintheinitialstate.Thedefaultvalueisfalse.ExampleThenextexampleappliesashowtransitionbasedontheAlphapattern(FETAlpha),toatextfieldcalledmyTextFieldandafterthetransitionhasfinishedandleavestheoriginaltextfielddisplayedandnotaBitmapcopyofit,thetextfieldwillbeselectable.Placeadynamic,selectabletextfieldonthestage,enterthe"Thequickbrownfoxjumpsoverthelazydog"textintoitandgiveitaninstancenameofmyTextField.Settheanti‐aliassettingto"Anti‐aliasforanimation",enablethe"RendertextasHTML"optionandembedthecharactersusingtheAutoFilloptionintheEmbedcharactersdialogbox.Next,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFETAlphapatternintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:import com.jumpeye.flashEff2.text.alpha.FETAlpha; var myPattern:FETAlpha = new FETAlpha(); var myEffect:FlashEff2Code = new FlashEff2Code(); myEffect.showTransition = myPattern; myEffect.isTargetVisibleAtEnd = true; this.addChild(myEffect); myEffect._targetInstanceName = "myTextField";

isTransitioning BooleanNo

Specifieswhetherthereisatransitiongoingon(true)ornot(false).ExampleThenextexampleappliesahidetransitionbasedontheAlphapattern(FESAlpha),toaclip(symbol)calledmyClip.Thetransitionisappliedwitha1seconddelay.WearealsosettingupahandlerfortheENTER_FRAMEevent,soeachtimetheclipentersanewframe,theisTransitioningpropertyischeckedforit'svalue.Onceitchanges,thevalueisdisplayed.CreateamoviecliponthestageandgiveitaninstancenameofmyClip.Next,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFESAlphapatternintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:import com.jumpeye.flashEff2.symbol.alpha.FESAlpha;

Page 21: ActionScript3.0 Usage

21

var isTransitionHappening:Boolean; var myPattern:FESAlpha = new FESAlpha(); var myEffect:FlashEff2Code = new FlashEff2Code(); myEffect.showTransition = myPattern; myEffect.showDelay = 1; this.addChild(myEffect); myEffect._targetInstanceName = "myClip"; isTransitionHappening = true; this.addEventListener(Event.ENTER_FRAME, loop); function loop(event:Event):void { if (isTransitionHappening != myEffect.isTransitioning) { trace((myEffect.isTransitioning ? "transition in course" : "no transition at the moment")); isTransitionHappening = myEffect.isTransitioning; } } IntheOutputpaneltheclipwilltracethevaluesoftheisTransitioningpropertywhiletheclipisrunning:no transition at the moment transition in course no transition at the moment

selected BooleanNo

Specifieswhetherthetargetdisplayobjectusedasbuttonisselectedornot.Thedefaultvalueisfalse.

showAutoPlay BooleanYes

Thispropertycontrolstheshowtransitionappliedtothetargetobject.Iftrue,thetransitionwillbeappliedafterthetimedelayspecifiedatshowDelayandafterallthenecessarypropertieswereset.Iffalse,theshowtransitionwillhavetobecalledthroughActionScriptcode,usingthetransitionEffect()orshow()methods.ThispropertycanalsobesetintheFlashEff2panelbyselectingthe"autoPlay"optionintheShowtab.Thedefaultvalueistrue.ExampleThenextexampleappliesaconsecutiveshowandhidetransitionbasedontheAlphapattern(FESAlpha),onatargetclip(symbol)calledmyClip.SincehideAutoPlayissettotrue,thehidetransitionwilloccurautomaticallyafter3secondsaftertheshowtransition.Theshowtransitionhoweverwillnotoccur(showAutoPlayisfalse)untilwespecificallytellthecomponenttoshowtheclipwhenamouseclickisexecutedonit.CreateamoviecliponthestageandgiveitaninstancenameofmyClip.Next,fromtheComponentspaneldragtheFlashEff2Code

Page 22: ActionScript3.0 Usage

22

componentandtheFESAlphapatternintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:var myEffect:FlashEff2Code = new FlashEff2Code(); myEffect.showTransitionName = "com.jumpeye.flashEff2.symbol.alpha.FESAlpha"; myEffect.hideTransitionName = "com.jumpeye.flashEff2.symbol.alpha.FESAlpha"; this.addChild(myEffect); myEffect.showAutoPlay = false; myEffect.hideDelay = 5; myEffect.hideAutoPlay = true; myEffect._targetInstanceName = "myClip"; myClip.addEventListener(MouseEvent.CLICK, clickHandler); function clickHandler(event:MouseEvent):void { myEffect.show(); }

showDelay NumberYes

Thetimeinterval,measuredinseconds,untiltheshowtransitionshouldstart.ThispropertyisusedonlyifshowAutoPlayistrue.Thepropertyalsoacceptsfloatingpointnumbers,soyoucansettimeintervalswithmillisecondsprecision.ThispropertycanbesetfromtheFlashEff2panel‐>Showtab‐>"delay"option.Thedefaultvalueis2.ExampleThenextexampleappliesashowtransitionbasedontheAlphapattern(FESAlpha),onatargetclip(symbol)calledmyClip,aftera5secondsdelay.CreateamoviecliponthestageandgiveitaninstancenameofmyClip.Next,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFESAlphapatternintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:var myEffect:FlashEff2Code = new FlashEff2Code(); myEffect.showTransitionName = "com.jumpeye.flashEff2.symbol.alpha.FESAlpha"; this.addChild(myEffect); myEffect.showDelay = 5; myEffect._targetInstanceName = "myClip";

showTransition IFlashEffSymbolTextNo

Areferencetotheinstanceofthepatternusedfortheshowtransition.Thisreferenceiscreatedseparatelybyusingthepattern'sconstructor.OtherwisetheshowpatterncanbeselectedfromFlashEff2panel‐>Showtab‐>Patternlist.ExampleThenextexampleappliesashowtransitionbasedontheAlphapattern(FESAlpha),toaclip(symbol)calledmyClip.

Page 23: ActionScript3.0 Usage

23

CreateamoviecliponthestageandgiveitaninstancenameofmyClip.Next,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFESAlphapatternintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:import com.jumpeye.flashEff2.symbol.alpha.FESAlpha; var myPattern:FESAlpha = new FESAlpha(); var myEffect:FlashEff2Code = new FlashEff2Code(); myEffect.showTransition = myPattern; this.addChild(myEffect); myEffect._targetInstanceName = "myClip";

showTransitionName StringNo

Thefullpathandclassnameofthepatternusedfortheshowtransition.Thisshowtransitionswitchesthetargetfromaninvisiblestatetoavisiblestate,usinganeffectprovidedbytheselectedpattern.Ifyouneedtoapplyashowtransitiontoatargetobject,firstyouhavetosetthatpatterntotheFlashEff2CodeinstanceeitherbysettingtheshowTransitionNameortheshowTransitionpropertyorbyselectingapatterninFlashEff2panel‐>Showtab‐>Patternlist.ExampleThenextexampleappliesashowtransitionbasedontheAlphapattern(FESAlpha),toaclip(symbol)calledmyClip.CreateamoviecliponthestageandgiveitaninstancenameofmyClip.Next,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFESAlphapatternintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:var myEffect:FlashEff2Code = new FlashEff2Code(); myEffect.showTransitionName = "com.jumpeye.flashEff2.symbol.alpha.FESAlpha"; this.addChild(myEffect); myEffect._targetInstanceName = "myClip";

swapDelay NumberYes

Thedelayusedfortheswaptransition‐thetimeintervalbetweenthestartofthehidetransitiononthecurrenttargetandthestartoftheshowtransitiononthenexttarget.IfswapDelayis0thenthehideonthecurrenttargetandtheshowonthenexttargettakeplaceinthesametime,meaningthatthisisacrossfade‐liketransitionbetweenthetwoobjects.IfswapDelayislargerthanthedurationofthehidetransitionthenthetwotargetobjectswillbedisplayedoneaftertheother(thecurrenttargethidesandthenthenexttargetisdisplayed).Thedefaultvalueis0.ExampleThenextexampleappliesashowtransitionbasedontheAlphapattern(FETAlpha)toatextfieldcalledmyTextField1andthenswapsthetextfieldwithanotheronecalledmyTextField2.Theswap

Page 24: ActionScript3.0 Usage

24

operationhidesthefirsttextfieldusingtheBlurpattern(FETBlur)andthendisplaysthesecondtextfieldatthesametimewiththeAlphapattern.Placetwodynamictextfieldsonthestage,enterthe"Thisisthefirsttextfield"textintooneofthemand"Thisisthesecondtextfield"textintoheotherandgivetheminstancenamesofmyTextField1forthefirsttextfieldandmyTextField2forthesecondone.Changetheanti‐aliassettingto"Anti‐aliasforanimation",enablethe"RendertextasHTML"optionandembedthecharactersusingtheAutoFilloptionintheEmbedcharactersdialogboxforbothtextfields.Next,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFETAlphaandFETBlurpatternsintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:import com.jumpeye.flashEff2.text.alpha.FETAlpha; import com.jumpeye.flashEff2.text.blur.FETBlur; var showPattern1:FETAlpha = new FETAlpha(); var showPattern2:FETAlpha = new FETAlpha(); var hidePattern:FETBlur = new FETBlur(); var myEffect:FlashEff2Code = new FlashEff2Code(); myEffect.targetVisibility = false; myEffect.showTransition = showPattern1; myEffect.hideTransition = hidePattern; myEffect.useSwapInsteadHide = true; myEffect.swapType = FlashEff2.SWAP_TYPE_HIDE_AND_SHOW; myEffect.swapTransition = showPattern2; myEffect.swapDelay = 0; myEffect.swapTargetVisibility = false; this.addChild(myEffect); myEffect.swapTargetInstanceName = "myTextField2"; myEffect._targetInstanceName = "myTextField1";

swapTarget DisplayObjectNo

Thereferencetothesecondtargetobjectusedfortheswaptransition.Thesecondtargetobjectoftheswaptransitionistheoneonwhichtheshowtransitionisexecuted.ThispropertymustbesetafterboththetargetobjectandtheFlashEff2Codecomponentwereaddedtothedisplaylist.ExampleThenextexampleappliesashowtransitionbasedontheAlphapattern(FETAlpha)toatextfieldcalledmyTextField1andthenswapsthetextfieldwithanotheronecalledmyTextField2.TheswapoperationhidesthefirsttextfieldusingtheBlurpattern(FETBlur)andthendisplaysthesecondtextfieldatthesametimewiththeAlphapattern.Placetwodynamictextfieldsonthestage,enterthe"Thisisthefirsttextfield"textintooneofthemand"Thisisthesecondtextfield"textintoheotherandgivetheminstancenamesofmyTextField1for

Page 25: ActionScript3.0 Usage

25

thefirsttextfieldandmyTextField2forthesecondone.Changetheanti‐aliassettingto"Anti‐aliasforanimation",enablethe"RendertextasHTML"optionandembedthecharactersusingtheAutoFilloptionintheEmbedcharactersdialogboxforbothtextfields.Next,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFETAlphaandFETBlurpatternsintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:import com.jumpeye.flashEff2.text.alpha.FETAlpha; import com.jumpeye.flashEff2.text.blur.FETBlur; var showPattern1:FETAlpha = new FETAlpha(); var showPattern2:FETAlpha = new FETAlpha(); var hidePattern:FETBlur = new FETBlur(); var myEffect:FlashEff2Code = new FlashEff2Code(); myEffect.targetVisibility = false; myEffect.showTransition = showPattern1; myEffect.hideTransition = hidePattern; myEffect.useSwapInsteadHide = true; myEffect.swapType = FlashEff2.SWAP_TYPE_HIDE_AND_SHOW; myEffect.swapTransition = showPattern2; myEffect.swapDelay = 0; myEffect.swapTargetVisibility = false; this.addChild(myEffect); myEffect.swapTarget = myTextField2; myEffect._targetInstanceName = "myTextField1";

swapTargetInstanceName

StringYes

Theinstancenameofthesecondtargetobjectusedfortheswaptransition.Thesecondtargetobjectoftheswaptransitionistheoneonwhichtheshowtransitionisexecuted.ThispropertymustbesetafterboththetargetobjectandtheFlashEff2Codecomponentwereaddedtothedisplaylist.ExampleThenextexampleappliesashowtransitionbasedontheAlphapattern(FETAlpha)toatextfieldcalledmyTextField1andthenswapsthetextfieldwithanotheronecalledmyTextField2.TheswapoperationhidesthefirsttextfieldusingtheBlurpattern(FETBlur)andthendisplaysthesecondtextfieldatthesametimewiththeAlphapattern.Placetwodynamictextfieldsonthestage,enterthe"Thisisthefirsttextfield"textintooneofthemand"Thisisthesecondtextfield"textintoheotherandgivetheminstancenamesofmyTextField1forthefirsttextfieldandmyTextField2forthesecondone.Changetheanti‐aliassettingto"Anti‐aliasforanimation",enablethe"RendertextasHTML"optionandembedthecharactersusingtheAutoFilloptionintheEmbedcharactersdialogboxforbothtextfields.Next,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFETAlphaandFETBlurpatternsintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:

Page 26: ActionScript3.0 Usage

26

import com.jumpeye.flashEff2.text.alpha.FETAlpha; import com.jumpeye.flashEff2.text.blur.FETBlur; var showPattern1:FETAlpha = new FETAlpha(); var showPattern2:FETAlpha = new FETAlpha(); var hidePattern:FETBlur = new FETBlur(); var myEffect:FlashEff2Code = new FlashEff2Code(); myEffect.targetVisibility = false; myEffect.showTransition = showPattern1; myEffect.hideTransition = hidePattern; myEffect.useSwapInsteadHide = true; myEffect.swapType = FlashEff2.SWAP_TYPE_HIDE_AND_SHOW; myEffect.swapTransition = showPattern2; myEffect.swapDelay = 0; myEffect.swapTargetVisibility = false; this.addChild(myEffect); myEffect.swapTargetInstanceName = "myTextField2"; myEffect._targetInstanceName = "myTextField1";

swapTargetVisibility BooleanYes

ABooleanvaluewhichspecifieswhetherthesecondtargetobjectoftheswaptransitionisvisible(true)beforetheswaptransitionstartsorinvisible(false).Thesecondtargetobjectoftheswaptransitionistheoneonwhichtheshowtransitionisexecuted.Thedefaultvalueisfalse.ExampleThenextexampleappliesashowtransitionbasedontheAlphapattern(FETAlpha)toatextfieldcalledmyTextField1andthenswapsthetextfieldwithanotheronecalledmyTextField2.TheswapoperationhidesthefirsttextfieldusingtheBlurpattern(FETBlur)andthendisplaysthesecondtextfieldatthesametimewiththeAlphapattern.Thesecondtextfieldwillbevisiblebeforetheswaptransitionstarts,becauseswapTargetVisibilityissettotrue.Placetwodynamictextfieldsonthestage,enterthe"Thisisthefirsttextfield"textintooneofthemand"Thisisthesecondtextfield"textintoheotherandgivetheminstancenamesofmyTextField1forthefirsttextfieldandmyTextField2forthesecondone.Changetheanti‐aliassettingto"Anti‐aliasforanimation",enablethe"RendertextasHTML"optionandembedthecharactersusingtheAutoFilloptionintheEmbedcharactersdialogboxforbothtextfields.Next,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFETAlphaandFETBlurpatternsintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:import com.jumpeye.flashEff2.text.alpha.FETAlpha; import com.jumpeye.flashEff2.text.blur.FETBlur; var showPattern1:FETAlpha = new FETAlpha();

Page 27: ActionScript3.0 Usage

27

var showPattern2:FETAlpha = new FETAlpha(); var hidePattern:FETBlur = new FETBlur(); var myEffect:FlashEff2Code = new FlashEff2Code(); myEffect.targetVisibility = false; myEffect.showTransition = showPattern1; myEffect.hideTransition = hidePattern; myEffect.useSwapInsteadHide = true; myEffect.swapType = FlashEff2.SWAP_TYPE_HIDE_AND_SHOW; myEffect.swapTransition = showPattern2; myEffect.swapDelay = 0; myEffect.swapTargetVisibility = true; this.addChild(myEffect); myEffect.swapTargetInstanceName = "myTextField2"; myEffect._targetInstanceName = "myTextField1";

swapTransition IFlashEffSymbolTextNo

Areferencetotheinstanceofthepatternusedfortheswaptransition.Thisreferenceiscreatedseparatelybyusingthepattern'sconstructor.ExampleThenextexampleappliesashowtransitionbasedontheAlphapattern(FETAlpha)toatextfieldcalledmyTextField1andthenswapsthetextfieldwithanotheronecalledmyTextField2.TheswapoperationhidesthefirsttextfieldusingtheBlurpattern(FETBlur)andthendisplaysthesecondtextfieldatthesametimewiththeAlphapattern.Placetwodynamictextfieldsonthestage,enterthe"Thisisthefirsttextfield"textintooneofthemand"Thisisthesecondtextfield"textintoheotherandgivetheminstancenamesofmyTextField1forthefirsttextfieldandmyTextField2forthesecondone.Changetheanti‐aliassettingto"Anti‐aliasforanimation",enablethe"RendertextasHTML"optionandembedthecharactersusingtheAutoFilloptionintheEmbedcharactersdialogboxforbothtextfields.Next,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFETAlphaandFETBlurpatternsintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:import com.jumpeye.flashEff2.text.alpha.FETAlpha; import com.jumpeye.flashEff2.text.blur.FETBlur; var showPattern1:FETAlpha = new FETAlpha(); var showPattern2:FETAlpha = new FETAlpha(); var hidePattern:FETBlur = new FETBlur(); var myEffect:FlashEff2Code = new FlashEff2Code(); myEffect.targetVisibility = false; myEffect.showTransition = showPattern1; myEffect.hideTransition = hidePattern; myEffect.useSwapInsteadHide = true; myEffect.swapType =

Page 28: ActionScript3.0 Usage

28

FlashEff2.SWAP_TYPE_HIDE_AND_SHOW; myEffect.swapTransition = showPattern2; myEffect.swapDelay = 0; myEffect.swapTargetVisibility = false; this.addChild(myEffect); myEffect.swapTargetInstanceName = "myTextField2"; myEffect._targetInstanceName = "myTextField1";

swapTransitionName StringYes

Thefullpathandclassnameofthepatternusedfortheswaptransition.Practicallythisisthepatternthatwillexecutetheshowtransitiononthesecondtargetobject.Ifthereisnopatternnamespecified,thepatternusedwillbetheonespecifiedatshowTransitionNameorshowTransition(ifitisthecase).ExampleThenextexampleappliesashowtransitionbasedontheAlphapattern(FETAlpha)toatextfieldcalledmyTextField1andthenswapsthetextfieldwithanotheronecalledmyTextField2.TheswapoperationhidesthefirsttextfieldusingtheBlurpattern(FETBlur)andthendisplaysthesecondtextfieldatthesametimewiththeAlphapattern.Placetwodynamictextfieldsonthestage,enterthe"Thisisthefirsttextfield"textintooneofthemand"Thisisthesecondtextfield"textintoheotherandgivetheminstancenamesofmyTextField1forthefirsttextfieldandmyTextField2forthesecondone.Changetheanti‐aliassettingto"Anti‐aliasforanimation",enablethe"RendertextasHTML"optionandembedthecharactersusingtheAutoFilloptionintheEmbedcharactersdialogboxforbothtextfields.Next,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFETAlphaandFETBlurpatternsintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:import com.jumpeye.flashEff2.text.alpha.FETAlpha; import com.jumpeye.flashEff2.text.blur.FETBlur; var showPattern1:FETAlpha = new FETAlpha(); var showPattern2:FETAlpha = new FETAlpha(); var hidePattern:FETBlur = new FETBlur(); var myEffect:FlashEff2Code = new FlashEff2Code(); myEffect.targetVisibility = false; myEffect.showTransition = showPattern1; myEffect.hideTransition = hidePattern; myEffect.useSwapInsteadHide = true; myEffect.swapType = FlashEff2.SWAP_TYPE_HIDE_AND_SHOW; myEffect.swapTransitionName = "com.jumpeye.flashEff2.text.alpha.FETAlpha"; myEffect.swapDelay = 0; myEffect.swapTargetVisibility = false; this.addChild(myEffect); myEffect.swapTargetInstanceName =

Page 29: ActionScript3.0 Usage

29

"myTextField2"; myEffect._targetInstanceName = "myTextField1";

swapType StringYes

Thetypeoftheswaptransition.PossiblevaluesareFlashEff2.SWAP_TYPE_SHOW,FlashEff2.SWAP_TYPE_HIDEandFlashEff2.SWAP_TYPE_HIDE_AND_SHOW *FlashEff2.SWAP_TYPE_SHOWor"show"‐leavesthecurrenttargetinplace,withouthidingitandexecutesonlyashowtransitiononthenexttarget*FlashEff2.SWAP_TYPE_HIDEor"hide"‐executesonlyahidetransitiononthecurrenttargetandthenexttargetismadevisible(ifitwasinvisiblepriortotheoperation)withoutanytransitioneffects*FlashEff2.SWAP_TYPE_HIDE_AND_SHOWor"hideAndShow"‐executesahidetransitiononthecurrenttargetandashowtransitiononthenexttarget,usingthetimeintervalspecifiedatswapDelay ThedefaultvalueishideAndShow.ExampleThenextexampleappliesashowtransitionbasedontheAlphapattern(FETAlpha)toatextfieldcalledmyTextField1andthenswapsthetextfieldwithanotheronecalledmyTextField2.TheswapoperationhidesthefirsttextfieldusingtheBlurpattern(FETBlur)andthendisplaysthesecondtextfieldatthesametimewiththeAlphapattern.Placetwodynamictextfieldsonthestage,enterthe"Thisisthefirsttextfield"textintooneofthemand"Thisisthesecondtextfield"textintoheotherandgivetheminstancenamesofmyTextField1forthefirsttextfieldandmyTextField2forthesecondone.Changetheanti‐aliassettingto"Anti‐aliasforanimation",enablethe"RendertextasHTML"optionandembedthecharactersusingtheAutoFilloptionintheEmbedcharactersdialogboxforbothtextfields.Next,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFETAlphaandFETBlurpatternsintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:import com.jumpeye.flashEff2.text.alpha.FETAlpha; import com.jumpeye.flashEff2.text.blur.FETBlur; var showPattern1:FETAlpha = new FETAlpha(); var showPattern2:FETAlpha = new FETAlpha(); var hidePattern:FETBlur = new FETBlur(); var myEffect:FlashEff2Code = new FlashEff2Code(); myEffect.targetVisibility = false; myEffect.showTransition = showPattern1; myEffect.hideTransition = hidePattern; myEffect.useSwapInsteadHide = true; myEffect.swapType = FlashEff2.SWAP_TYPE_HIDE_AND_SHOW; myEffect.swapTransition = showPattern2;

Page 30: ActionScript3.0 Usage

30

myEffect.swapDelay = 0; myEffect.swapTargetVisibility = false; this.addChild(myEffect); myEffect.swapTargetInstanceName = "myTextField2"; myEffect._targetInstanceName = "myTextField1";

target DisplayObjectNo

Thereferencetothetargetobject.Thetargetcanbesetusingthefullpathinthetimeline,ifthisobjectandtheFlashEff2Codeinstancedonothavethesamedirectparent(e.g.TheFlashEff2Codeinstancewasaddedtothedisplaylistasachildofclip1andthetargetobjectismyClip.container.targetClip).ThispropertymustbesetafterboththetargetobjectandtheFlashEff2Codecomponentwereaddedtothedisplaylist.ExampleThenextexampleappliesashowtransitionbasedontheAlphapattern(FESAlpha),toaclip(symbol)calledmyClip.CreateamoviecliponthestageandgiveitaninstancenameofmyClip.Next,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFESAlphapatternintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:var myEffect:FlashEff2Code = new FlashEff2Code(); myEffect.showTransitionName = "com.jumpeye.flashEff2.symbol.alpha.FESAlpha"; this.addChild(myEffect); myEffect._targetInstanceName = "myClip"; trace(myEffect.target+" :: "+myEffect.target.name); // [object MovieClip] :: myClip

targetVisibility BooleanYes

Specifieswhetherthetargetobjectisvisibleatthebeginning,beforeapplyingtheshoworhidetransitions.Iftrue,thetargetobjectwillbedisplayedduringthetimeintervalspecifiedatshowDelayorhideDelayand,afterthat,theshoworhidetransitionwillstart.Incaseofashowtransition,thetargetwillbedisplayedfortheamountoftimespecifiedbyshowDelayandthenhidden,beforethetransitionstarts.ThispropertycanalsobesetfromtheFlashEff2panelbyselectingthe"targetisvisible"optionintheShoworHidetab.Thedefaultvalueistrue.ExampleThenextexampleappliesashowtransitionbasedontheAlphapattern(FESAlpha),toaclip(symbol)calledmyClip.Beforetheexecutingthetransition,thereisa3seconddelaywhilethetargetobjectiskeptinvisiblebecausetargetVisibilityissettofalse.CreateamoviecliponthestageandgiveitaninstancenameofmyClip.Next,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFESAlphapatternintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:

Page 31: ActionScript3.0 Usage

31

import com.jumpeye.flashEff2.symbol.alpha.FESAlpha; var myPattern:FESAlpha = new FESAlpha(); var myEffect:FlashEff2Code = new FlashEff2Code(); myEffect.showTransition = myPattern; myEffect.showDelay = 3; myEffect.targetVisibility = false; this.addChild(myEffect); myEffect._targetInstanceName = "myClip";

textField TextFieldNo

Thereferencetothetargettextfieldonwhichtheeffectisapplied.YoucandirectlyaccessthepropertiesandmethodsofthetargettextfieldbyaccessingthispropertyoftheFlashEff2Codecomponentinstance.ExampleThenextexampleappliesashowtransitionbasedontheAlphapattern(FETAlpha),onatextfieldcalledmyTextField.Placeadynamictextfieldonthestage,enterthe"Thequickbrownfoxjumpsoverthelazydog"textintoitandgiveitaninstancenameofmyTextField.Changetheanti‐aliassettingto"Anti‐aliasforanimation",enablethe"RendertextasHTML"optionandembedthecharactersusingtheAutoFilloptionintheEmbedcharactersdialogbox.Next,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFETAlphapatternintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:var myEffect:FlashEff2Code = new FlashEff2Code(); myEffect.showTransitionName = "com.jumpeye.flashEff2.text.alpha.FETAlpha"; this.addChild(myEffect); myEffect._targetInstanceName = "myTextField"; trace(myEffect.target+" :: "+myEffect.target.name);

toggle BooleanNo

Thispropertyindicateswhetherthetargetdisplayobjectusedasabutton(abuttoneffectisappliedonit)canbetoggledornot.Ifitissettofalse,thebuttonwillnothaveaselectedstate.Thedefaultvalueistrue.

useHandCursor BooleanYes

ABooleanvaluethatindicateswhetherthepointinghand(handcursor)appearswhenthemouserollsoverthetargetobject.IfthispropertyissettotruethebuttonModepropertyissettotrueautomaticallyandthepointinghandusedforbuttonsappearswhenthemouserollsoverthetargetobject.IfuseHandCursorisfalse,thearrowpointerisusedinstead.YoucanchangetheuseHandCursorpropertyanytime,eitherbycodeorfromtheFlashEff2panelitself.

Page 32: ActionScript3.0 Usage

32

Thedefaultvalueisfalse.

useSwapInsteadHide BooleanYes

ABooleanvaluewhichindicateswhetheraswaptransitionshouldbemadeinsteadofahidetransition.Iftrue,aswaptransitionwilltakeplaceandnotthehidetransition.Thispropertymustalwaysbesettotrue,ifyouwantoswapthecurrenttargetobjectwithanotherone.TheswaptransitionwillapplyahidetransitiononthecurrenttextfieldifswapTypeisFlashEff2.SWAP_TYPE_HIDEorFlashEff2.SWAP_TYPE_HIDE_AND_SHOWandperformashowtransitiononthesecondtextfieldifswapTypeisFlashEff2.SWAP_TYPE_SHOWorFlashEff2.SWAP_TYPE_HIDE_AND_SHOW.Thedefaultvalueisfalse.ExampleThenextexampleappliesashowtransitionbasedontheAlphapattern(FETAlpha)toatextfieldcalledmyTextField1andthenswapsthetextfieldwithanotheronecalledmyTextField2.TheswapoperationhidesthefirsttextfieldusingtheBlurpattern(FETBlur)andthendisplaysthesecondtextfieldatthesametimewiththeAlphapattern.Placetwodynamictextfieldsonthestage,enterthe"Thisisthefirsttextfield"textintooneofthemand"Thisisthesecondtextfield"textintoheotherandgivetheminstancenamesofmyTextField1forthefirsttextfieldandmyTextField2forthesecondone.Changetheanti‐aliassettingto"Anti‐aliasforanimation",enablethe"RendertextasHTML"optionandembedthecharactersusingtheAutoFilloptionintheEmbedcharactersdialogboxforbothtextfields.Next,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFETAlphaandFETBlurpatternsintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:import com.jumpeye.flashEff2.text.alpha.FETAlpha; import com.jumpeye.flashEff2.text.blur.FETBlur; var showPattern1:FETAlpha = new FETAlpha(); var showPattern2:FETAlpha = new FETAlpha(); var hidePattern:FETBlur = new FETBlur(); var myEffect:FlashEff2Code = new FlashEff2Code(); myEffect.targetVisibility = false; myEffect.showTransition = showPattern1; myEffect.hideTransition = hidePattern; myEffect.useSwapInsteadHide = true; myEffect.swapType = FlashEff2.SWAP_TYPE_HIDE_AND_SHOW; myEffect.swapTransition = showPattern2; myEffect.swapDelay = 0; myEffect.swapTargetVisibility = false; this.addChild(myEffect); myEffect.swapTargetInstanceName = "myTextField2";

Page 33: ActionScript3.0 Usage

33

myEffect._targetInstanceName = "myTextField1";

xmlPath String

YesThepathandnameofthe.xmlfileusedtosetupthecurrentFlashEff2Codeinstance.Ifsuchafileisdefinedandsettothecomponentinstance,thenwhenthecomponentinitializes,thesettingsfromthe.xmlfilewilloverrideanyothersettingsdonethroughtheFlashEff2panelorthroughActionScriptcode(ifthoseweremadebeforesettingthexmlPathproperty).Examplevar myEffect:FlashEff2Code = new FlashEff2Code(); this.addChild(myEffect); myEffect.xmlPath = "files/config/xml/setup.xml";

Methods

Method Description

addCommand Addsanewcommandpatterntothetargetobject.Thenewcommandwillbeexecutedontheeventspecifiedasargument.Parameterscommand:IFlashEffCommand—Thereferencetothecommandpatterncreatedbycode.eventType:String—Theeventonwhichtheselectedcommandwillbeexecuted.PossiblevaluesarerollOver,rollOut,pressandrelease.ReturnsIFlashEffCommand—Areferencetothenewlycreatedcommandpattern.ExampleThisexamplelistsallthecommandsappliedtothetargetobject,inthiscase,asinglenavigateToURLcommand(FECNavigateToURL).CreateamoviecliponthestageandgiveitaninstancenameofmyClip.Next,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFECNavigateToURLpatternintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:import com.jumpeye.flashEff2.command.navigateToURL.FECNavigateToURL; var myPattern:FECNavigateToURL = new FECNavigateToURL(); myPattern.url = "http://www.flasheff.com/";

Page 34: ActionScript3.0 Usage

34

var myEffect:FlashEff2Code = new FlashEff2Code(); myEffect.addCommand(myPattern, "release"); this.addChild(myEffect); myEffect._targetInstanceName = "myClip"; for(var i:int = 0; i < myEffect.commands.length; i++) trace(i+" :: "+myEffect.commands[i]); // 0 :: [object FECNavigateToURL]

addCommandByName Addsanewcommandpatterntothetargetobject.Thenewcommandwillbeexecutedontheeventspecifiedasargument.ParameterscommandName:String—Thefullpathofthecommandpatternclassaddedtothetargetobject.eventType:String—Theeventonwhichtheselectedcommandwillbeexecuted.PossiblevaluesarerollOver,rollOut,pressandrelease.initObj:Object(default=null)—Anobjectusedtoinitializethecommandpattern.ReturnsIFlashEffCommand—Areferencetothenewlycreatedcommandpattern.ExampleThisexamplelistsallthecommandsappliedtothetargetobject,inthiscase,asinglenavigateToURLcommand(FECNavigateToURL).CreateamoviecliponthestageandgiveitaninstancenameofmyClip.Next,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFECNavigateToURLpatternintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:var myEffect:FlashEff2Code = new FlashEff2Code(); var initObj:Object = new Object(); initObj.url = "http://www.flasheff.com/"; myEffect.addCommandByName("com.jumpeye.flashEff2.command.navigateToURL.FECNavigateToURL", "release", initObj); this.addChild(myEffect); myEffect._targetInstanceName = "myClip"; for(var i:int = 0; i < myEffect.commands.length; i++) trace(i+" :: "+myEffect.commands[i]); // 0 :: [object FECNavigateToURL]

addFilter Addsanewfilterpatterntotargetsymbolortextfield.Parametersfilter:IFlashEffFilter—Thereferencetothefilterpattern,createdseparatelybycode.ExampleThisexamplelistsallthefiltersappliedtothetargetobject,inthiscase,asinglereflectionfilter(FEFReflection).CreateamoviecliponthestageandgiveitaninstancenameofmyClip.Next,fromtheComponentspaneldragtheFlashEff2Codecomponentandthe

Page 35: ActionScript3.0 Usage

35

FEFReflectionpatternintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:import com.jumpeye.flashEff2.filter.reflection.FEFReflection; var myPattern:FEFReflection = new FEFReflection(); var myEffect:FlashEff2Code = new FlashEff2Code(); myEffect.addFilter(myPattern); this.addChild(myEffect); myEffect._targetInstanceName = "myClip"; for(var i:int = 0; i < myEffect.filterList.length; i++) trace(i+" :: "+myEffect.filterList[i]); // 0 :: [object FEFReflection]

addFilterByName AddsanewFilterpatterntotargetsymbolortext.ParametersfilterName:String—Thefullpackageandclassnameofthefilterthatwillbeapplied.initObject:Object(default=null)—[optional]Anobjectusedtosetupthenewfilter.ReturnsIFlashEffFilter—Areferencetothenewlycreatedfilterpattern.ExampleThisexamplelistsallthefiltersappliedtothetargetobject,inthiscase,asinglereflectionfilter(FEFReflection).CreateamoviecliponthestageandgiveitaninstancenameofmyClip.Next,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFEFReflectionpatternintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:var myEffect:FlashEff2Code = new FlashEff2Code(); var initObj:Object = new Object(); initObj.reflectionDistance = 0; myEffect.addFilterByName("com.jumpeye.flashEff2.filter.reflection.FEFReflection", initObj); this.addChild(myEffect); myEffect._targetInstanceName = "myClip"; for(var i:int = 0; i < myEffect.filterList.length; i++) trace(i+" :: "+myEffect.filterList[i]); // 0 :: [object FEFReflection]

applyButtonEffect ReappliestheButtonEffectpatterntothetargetobject,afterithasbeenremovedwiththeremoveButtonEffect()method.

buttonPress Manuallyappliesthemousepressstatetothetargetobject,withoutthemousepressaction,anddispatchestheFLASHEFFEvents.MOUSE_DOWNevent.Thisisusefulwhenthecomponentshouldvisuallychangethestateofthetargetobjectbutnotasaresultofmouseinteraction.

buttonRelease Manuallyappliesthemousereleasestatetothetargetobject,withoutthemousereleaseaction,anddispatchestheFLASHEFFEvents.MOUSE_UP

Page 36: ActionScript3.0 Usage

36

event.Thisisusefulwhenthecomponentshouldvisuallychangethestateofthetargetobjectbutnotasaresultofmouseinteraction.

buttonRollOut Manuallyappliestherolloutstatetothetargetobject,withoutthemousemovingoutofit,anddispatchestheFLASHEFFEvents.ROLL_OUTevent.Thisisusefulwhenthecomponentshouldvisuallychangethestateofthetargetobjectbutnotasaresultofmouseinteraction.

buttonRollOver Manuallyappliestherolloverstatetothetargetobject,withoutthemousegettingoverit,anddispatchestheFLASHEFFEvents.ROLL_OVERevent.Thisisusefulwhenthecomponentshouldvisuallychangethestateofthetargetobjectbutnotasaresultofmouseinteraction.

changeTarget ChangesthetargetoftheFlashEff2Codeinstancebyapplyingahidefirstonthelastvisibletarget,thenitshowsthenewTargetobjectwiththeselectedshowpattern.ThemethoddoessuppressautoPlayandwillcountthedelays.ParametersnewTarget:DisplayObjectTheobjecttobeusedinsteadthecurrenttarget.ExamplemyEffect.changeTarget(myNewTarget);

dispatchEvent DispatchesaFLASHEFFEventtypeofevent.Parametersev:Event—Theeventobjectdispatchedasparameter.ThisobjecthasatypewhichusuallyisoneofthetypesdescribedintheFLASHEFFEventclassandadditionalinformationabouttheeventthatisbeingdispatched.ReturnsBoolean—Avalueoftrueiftheeventwassuccessfullydispatched.AvalueoffalseindicatesfailureorthatpreventDefault()wascalledontheevent.

getFilter Returnsareferencetothefilterpatternspecifiedintheargument.ParametersfilterName:String—Thefullpackageandclassnameofthefilterpatternthatshouldbereturned.ReturnsIFlashEffFilter—Areferencetothedesiredfilterpatternorthevaluenullifitwasnotfoundamongthefilterpatternsappliedtothetargetobject.ExampleThisexampleaddsafiltertoaclip(symbol)calledmyClipandliststhefilterbyusingtheappropriatemethods.CreateamoviecliponthestageandgiveitaninstancenameofmyClip.Next,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFEFReflectionpatternintotheLibrary.BringuptheActionspanelandpastethe

Page 37: ActionScript3.0 Usage

37

followingcodeintoit:var myEffect:FlashEff2Code = new FlashEff2Code(); var initObj:Object = new Object(); initObj.reflectionDistance = 0; myEffect.addFilterByName("com.jumpeye.flashEff2.filter.reflection.FEFReflection", initObj); this.addChild(myEffect); myEffect._targetInstanceName = "myClip"; trace(myEffect.getFilter("com.jumpeye.flashEff2.filter.reflection.FEFReflection")); // [object FEFReflection] trace(myEffect.getFilterAt(0)); // [object FEFReflection]

getFilterAt Returnsthefilterpatternthatexistsatthespecifiedindex.Parametersindex:uint—Theindexwhichthetargetfilterpatternhasinthelistoffiltersappliedtothetargetsymbolortext.ReturnsIFlashEffFilter—Thefilterpatternthatislocatedatthespecifiedindex.ExampleThisexampleaddsafiltertoaclip(symbol)calledmyClipandliststhefilterbyusingtheappropriatemethods.CreateamoviecliponthestageandgiveitaninstancenameofmyClip.Next,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFEFReflectionpatternintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:var myEffect:FlashEff2Code = new FlashEff2Code(); var initObj:Object = new Object(); initObj.reflectionDistance = 0; myEffect.addFilterByName("com.jumpeye.flashEff2.filter.reflection.FEFReflection", initObj); this.addChild(myEffect); myEffect._targetInstanceName = "myClip"; trace(myEffect.getFilter("com.jumpeye.flashEff2.filter.reflection.FEFReflection")); // [object FEFReflection] trace(myEffect.getFilterAt(0)); // [object FEFReflection]

getNumGroupButtons Returnsthenumberofgroupbuttons(targetdisplayobjectswithbuttoneffects)thathavethegroupnameofthecurrentFlashEff2Codeinstance.Returnsuint‐Thenumberofgroupbuttonsinthecurrentbuttongroup.Example

Page 38: ActionScript3.0 Usage

38

ThenextexamplewillcreateagroupofradiobuttonsusingFlashEff2.Createamoviecliponthestagethatwillbeusedasbuttonandduplicateit.Giveeachoneaninstancename:"button1"and"button2".Next,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFEBEffectpatternintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:import com.jumpeye.flashEff2.buttonEffect.FEBEffect; var overState:XML = <value> <tweenDuration> <type>Number</type> <value>1</value> <defaultValue>1</defaultValue> </tweenDuration> <tweenType> <type>String</type> <value>Strong</value> <defaultValue>Strong</defaultValue> </tweenType> <easeType> <type>String</type> <value>easeOut</value> <defaultValue>easeOut</defaultValue> </easeType> <blurFilter> <type>Object</type> <value/> </blurFilter> <glowFilter> <type>Object</type> <value> <color hasCheck="false"> <type>uint</type> <value>26367</value> <defaultValue>14492194</defaultValue> </color> <alpha hasCheck="false"> <type>Number</type> <value>1</value> <defaultValue>1</defaultValue> </alpha> <blurX hasCheck="false"> <type>Number</type> <value>12</value> <defaultValue>10</defaultValue> </blurX> <blurY hasCheck="false"> <type>Number</type> <value>12</value> <defaultValue>10</defaultValue> </blurY> <strength hasCheck="false"> <type>Number</type> <value>2</value> <defaultValue>2</defaultValue> </strength> <quality hasCheck="false"> <type>Number</type> <value>2</value> <defaultValue>2</defaultValue> </quality> <inner hasCheck="false"> <type>Boolean</type> <value>false</value> <defaultValue>false</defaultValue> </inner> <knockout hasCheck="false"> <type>Boolean</type> <value>false</value> <defaultValue>false</defaultValue> </knockout> </value>

Page 39: ActionScript3.0 Usage

39

</glowFilter> </value>; var selectedUpState:XML = <value> <blurFilter> <type>Object</type> <value/> </blurFilter> <glowFilter> <type>Object</type> <value> <color hasCheck="false"> <type>uint</type> <value>52224</value> </color> <alpha hasCheck="false"> <type>Number</type> <value>1</value> </alpha> <blurX hasCheck="false"> <type>Number</type> <value>12</value> </blurX> <blurY hasCheck="false"> <type>Number</type> <value>12</value> </blurY> <quality hasCheck="false"> <type>Number</type> <value>2</value> </quality> <inner hasCheck="false"> <type>Boolean</type> <value>false</value> </inner> <knockout hasCheck="false"> <type>Boolean</type> <value>false</value> </knockout> <strength hasCheck="false"> <type>Number</type> <value>2</value> </strength> </value> </glowFilter> <tweenDuration> <type>Number</type> <value>0.3</value> <defaultValue>0.3</defaultValue> </tweenDuration> <tweenType> <type>String</type> <value>Quadratic</value> <defaultValue>Quadratic</defaultValue> </tweenType> <easeType> <type>String</type> <value>easeOut</value> <defaultValue>easeOut</defaultValue> </easeType> </value>; // Create the button effect for the first // movie clip (button1). var btn1:FEBEffect = new FEBEffect(); btn1.overState = overState; btn1.selectedUpState = selectedUpState; // Create the button effect for the second // movie clip (button2). var btn2:FEBEffect = new FEBEffect(); btn2.overState = overState; btn2.selectedUpState = selectedUpState;

Page 40: ActionScript3.0 Usage

40

// Create the first FlashEff2 instance and // add it to the display list. var effect1:FlashEff2Code = new FlashEff2Code(); effect1.useHandCursor = true; effect1.groupName = "myGroup"; effect1.buttonEffect = btn1; addChild(effect1); // Create the second FlashEff2 instance and // add it to the display list. var effect2:FlashEff2Code = new FlashEff2Code(); effect2.useHandCursor = true; effect2.groupName = "myGroup"; effect2.buttonEffect = btn2; addChild(effect2); // Apply the two FlashEff2 instances to the // two movie clips. effect1._targetInstanceName = "button1"; effect2._targetInstanceName = "button2"; trace("Number of grouped buttons: "+effect1.getNumGroupButtons()); // Number of grouped buttons: 2

hide Hidesthetargetobjectusingthepatterncurrentlyappliedtothetargetobject(symbolortextfield).IftheFlashEff2Codeinstancedoesnothaveasymbolortextpatternapplied,itwillnotexecuteanything.ExampleThenextexampleappliesahidetransitionbasedontheAlphapattern(FESAlpha),toaclip(symbol)calledmyClip.ThehidetransitionwillnotexecuteautomaticallysincethehideAutoPlaypropertyissettofalse,butitwillexecuteonmouseclickoverthetargetclip.Createamoviecliponthestage,giveitaninstancenameofmyClipandalsoplaceabuttononthestageandnameitbuttonInstance.Next,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFESAlphapatternintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:import com.jumpeye.flashEff2.symbol.alpha.FESAlpha; var myPattern:FESAlpha = new FESAlpha(); var myEffect:FlashEff2Code = new FlashEff2Code(); myEffect.hideTransition = myPattern; myEffect.hideDelay = 0; myEffect.hideAutoPlay = false; this.addChild(myEffect); myEffect._targetInstanceName = "myClip"; buttonInstance.addEventListener(MouseEvent.CLICK, clikHandler); function clikHandler(evt:MouseEvent):void { myEffect.hide(); }

Page 41: ActionScript3.0 Usage

41

removeAll Removesalltheshow/hideeffects,filters,commandsandbuttoneffectsaddedthroughtheFlashEff2Codecomponentinstance,tothetargetobject(symbolortextfield),cancelinganyfunctionalityprovidedbythem.ThismethodwillnotremovetheFlashEff2Codeinstance.ToremovetheFlashEff2Codeinstancetoo,you'llneedtoremoveitfromthedisplaylist.

removeAllCommands Removesallthecommandpatternsappliedtothetargetobject.ExampleThisexampleaddsthenavigateToURLcommandtoaclip,onboth,themousepressandmousereleaseactionsanddisplaysthelistofcommands.Whenabuttonispressed,thecommandsareremoved.Createamoviecliponthestage,giveitaninstancenameofmyClipandalsoplaceabuttononthestageandnameitbuttonInstance.Next,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFECNavigateToURLpatternintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:import com.jumpeye.flashEff2.command.navigateToURL.FECNavigateToURL; var myPattern1:FECNavigateToURL = new FECNavigateToURL(); myPattern1.url = "http://www.flasheff.com/"; var myPattern2:FECNavigateToURL = new FECNavigateToURL(); myPattern2.url = "http://www.jumpeyecomponents.com/"; var myEffect:FlashEff2Code = new FlashEff2Code(); myEffect.addCommand(myPattern1, "press"); myEffect.addCommand(myPattern2, "release"); this.addChild(myEffect); myEffect._targetInstanceName = "myClip"; trace(myEffect.commands.length+" commands applied to the target object"); for(var i:int = 0; i < myEffect.commands.length; i++) trace(i+" :: "+myEffect.commands[i]); /* output: 2 commands applied to the target object 0 :: [object FECNavigateToURL] 1 :: [object FECNavigateToURL] */ buttonInstance.addEventListener(MouseEvent.CLICK, clikHandler); function clikHandler(evt:MouseEvent):void { myEffect.removeAllCommands(); trace(myEffect.commands.length+" commands applied to the target object"); for(var i:int = 0; i < myEffect.commands.length; i++) trace(i+" :: "+myEffect.commands[i]); /* output: 0 commands applied to the target object */ }

Page 42: ActionScript3.0 Usage

42

removeAllCommandsByEventType Removesallthecommandpatternsfromthetargetobject,thatareexecutedonaspecifiedevent.ParameterseventType:String—Thetypeofeventforwhichallthecommandpatternswillberemoved.PossiblevaluesarerollOver,rollOut,pressandrelease.ExampleThisexampleaddsthenavigateToURLcommandtoaclip,onboththemousepressandmousereleaseactionsanddisplaysthelistofcommands.Whenabuttonispressed,thecommandaddedforthemousepresseventisremoved.Createamoviecliponthestage,giveitaninstancenameofmyClipandalsoplaceabuttononthestageandnameitbuttonInstance.Next,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFECNavigateToURLpatternintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:import com.jumpeye.flashEff2.command.navigateToURL.FECNavigateToURL; var myPattern1:FECNavigateToURL = new FECNavigateToURL(); myPattern1.url = "http://www.flasheff.com/"; var myPattern2:FECNavigateToURL = new FECNavigateToURL(); myPattern2.url = "http://www.jumpeyecomponents.com/"; var myEffect:FlashEff2Code = new FlashEff2Code(); myEffect.addCommand(myPattern1, "press"); myEffect.addCommand(myPattern2, "release"); this.addChild(myEffect); myEffect._targetInstanceName = "myClip"; trace(myEffect.commands.length+" commands applied to the target object"); for(var i:int = 0; i < myEffect.commands.length; i++) trace(i+" :: "+myEffect.commands[i]); /* output: 2 commands applied to the target object 0 :: [object FECNavigateToURL] 1 :: [object FECNavigateToURL] */ buttonInstance.addEventListener(MouseEvent.CLICK, clikHandler); function clikHandler(evt:MouseEvent):void { myEffect.removeAllCommandsByEventType("press"); trace(myEffect.commands.length+" commands applied to the target object"); for(var i:int = 0; i < myEffect.commands.length; i++) trace(i+" :: "+myEffect.commands[i]); /* output: 1 commands applied to the target object 0 :: [object FECNavigateToURL] */ }

Page 43: ActionScript3.0 Usage

43

removeAllFilters RemovesallthefilterpatternsappliedonthecurrentFlashEff2Codecomponentinstance,visuallyremovingthemfromthetargetsymbolortext,butleavingalltheothertypesofpatterns.

removeButtonEffect RemovesthecurrentButtonEffectpatternappliedtothetargetobject.

removeCommand Removesthespecifiedcommandpatterninstancefromthetargetobject.Parameterscommand:IFlashEffCommand—Thepatterninstancethatshouldberemoved.ExampleThisexampleaddsanavigateToURLandagoToFramecommandtoaclip,onthemousepressactionanddisplaysthelistofcommands.Whenabuttonispressed,thegoToFramecommandisremoved.Createamoviecliponthestage,giveitaninstancenameofmyClipandalsoplaceabuttononthestageandnameitbuttonInstance.Next,fromtheComponentspaneldragtheFlashEff2Codecomponent,theFECNavigateToURLandtheFECGoToFramepatternsintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:import com.jumpeye.flashEff2.command.navigateToURL.FECNavigateToURL; import com.jumpeye.flashEff2.command.goToFrame.FECGoToFrame; var myPattern1:FECNavigateToURL = new FECNavigateToURL(); myPattern1.url = "http://www.flasheff.com/"; var myPattern2:FECGoToFrame = new FECGoToFrame(); myPattern2.frame = "10"; var myEffect:FlashEff2Code = new FlashEff2Code(); myEffect.addCommand(myPattern1, "release"); myEffect.addCommand(myPattern2, "release"); this.addChild(myEffect); myEffect._targetInstanceName = "myClip"; trace(myEffect.commands.length+" commands applied to the target object"); for(var i:int = 0; i < myEffect.commands.length; i++) trace(i+" :: "+myEffect.commands[i]); /* output: 2 commands applied to the target object 0 :: [object FECNavigateToURL] 1 :: [object FECGoToFrame] */ buttonInstance.addEventListener(MouseEvent.CLICK, clikHandler); function clikHandler(evt:MouseEvent):void { myEffect.removeCommand(myPattern2); trace(myEffect.commands.length+" commands applied to the target object"); for(var i:int = 0; i < myEffect.commands.length;

Page 44: ActionScript3.0 Usage

44

i++) trace(i+" :: "+myEffect.commands[i]); /* output: 1 commands applied to the target object 0 :: [object FECNavigateToURL] */ }

removeCommandByName Removesfromthetargetobjectthecommandpatternidentifiedbyitsfullpathandclassname.ParameterscommandName:String—Thefullpathandclassnameofthecommandpatterntoberemoved.ExampleThisexampleaddsanavigateToURLandagoToFramecommandtoaclip,onthemousepressactionanddisplaysthelistofcommands.Whenabuttonispressed,thegoToFramecommandisremoved.Createamoviecliponthestage,giveitaninstancenameofmyClipandalsoplaceabuttononthestageandnameitbuttonInstance.Next,fromtheComponentspaneldragtheFlashEff2Codecomponent,theFECNavigateToURLandtheFECGoToFramepatternsintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:import com.jumpeye.flashEff2.command.navigateToURL.FECNavigateToURL; import com.jumpeye.flashEff2.command.goToFrame.FECGoToFrame; var myPattern1:FECNavigateToURL = new FECNavigateToURL(); myPattern1.url = "http://www.flasheff.com/"; var myPattern2:FECGoToFrame = new FECGoToFrame(); myPattern2.frame = "10"; var myEffect:FlashEff2Code = new FlashEff2Code(); myEffect.addCommand(myPattern1, "release"); myEffect.addCommand(myPattern2, "release"); this.addChild(myEffect); myEffect._targetInstanceName = "myClip"; trace(myEffect.commands.length+" commands applied to the target object"); for(var i:int = 0; i < myEffect.commands.length; i++) trace(i+" :: "+myEffect.commands[i]); /* output: 2 commands applied to the target object 0 :: [object FECNavigateToURL] 1 :: [object FECGoToFrame] */ buttonInstance.addEventListener(MouseEvent.CLICK, clikHandler); function clikHandler(evt:MouseEvent):void { myEffect.removeCommandByName("com.jumpeye.flashEff2.command.goToFrame.FECGoToFrame"); trace(myEffect.commands.length+" commands

Page 45: ActionScript3.0 Usage

45

applied to the target object"); for(var i:int = 0; i < myEffect.commands.length; i++) trace(i+" :: "+myEffect.commands[i]); /* output: 1 commands applied to the target object 0 :: [object FECNavigateToURL] */ }

removeEffect Stopsandremovesaneffectappliedtothetargetobject,whilethateffectisstillplaying.Thisfunctionwillnothaveanyeffectifit'sappliedbeforetheeffectstartsoraftertheeffecthasfinished(exceptwhenisTargetVisibleAtEndissettotrueandthetransitiontypewashide).DependingonthevalueoftheinternalCallargument,itcantriggeraFLASHEFFEvents.TRANSITION_ENDeventornot.Ifthemethodwascalledfromwithinaninternalclassorapatternobject,thisparametershouldbetrueandtheeventwillnottrigger.IfthemethodwascalledfromoutsidetheFlashEff2classoroutsidethepatterns,thentheparameter'svalueshouldbefalse(thedefaultvalue)andtheFLASHEFFEvents.TRANSITION_ENDeventwillbetriggered.Thisalsohasthepossibilitytoremoveaspecificsymbolortextpatternfromthetargetobject,byspecifyingasecondargument.Ifthatpatternargumentisnotspecified,themethodremovesthecurrentsymbolortextpatternthatisbeingapplied(whilethetransitionisgoingon).Inthecaseofahidetransition,eitheronasymboloratextobject,thetargetobjectwillberenderedinvisibleintheend,bythetransition.IfremoveEffect()iscalledafterthetransitionhasfinished,thetargetobjectwillbedisplayedonlyiftheisTargetVisibleAtEndissettotrue,otherwisethetargetobjectwillremainhidden(themethodhasnoeffect).ParametersinternalCall:Boolean(default=false)—[optional]InstructsthemethodtodispatchaFLASHEFFEvents.TRANSITION_ENDevent,ifthevalueisfalse,thatisifthemethodisnotcalledfrominsideapatternobject.pattern:IFlashEffSymbolText (default=null)—Thesymbolortextpatternthatshouldberemovedfromthelistofpatternsappliedtothetargetobject.Thattypeofpatternisashow/hidepattern,meaningthatitcanonlyapplyshoworhidetransitionsonsymbolsortextfields.ExampleThenextexampleappliesahidetransitionbasedontheAlphapattern(FETAlpha),onatextfieldcalledmyTextField.Thehidetransitionwillbeexecutedautomatically,withadelayofasecond.Bypressingthebuttononthestage,theremoveEffect()methodwillbecalled.Inbothcases(buttonpressedduringandafterthetransition),aFLASHEFFEvents.TRANSITION_ENDeventwillbedispatched.Placeadynamictextfieldonthestage,enterthetext"Thequickbrownfoxjumpsoverthelazydog"intoitandgiveitaninstancenameofmyTextField.Settheanti‐aliassettingto"Anti‐aliasforanimation",enablethe"RendertextasHTML"optionandembedthecharactersusingtheAutoFilloptionintheEmbedcharactersdialogbox.AlsoplaceaButtononthestageandgiveitaninstancenameofbuttonInstance.Next,fromtheComponentspaneldragthe

Page 46: ActionScript3.0 Usage

46

FlashEff2CodecomponentandtheFETAlphapatternintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:import com.jumpeye.flashEff2.text.alpha.FETAlpha; import com.jumpeye.Events.FLASHEFFEvents; var myPattern:FETAlpha = new FETAlpha(); var myEffect:FlashEff2Code = new FlashEff2Code(); myEffect.hideTransition = myPattern; myEffect.hideDelay = 1; myEffect.isTargetVisibleAtEnd = true; this.addChild(myEffect); myEffect._targetInstanceName = "myTextField"; buttonInstance.addEventListener(MouseEvent.CLICK, clikHandler); function clikHandler(evt:MouseEvent):void { myEffect.removeEffect(); } myEffect.addEventListener(FLASHEFFEvents.TRANSITION_END, transitionEndHandler); function transitionEndHandler(evtObj:FLASHEFFEvents):void { trace("The transition has ended."); }

removeFilter Removesaspecifiedfilterfromthetargetsymbolortext.ItreturnsaBooleanvalue(true)ifit’ssuccessful.Parametersfilter:IFlashEffFilter—Thereferencetothefilterpatterncreatedseparately,bycode.

removeFromGroupList Removesoneofthetargetobjectsusedasgroupedbuttonfromthegroupitispartof.Parameterstarget:DisplayObject‐Thetargetdisplayobjectwithabuttoneffectapplied.Ifthebuttonispartofagroup,itwillberemovedfromthatgroup.ThenameofthegroupisspecifiedontheFlashEff2instanceappliedonthetargetdisplayobject.

removeHideTransition Removesthelastsymbolortextpatternusedforthehidetransition.

removeShowTransition Removesthelastsymbolortextpatternusedfortheshowtransition.

setXML Allowssettingupthecomponentaccordingtoxmldatapassedasparameter.Parametersxml:*—TheXMLobjectthatcontainssetupinformationfortheFlashEff2Codecomponentinstance.ItcanbeeitheroftypeXML,aXMLobjectcreatedbycode,oroftypeString,thesamexmldatapassedasStringargument.

Page 47: ActionScript3.0 Usage

47

show Appliesashowtransitiontothetargetobject,ifasymbolortextpatternhasbeenappliedtoit.IftheFlashEff2objectdoesnothaveasymbolortextpatternapplied,itwillnotexecuteanyactions.ParametersforceAutoHide:*(default=null)—[optional]Iftrue,theshowmethodwillexecuteashowtransitionandthen,forceFlashEff2toexecuteahidetransitionafterthetimeintervalspecifiedathideDelay,evenifhideAutoPlayissettofalse.Otherwise,onlytheshowtransitionwillbeexecuted.ExampleThenextexampleappliesashowtransitionbasedontheAlphapattern(FESAlpha),toaclip(symbol)calledmyClip.TheshowtransitionwillnotexecuteautomaticallysincetheshowAutoPlaypropertyissettofalse,butitwillexecuteonmouseclickoverthetargetclip.CreateamoviecliponthestageandgiveitaninstancenameofmyClip.Next,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFESAlphapatternintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:import com.jumpeye.flashEff2.symbol.alpha.FESAlpha; var myPattern:FESAlpha = new FESAlpha(); var myEffect:FlashEff2Code = new FlashEff2Code(); myEffect.showTransition = myPattern; myEffect.showDelay = 0; myEffect.showAutoPlay = false; this.addChild(myEffect); myEffect._targetInstanceName = "myClip"; myClip.addEventListener(MouseEvent.CLICK, clikHandler); function clikHandler(evt:MouseEvent):void { myEffect.show(); }

swap Appliestheswaptransitionbetweentwotargetobjects.ThefirsttargetobjectistheonethatiscurrentlyvisibleandwillbehiddenwithahidetransitionifswapTypeisFlashEff2.SWAP_TYPE_HIDEorFlashEff2.SWAP_TYPE_HIDE_AND_SHOW.Thesecondtargetobjectistheonethatwillbemadevisibleafterthetransition,usingashowtransition,ifswapTypeisFlashEff2.SWAP_TYPE_SHOWorFlashEff2.SWAP_TYPE_HIDE_AND_SHOW.ParametersnewTarget:DisplayObject(default=null)—Thesecondtargetobjectthatwillreplacethecurrenttargetobject.Ifthisisnull,thentheobjectspecifiedatswapTargetwillbeused.swType:String(default="")—Thetypeofswaptransitionapplied.IfitisablankString(""),thenthetransitiontypewillbetheonespecifiedatswapType.Example

Page 48: ActionScript3.0 Usage

48

Thenextexampleusestheswap()methodtoapplyaswaptransitionbetweentwotextfields,bypressingonabutton.TheexampleappliesashowtransitionbasedontheAlphapattern(FETAlpha)toatextfieldcalledmyTextField1andthenswapsthetextfieldwithanotheronecalledmyTextField2.TheswapoperationhidesthefirsttextfieldusingtheBlurpattern(FETBlur)andthendisplaysthesecondtextfieldatthesametimewiththeAlphapattern.Placetwodynamictextfieldsonthestage,enterthe"Thisisthefirsttextfield"textintooneofthemand"Thisisthesecondtextfield"textintoheotherandgivetheminstancenamesofmyTextField1forthefirsttextfieldandmyTextField2forthesecondone.Changetheanti‐aliassettingto"Anti‐aliasforanimation",enablethe"RendertextasHTML"optionandembedthecharactersusingtheAutoFilloptionintheEmbedcharactersdialogboxforbothtextfields.Next,placeabuttonontheStageandgiveittheinstancenameofswapButton.Finally,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFETAlphaandFETBlurpatternsintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:import com.jumpeye.flashEff2.text.alpha.FETAlpha; import com.jumpeye.flashEff2.text.blur.FETBlur; myTextField2.visible = false; var showPattern1:FETAlpha = new FETAlpha(); var showPattern2:FETAlpha = new FETAlpha(); var hidePattern:FETBlur = new FETBlur(); var myEffect:FlashEff2Code = new FlashEff2Code(); myEffect.targetVisibility = false; myEffect.showTransition = showPattern1; myEffect.hideTransition = hidePattern; this.addChild(myEffect); myEffect.swapTargetInstanceName = "myTextField2"; myEffect._targetInstanceName = "myTextField1"; this.addChild(myEffect); myEffect._targetInstanceName = "myTextField1"; swapButton.addEventListener(MouseEvent.CLICK, makeSwap); function makeSwap(evtObj:MouseEvent):void { myEffect.swap(myTextField2, FlashEff2.SWAP_TYPE_HIDE_AND_SHOW); }

transitionEffect Startsashoworhideeffect,accordingtotheargument'svalue.Parameterstype:String(default="show")—Thetypeoftransitiontobeexecuted.Possiblevaluesareshowandhide.ExampleThenextexampleappliesashowtransitionbasedontheAlphapattern(FESAlpha),toaclip(symbol)calledmyClip.TheshowtransitionwillnotexecuteautomaticallysincetheshowAutoPlaypropertyissettofalse,butitwillexecuteonmouseclickoverthetargetclip.

Page 49: ActionScript3.0 Usage

49

CreateamoviecliponthestageandgiveitaninstancenameofmyClip.Next,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFESAlphapatternintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:import com.jumpeye.flashEff2.symbol.alpha.FESAlpha; var myPattern:FESAlpha = new FESAlpha(); var myEffect:FlashEff2Code = new FlashEff2Code(); myEffect.showTransition = myPattern; myEffect.showDelay = 0; myEffect.showAutoPlay = false; this.addChild(myEffect); myEffect._targetInstanceName = "myClip"; myClip.addEventListener(MouseEvent.CLICK, clikHandler); function clikHandler(evt:MouseEvent):void { myEffect.transitionEffect("show"); }

Events

Event Description

IOErrorEvent.IO_ERROR DispatchedwhentheFlashEff2Codecomponentinstanceencountersanerrorwhilethe.xmlsetupfileisbeingloaded.ExampleThisexamplesetsuptheFlashEff2Codecomponentinstancefromanexternal.xmlfileanddisplaysanerrormessageifthe.xmlfilecannotberead.CreateamoviecliponthestageandgiveitaninstancenameofmyClip.Next,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFESAlphapatternintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:import flash.events.IOErrorEvent; import com.jumpeye.Events.FLASHEFFEvents; var myEffect:FlashEff2Code = new FlashEff2Code(); this.addChild(myEffect); myEffect.xmlPath = "setup.xml"; myEffect.addEventListener(IOErrorEvent.IO_ERROR, errorHandler); myEffect.addEventListener(FLASHEFFEvents.COMPLETE, completeHandler); function errorHandler(evtObj:IOErrorEvent):void { trace("Could not read the XML data !"); }

Page 50: ActionScript3.0 Usage

50

function completeHandler(evtObj:FLASHEFFEvents):void { trace("XML data loaded completely"); trace(evtObj.data); }

FLASHEFFEvents.COMPLETE DispatchedwhentheFlashEff2Codecomponentinstanceissetupfroma.xmlfileandthefilehasbeencompletelyloaded.TheeventobjectpassedasanargumenttotheeventhandlerfunctionhasapropertycalleddatathatgivesyouaccesstotheXMLobjectusedtosetupthecomponentinstance.ThiseventisdispatchedbeforetheFLASHEFFEvents.INITevent.ExampleThisexamplesetsuptheFlashEff2Codecomponentinstancefromanexternal.xmlfileanddisplaysatextwhenthecomponentfinishedreadingthe.xmlfile.CreateamoviecliponthestageandgiveitaninstancenameofmyClip.Next,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFESAlphapatternintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:import flash.events.IOErrorEvent; import com.jumpeye.Events.FLASHEFFEvents; var myEffect:FlashEff2Code = new FlashEff2Code(); this.addChild(myEffect); myEffect.xmlPath = "setup.xml"; myEffect.addEventListener(IOErrorEvent.IO_ERROR, errorHandler); myEffect.addEventListener(FLASHEFFEvents.COMPLETE, completeHandler); function errorHandler(evtObj:IOErrorEvent):void { trace("Could not read the XML data !"); } function completeHandler(evtObj:FLASHEFFEvents):void { trace("XML data loaded completely"); trace(evtObj.data); }

FLASHEFFEvents.INIT DispatchedwhentheFlashEff2Codecomponentcompletestheinitializationprocess.ThiseventisdispatchedaftertheFLASHEFFEvents.COMPLETEevent.ExampleThisexamplesetsuptheFlashEff2Codecomponentinstancefromanexternal.xmlfileanddisplaysatracedmessagewhenthecomponentfinishedinitializing.CreateamoviecliponthestageandgiveitaninstancenameofmyClip.Next,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFESAlphapatternintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:

Page 51: ActionScript3.0 Usage

51

import com.jumpeye.Events.FLASHEFFEvents; var myEffect:FlashEff2Code = new FlashEff2Code(); this.addChild(myEffect); myEffect.xmlPath = "setup.xml"; myEffect.addEventListener(FLASHEFFEvents.INIT, initHandler); function initHandler(evtObj:FLASHEFFEvents):void { trace(evtObj.target+" finished initializing."); }

FLASHEFFEvents.DOUBLE_CLICK DispatchedbytheFlashEff2Codecomponentwhenthetargetobjecthasbeenclickedtwice(doubleclickaction).ExampleThenextexampleappliesashowtransitionbasedontheAlphapattern(FESAlpha),toaclip(symbol)calledmyClip.Theshowtransitionwillbeexecutedwitha2seconddelayandtheFlashEff2Codecomponentinstancewilldispatchthemouseeventsexecutedonthetargetclip.CreateamoviecliponthestageandgiveitaninstancenameofmyClip.Next,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFESAlphapatternintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:import com.jumpeye.Events.FLASHEFFEvents; import com.jumpeye.flashEff2.symbol.alpha.FESAlpha; var myPattern:FESAlpha = new FESAlpha(); var myEffect:FlashEff2Code = new FlashEff2Code(); myEffect.showTransition = myPattern; myEffect.showDelay = 2; this.addChild(myEffect); myEffect._targetInstanceName = "myClip"; myEffect.addEventListener(FLASHEFFEvents.DOUBLE_CLICK, dblClickHandler); function dblClickHandler(evtObj:FLASHEFFEvents):void { trace("DOUBLE CLICK on target object"); }

FLASHEFFEvents.MOUSE_DOWN DispatchedbytheFlashEff2Codecomponentwhenamousebuttonhasbeenpressedonthetargetobject.ExampleThenextexampleappliesashowtransitionbasedontheAlphapattern(FESAlpha),toaclip(symbol)calledmyClip.Theshowtransitionwillbeexecutedwitha2seconddelayandtheFlashEff2Codecomponentinstancewilldispatchthemouseeventsexecutedonthetargetclip.CreateamoviecliponthestageandgiveitaninstancenameofmyClip.Next,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFESAlphapatternintotheLibrary.BringuptheActionspanelandpastethe

Page 52: ActionScript3.0 Usage

52

followingcodeintoit:import com.jumpeye.Events.FLASHEFFEvents; import com.jumpeye.flashEff2.symbol.alpha.FESAlpha; var myPattern:FESAlpha = new FESAlpha(); var myEffect:FlashEff2Code = new FlashEff2Code(); myEffect.showTransition = myPattern; myEffect.showDelay = 2; this.addChild(myEffect); myEffect._targetInstanceName = "myClip"; myEffect.addEventListener(FLASHEFFEvents.MOUSE_DOWN, mouseDownHandler); myEffect.addEventListener(FLASHEFFEvents.MOUSE_UP, mouseUpHandler); function mouseDownHandler(evtObj:FLASHEFFEvents):void { trace("MOUSE DOWN on target object"); } function mouseUpHandler(evtObj:FLASHEFFEvents):void { trace("MOUSE UP on target object"); }

FLASHEFFEvents.MOUSE_UP DispatchedbytheFlashEff2Codecomponentwhenamousebuttonhasbeenreleasedoverthetargetobject,regardlessofwhetherthemousedownactionhashappenedtothetargetobjectoronanotherDisplayObject.ExampleThenextexampleappliesashowtransitionbasedontheAlphapattern(FESAlpha),toaclip(symbol)calledmyClip.Theshowtransitionwillbeexecutedwitha2seconddelayandtheFlashEff2Codecomponentinstancewilldispatchthemouseeventsexecutedonthetargetclip.CreateamoviecliponthestageandgiveitaninstancenameofmyClip.Next,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFESAlphapatternintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:import com.jumpeye.Events.FLASHEFFEvents; import com.jumpeye.flashEff2.symbol.alpha.FESAlpha; var myPattern:FESAlpha = new FESAlpha(); var myEffect:FlashEff2Code = new FlashEff2Code(); myEffect.showTransition = myPattern; myEffect.showDelay = 2; this.addChild(myEffect); myEffect._targetInstanceName = "myClip"; myEffect.addEventListener(FLASHEFFEvents.MOUSE_DOWN, mouseDownHandler); myEffect.addEventListener(FLASHEFFEvents.MOUSE_UP, mouseUpHandler); function mouseDownHandler(evtObj:FLASHEFFEvents):void { trace("MOUSE DOWN on target object");

Page 53: ActionScript3.0 Usage

53

} function mouseUpHandler(evtObj:FLASHEFFEvents):void { trace("MOUSE UP on target object"); }

FLASHEFFEvents.ROLL_OVER DispatchedbytheFlashEff2Codecomponentwhenthemouserollsoverthetargetobject'ssurface.ExampleThenextexampleappliesashowtransitionbasedontheAlphapattern(FESAlpha),toaclip(symbol)calledmyClip.Theshowtransitionwillbeexecutedwitha2seconddelayandtheFlashEff2Codecomponentinstancewilldispatchthemouseeventsexecutedonthetargetclip.CreateamoviecliponthestageandgiveitaninstancenameofmyClip.Next,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFESAlphapatternintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:import com.jumpeye.Events.FLASHEFFEvents; import com.jumpeye.flashEff2.symbol.alpha.FESAlpha; var myPattern:FESAlpha = new FESAlpha(); var myEffect:FlashEff2Code = new FlashEff2Code(); myEffect.showTransition = myPattern; myEffect.showDelay = 2; this.addChild(myEffect); myEffect._targetInstanceName = "myClip"; myEffect.addEventListener(FLASHEFFEvents.ROLL_OVER, rollOverHandler); myEffect.addEventListener(FLASHEFFEvents.ROLL_OUT, rollOutHandler); function rollOverHandler(evtObj:FLASHEFFEvents):void { trace("ROLL OVER on target object"); } function rollOutHandler(evtObj:FLASHEFFEvents):void { trace("ROLL OUT on target object"); }

FLASHEFFEvents.ROLL_OUT DispatchedbytheFlashEff2Codecomponentwhenthemouserollsoutofthetargetobject'ssurface.ExampleThenextexampleappliesashowtransitionbasedontheAlphapattern(FESAlpha),toaclip(symbol)calledmyClip.Theshowtransitionwillbeexecutedwitha2seconddelayandtheFlashEff2Codecomponentinstancewilldispatchthemouseeventsexecutedonthetargetclip.CreateamoviecliponthestageandgiveitaninstancenameofmyClip.Next,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFESAlphapatternintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:

Page 54: ActionScript3.0 Usage

54

import com.jumpeye.Events.FLASHEFFEvents; import com.jumpeye.flashEff2.symbol.alpha.FESAlpha; var myPattern:FESAlpha = new FESAlpha(); var myEffect:FlashEff2Code = new FlashEff2Code(); myEffect.showTransition = myPattern; myEffect.showDelay = 2; this.addChild(myEffect); myEffect._targetInstanceName = "myClip"; myEffect.addEventListener(FLASHEFFEvents.ROLL_OVER, rollOverHandler); myEffect.addEventListener(FLASHEFFEvents.ROLL_OUT, rollOutHandler); function rollOverHandler(evtObj:FLASHEFFEvents):void { trace("ROLL OVER on target object"); } function rollOutHandler(evtObj:FLASHEFFEvents):void { trace("ROLL OUT on target object"); }

FLASHEFFEvents.TRANSITION_END DispatchedbytheFlashEff2Codecomponentwhenthetransitionofasymbolortextpatternhasended.ExampleThenextexampleappliesashowtransitionbasedontheAlphapattern(FESAlpha),toaclip(symbol)calledmyClip.TheFlashEff2Codecomponentinstancewilldispatcheventswhenthetransitionstartsandwhenitends.CreateamoviecliponthestageandgiveitaninstancenameofmyClip.Next,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFESAlphapatternintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:import com.jumpeye.flashEff2.symbol.alpha.FESAlpha; import com.jumpeye.Events.FLASHEFFEvents; var myPattern:FESAlpha = new FESAlpha(); var myEffect:FlashEff2Code = new FlashEff2Code(); myEffect.showTransition = myPattern; this.addChild(myEffect); myEffect._targetInstanceName = "myClip"; myEffect.addEventListener(FLASHEFFEvents.TRANSITION_START, transitionStartHandler); myEffect.addEventListener(FLASHEFFEvents.TRANSITION_END, transitionEndHandler); function transitionStartHandler(evtObj:FLASHEFFEvents):void { trace("The transition has started."); } function transitionEndHandler(evtObj:FLASHEFFEvents):void {

Page 55: ActionScript3.0 Usage

55

trace("The transition has ended."); }

FLASHEFFEvents.TRANSITION_START DispatchedbytheFlashEff2Codecomponentwhenthetransitionofasymbolortextpatternhasstarted.ExampleThenextexampleappliesashowtransitionbasedontheAlphapattern(FESAlpha),toaclip(symbol)calledmyClip.TheFlashEff2Codecomponentinstancewilldispatcheventswhenthetransitionstartsandwhenitends.CreateamoviecliponthestageandgiveitaninstancenameofmyClip.Next,fromtheComponentspaneldragtheFlashEff2CodecomponentandtheFETAlphapatternintotheLibrary.BringuptheActionspanelandpastethefollowingcodeintoit:import com.jumpeye.flashEff2.text.alpha.FETAlpha; import com.jumpeye.Events.FLASHEFFEvents; var myPattern:FETAlpha = new FETAlpha(); var myEffect:FlashEff2Code = new FlashEff2Code(); myEffect.showTransition = myPattern; this.addChild(myEffect); myEffect._targetInstanceName = "myTextField"; myEffect.addEventListener(FLASHEFFEvents.TRANSITION_START, transitionStartHandler); myEffect.addEventListener(FLASHEFFEvents.TRANSITION_END, transitionEndHandler); function transitionStartHandler(evtObj:FLASHEFFEvents):void { trace("The transition has started."); } function transitionEndHandler(evtObj:FLASHEFFEvents):void { trace("The transition has ended."); }