Solved

Button behaviors

Posted on 2011-03-02
4
320 Views
Last Modified: 2013-12-24
I'm using Director 11.5 and am trying to add one of the pre-built buttons to my stage. I've never used a button before, but I've added it to my frame which has...

on exitFrame me
  go to the frame
end

Open in new window


...attached to it.

I've selected the button sprite, and then clicked on behaviors and added a new (internal score behavior) script that has an on MouseUp event. Bassically the script is as follows;

on mouseUp me
  go to next
end

Open in new window


However the button doesn't do anything. The event doesn't seem to fire.

I wonder if somebody could show me where I am going wrong please?

Thanks,
LLMorrisson,
0
Comment
Question by:LLMorrisson
  • 2
  • 2
4 Comments
 
LVL 4

Accepted Solution

by:
ute_arbeit earned 500 total points
ID: 35023341
If the button is a Flash component button the traditional mouseUp, mouseDown etc .events are not fired. Instead a click event is fired when it is enabled. To enable the click event set it to true in the Flash component tab in the property inspector when the button is selected.

Then your handler would be:
on click me
  go to next
end 

Open in new window

0
 
LVL 5

Author Comment

by:LLMorrisson
ID: 35035707
Ahh I see. Great. Ok so I changed my handler code to the above, and it does work, but it seems a little glitchy. It doesn't seem to fire on the first click necessarily. I have to click it a two or three times. Is there any reason why this might be? Is there a better way to code it so its more robust?

Thanks,
LLMorrisson.
0
 
LVL 4

Assisted Solution

by:ute_arbeit
ute_arbeit earned 500 total points
ID: 35035874
I personally do think the Flash components are a little glitchy by nature. I prefer using the old style controls. You can switch the tool bar to show the "classical" components instead of the flash components.
Of course you have to revert to mouseUp again then.
0
 
LVL 5

Author Comment

by:LLMorrisson
ID: 35035973
I agree, the classic button seems to work much more reliably. Thanks for the help.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Now that Expression Web 4.0 (http://www.microsoft.com/expression/products/Upgrade.aspx) is free if you buy or have the full version of Expression Web 3.0, now is the best time to  migrate from FrontPage to Expression Web (http://www.frontpage-to-exp…
This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
The purpose of this video is to demonstrate how to integrate Mailchimp with Facebook. This will be demonstrated using a Windows 8 PC. Mailchimp and Facebook will be used. Log into your Mailchimp account. : Click on your name. Go to Account Setti…
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Go t…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now