J C
asked on
Trying to create tooltips in Flash CS4
I followed a tutorial but something isn't clicking for me because I am getting errors.
Two errors.
First is:
1046: Type was not found or was not a compile-time constant: tooltip.
Second:
1046: Type was not found or was not a compile-time constant: tooltip. Source: var tooltip:tooltip = new tooltip();
I am new to flash. I think this may have something to do with that the class needs to be loaded? I am not sure though.
I am attaching the fla
tooltips.fla
Two errors.
First is:
1046: Type was not found or was not a compile-time constant: tooltip.
Second:
1046: Type was not found or was not a compile-time constant: tooltip. Source: var tooltip:tooltip = new tooltip();
I am new to flash. I think this may have something to do with that the class needs to be loaded? I am not sure though.
I am attaching the fla
tooltips.fla
ASKER
Would you be willing to tweak the file I uploaded and submit it with one functioning tooltip? I am really new to flash and a working example would really help me to learn. If that's not possible I understand.
if you copy and paste that code i posted, remove the tooltip from the stage(not the library)
right click in the library and change the linkage from tooltip to ToolTip it will work.
right click in the library and change the linkage from tooltip to ToolTip it will work.
ASKER
New error.
Description: 1087: Syntax error: extra characters found after end of program.
Source: on (release){
Description: 1087: Syntax error: extra characters found after end of program.
Source: on (release){
ASKER
I had action script elsewhere in the document that I had to remove. Here is the new error
1120: Access of undefined property holder: holder.x = stage.mouseX;
1120: Access of undefined property holder: holder.y = stage.mouseY - 15;
1120: Access of undefined property holder: holder.x = stage.mouseX;
1120: Access of undefined property holder: holder.y = stage.mouseY - 15;
ASKER
At some point I saw this warning message. A definition for this class could not be found in the classpath, so one will be automatically generated in the SWF file upon export.
okay first of all, the warning message is fine.
you can create an actual class for the ToolTip but in your case you don't need to , so allowing one to be generated automatically is fine.
then in terms of the error about holder.
if you look at the code snippet about, I have commented out or removed all references to holder.
you literally should be replacing ALL you existing code with the code snippet above.
also this code needs to be in the frame not on a movieclip
on (release) syntax is Actionscript 2 - don't know where / how you're getting that.
you can create an actual class for the ToolTip but in your case you don't need to , so allowing one to be generated automatically is fine.
then in terms of the error about holder.
if you look at the code snippet about, I have commented out or removed all references to holder.
you literally should be replacing ALL you existing code with the code snippet above.
also this code needs to be in the frame not on a movieclip
on (release) syntax is Actionscript 2 - don't know where / how you're getting that.
ASKER
I've done what you've recommended and the tooltip does not appear when I mouseover chapel_hill.
upload your file again - the one that you've implemented the changes on.
ASKER
Here it is
tooltips.fla
tooltips.fla
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
and did it work?
why are you using holder:MovieClip?
is there a reason?
then you can't holder = tooltip;
where holder is a movieclip and tooltip is a tooltip even if it extends a movieclip.
what i recommend.
take the tooltip off the stage.
change the class (linkage) to ToolTip //just to distinguish it from the instance
just add the tooltip instead of using the holder.
check the code snippet below
you're probably going to want to add multiple tooltips, so just use one function for the MouseOverHandler, use a switch / case and e.currentTarget to determine which button triggered it and change the text accordingly.
Open in new window