11/7/2022 0 Comments Flash actionscript 3.0 methods![]() Add a tween by right-clicking in the timeline and choosing "Create Classic Tween."Ĩ. Go back to the keyframe at frame 20 and move the page off stage.ħ. Add a keyframe at frame 25 with the page in place.Ħ. For this tutorial, we will simply have the page slide in. Note: Again, I am adding "symbol" to the name in this tutorial for the sake of clarity.ĥ. Select both the circle and the text and make them a symbol by hitting F8 or choosing Modify > Convert to Symbol. Go to frame 20 in the "pages" layer (this is page 2, the circle page).Ģ. We can do that by creating movie clip symbols for each page.ġ. However, to keep our project and our timeline tidy, we want our page content to be on one layer, the "pages" layer. Remember the two rules of Adobe Animate animation: objects to be animated MUST be a symbol (with the exception of frame by frame) and they MUST be on their own layer. The same function name MUST be used in both places of the button code. The function name can be whatever makes sense as long as it doesn't have spaces, periods, etc. The instance name must be the instance name you gave your button in the Properties panel. GotoAndStop("page1") means "go to the frame label 'page1' in the timeline and stop." You can add multiple things inside the brackets. TriangleBtn.addEventListener(MouseEvent.MOUSE_UP, gotoTriangle) įunction gotoTriangle(event:MouseEvent):void defines what happens, what the button does. In the Actions window, enter the following code beneath "stop() " ![]() Click on the keyframe on frame 1 of the "actions" layer.Ĥ. Name this instance "triangleBtn" (btn = abbreviation for "button").ģ. For ActionScript to know which instance of a symbol to work with, each instance needs a unique instance name. Remember that we can have multiple copies of a symbol on our stage. In the Properties panel is an "Instance Name" field. Select the triangleSymbol on the home page.Ģ. We will add other stop commands later.įirst, we are going to code the triangle on the home page to take us to the "Triangle" page.ġ. The buttons should change color when you roll over them, but they won't do anything when you click them. This time, the timeline will stop at the first frame, on the homepage. You'll notice a problem right away: the timeline simply plays all the pages, rather than stopping on our home page.ģ. Hit Command-Enter/Return or choose Control > Test to render a preview. Choose Windows > Actions or press F9 to open the Actions window.ġ. Open up Adobe Animate and create a new ActionScript 3.0 document.Ģ. Otherwise, they'll show up on our pages.ġ. Create a keyframe in the "buttons" layer on frame 10 (where our pages begin) and delete the buttons. Return to the main timeline and create a "circleSymbol" and a "squareSymbol" button the same way.ĩ. Create a keyframe on "over" and change the color of the triangle.Ĩ. Right-click the hit frame and choose Insert Frame or hit F5 to add frames.ħ. Any graphics on the hit frame will not be visible on the stage.Ħ. Up refers to what the button looks like normally, over is the rollover state when the mouse hovers over it, down is when the button is clicked but before it is release. Change the text to "Square." Delete the circle and add a square with the rectangle tool. Change the text to "Circle." Delete the triangle and add a circle with the oval tool.Ħ. Add a triangle to the page using the polystar tool.ĥ. ![]() Create a new keyframe on frame 10 by right-clicking the frame > Insert Keyframe, or hitting F6.ĥ. Use the type tool to add "Home" in the top-center.ģ. Create a new layer above "background" and name it "pages."Ģ. Page: We'll create 4 pages: a home page and 3 pages for our buttons to take us.ġ. Right click frame 40 in the timeline and choose Insert Frame, or hit F5 to add frames. Draw a rectangle and fill it with whatever color or gradient you want.ģ. Create a layer and name it "background."Ģ. Both movie clip symbols and button symbols can be used in code.īefore working with ActionScript, we need to set up our file and add some objects to work with.īackground: This will appear behind all of our pages.ġ. In other words, any object you want to work with in code needs to be a symbol and needs to have a unique instance name. It works with symbols, specifically instances. A Brief Explanation Before Getting StartedĪctionScript is a coding language. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |