Use addOwner Method to Display a Simple Tooltip AS 3.0 Component
Updated: Aug 29, 2007
Views: 1540
Description: This tutorial will show you how to add the Tooltip to a button by using the addOwner method.
To get started, here is all of the code and an example of what we are going to build. More advanced users may only need to look at this example, while others might want to read below where I will go through the code and what each part of it does.
| |
Code used in this tutorial
myTooltip.addOwner(btn);
Part II - New Flash ActionScript 3.0 file
You must use Flash CS3 and have the Tooltip ActionScript 3.0 component for this tutorial. The first step is to create a new Flash file using ActionScript 3.0.
Part III - Create the Button
Create a button with an instance name of btn.
Part IV - Adding Tooltip to Stage
Assuming that you have Tooltip ActionScript 3.0 component installed (if not see _this tutorial_), the first step is dragging an instance of the Tooltip component on to the stage using the component panel (Window > Components). Give the Tooltip an instance name of myTooltip.
Part V - Setting Parameters of Tooltip
Select the instance of the Tooltip, and using the component inspector (Window > Component Inspector) or parameters panel (Window > Properties -> parameters) set the following parameters of the instance of the Tooltip:
- autoShow:false
- Drag:true
Part VI - Adding Button as owner
Add the following code to an actions layer using the actions window (Windows > Actions):
myTooltip.addOwner(btn);
If you have any questions please post them on our forum.
Other Tutorials
