12D1640 Grafik och Interaktionsprogrammering VT 2006Gustav Taxé[email protected] An IntroductionIntroductionto to DirectorDirectorDirector MXDire
10LingoLingoThe behavior script for the start/stop buttonsimply inverts the value of the running variable.Note that we need to use the keyword globalt
11Fetching cast membersFetching cast membersUse the global function castLib(), which returns areference to a Cast Library core object.firstMember = ca
12Changing sprite propertiesChanging sprite properties••Changing the properties of Changing the properties of a sprite is an important a sprite is an
13Changing sprite propertiesChanging sprite propertiesThe next step is to create a behavior script for the sprite wherewe check if it’s time to blink.
14Custom sprite propertiesCustom sprite propertiesNote how the construction sprite(me.spriteNum) is used to fetchthe number of the sprite the script i
15Some sprite eventsSome sprite events••mouseEntermouseEnter, , mouseLeavemouseLeave––Called when cursor Called when cursor enters or leaves the sprit
16Collision detectionCollision detectionp = point(10, 20)if inside(p, rect(20, 50, 30, 60) then...end ifif p.inside(rect(20, 50, 30, 60) then...end if
2Some of the competitorsSome of the competitors••Macromedia FlashMacromedia Flash, , http://www.macromedia.com/http://www.macromedia.com/••Adobe GoLiv
3The CastThe CastThe cast is the content of the movie: images, film clips, sound clips, etc.Scripts that control the action are also cast members.Each
4Creating spritesCreating spritesImport images by choosing File → Import... or right-click in cast window.To create a sprite, drag the cast member int
5KeyframeKeyframeanimationanimationNow click a keyframe in the sprite channel and drag the spriteto an appropriate location on the stage. Note how Dir
6ScriptsScripts••Behavior scriptBehavior script––functions associated with a functions associated with a specific sprite.specific sprite.••Frame scrip
7Behavior scriptsBehavior scriptsTo create a behavior script,right-click on the sprite on thestage or in the score and chooseScript...The mouseUp even
8Behavior libraryBehavior libraryDirector has a number of pre-programmed behaviors. Click the Library tabin the behavior inspector to access them. Dra
9LingoLingoLet’s create a stopwatch that we can start, stop and reset!We assume that we have the images we need for drawing the clock face.LingoLingoW
Commenti su questo manuale