Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 26th, 2011, 05:42 PM
dclary dclary is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2007
Posts: 5 dclary User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 55 m 46 sec
Reputation Power: 0
Flash CS4 - ActionScript 3 - Making Multiple Scripts Work Together

I am creating a Flash header for class and two things need to happen - One, it needs a stop and start button, and 2 it has to be clickable.

I have the code for each one and they do work separately, but when I try to apply both, only one will work. Here are the codes that I am using:

For Stop and Start
Actionscript Code:
Original - Actionscript Code
  1. start_btn.addEventListener(MouseEvent.CLICK, startMove);
  2. stop_btn.addEventListener(MouseEvent.CLICK, stopMove);
  3.  
  4. function startMove(e:MouseEvent):void {
  5.     play();
  6. }
  7. function stopMove(e:MouseEvent):void {
  8.     stop();
  9. }


For Clickable Link
Actionscript Code:
Original - Actionscript Code
  1. var movieContainer:MovieClip;
  2.  
  3. var movieLoader:Loader = new Loader();
  4.  
  5. movieLoader.load(new URLRequest("header.swf"));
  6.  
  7. movieLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,
  8. movieLoaded_fn);
  9. function movieLoaded_fn(e:Event): void {
  10.  
  11. movieContainer = movieLoader.content as MovieClip;
  12.  
  13. addChild(movieContainer);
  14.  
  15. movieContainer.x = 100;
  16.  
  17. movieContainer.addEventListener(MouseEvent.CLICK, callFunction_fn);
  18.  
  19. }
  20. function callFunction_fn(e:MouseEvent): void {
  21.  
  22. navigateToURL(new URLRequest("url is here"));
  23.  
  24. };


I have tried reversing them in the actions panel but to no avail. Any help would be greatly appreciated.

Reply With Quote
  #2  
Old October 27th, 2011, 06:26 AM
Tann San Tann San is offline
Gotta get to the next screen..
Dev Shed God 4th Plane (6500 - 6999 posts)
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 6,663 Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)  Folding Points: 14767 Folding Title: Novice Folder
Time spent in forums: 1 Month 1 Week 3 Days 20 h 9 m 55 sec
Reputation Power: 3163
Facebook MySpace
It's because you are making the entire clip clickable so that means that whenever the stop and start buttons are pressed it is also counted as a click against the movie clip as a whole. An easy way to get around this is to create a large block in the same clip as the start and stop buttons, place it behind the stop and start buttons. Make the large block a MovieClip and then make that clickable instead of the whole clip as you currently are. That way the start and stop buttons will be on top so the larger click won't be triggered.
__________________
Quis custodiet ipsos custodes?

Reply With Quote
  #3  
Old October 27th, 2011, 12:34 PM
dclary dclary is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2007
Posts: 5 dclary User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 55 m 46 sec
Reputation Power: 0
Thank you so much for responding, I will try what you suggested and report back. Thanks again

Reply With Quote
  #4  
Old October 27th, 2011, 02:02 PM
dclary dclary is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2007
Posts: 5 dclary User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 55 m 46 sec
Reputation Power: 0
All is good now, everything is working as it should. Thank you again, I really appreciate it.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > Flash CS4 - ActionScript 3 - Making Multiple Scripts Work Together

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap