Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
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 July 14th, 2008, 09:24 AM
dada44 dada44 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2007
Posts: 22 dada44 User rank is Corporal (100 - 500 Reputation Level)dada44 User rank is Corporal (100 - 500 Reputation Level)dada44 User rank is Corporal (100 - 500 Reputation Level)dada44 User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 5 h 51 m 50 sec
Reputation Power: 0
Swf working great not so great the html

Dear all,

Here's the story of a simple menu: when your mouse is over the menu button, the panel with the menu choices appears and your mouse can travel around the panel. As soon as you leave the panel with your mouse, the panel disappears.

This is happening in the swf that is called menu_ee and is here:
aracelid.110mb.com/test

But when you visit the html and your mouse goes out of the panel, a lot of times the panel does not disappear. The html is also called menu_ee and it's in the same path as the swf.

What is going wrong?

My publishing settings in the HTML tab:
Flash Only
Match Movie.
Loop
Display menu
High quality
Transparent without windows
Default
Default
Alignment center center

Thanks a lot in advance!!

Reply With Quote
  #2  
Old July 14th, 2008, 09:31 AM
Tann San Tann San is offline
Gotta get to the next screen..
Click here for more information.
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 4,584 Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 7835 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 5 h 57 m 29 sec
Reputation Power: 534
Facebook MySpace
Hi, it's probably because you're rolling out of the entire Flash movie so quickly that the onRollOut event isn't being registered. I've had that happen before in the past.

A simple way around that is to use setInterval to keep checking if the mouse is over the menu. The idea is that you record the mouse position and compare it with the next time the function is called. If the two values match then the mouse hasn't moved so close the menu. The logic behind that is that it's usually quite hard to keep the mouse in the exact same position for very long, it often moves a pixel or two up/down/left/right when you're trying to hold it still. If you mouse out of the entire Flash area then the registered mouse point will remain the same until you mouse over it again.
__________________
-Tann

-Vote for your favorite ActionScript editor here.

Reply With Quote
  #3  
Old July 14th, 2008, 10:50 AM
dada44 dada44 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2007
Posts: 22 dada44 User rank is Corporal (100 - 500 Reputation Level)dada44 User rank is Corporal (100 - 500 Reputation Level)dada44 User rank is Corporal (100 - 500 Reputation Level)dada44 User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 5 h 51 m 50 sec
Reputation Power: 0
Woah! Thanks Tann!! Is there any tutorial that can show me how to do that? I'm afraid is quite out of my scope and I need the menu working properly
Thanks again!

Reply With Quote
  #4  
Old July 14th, 2008, 11:45 AM
Tann San Tann San is offline
Gotta get to the next screen..
Click here for more information.
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 4,584 Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 7835 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 5 h 57 m 29 sec
Reputation Power: 534
Facebook MySpace
I don't know of any tutorials covering that, it's just something I came up with on my own when I ran into that issue. Here's the code you'll need:
Code:
// Start checking the mouse position
// This line should be inside the event handler you use to open the sub menus
_root.int_rolled_out = setInterval(_root, checkMouse, 10000);

// Stick this on the first keyframe of the main timeline
function checkMouse():Void
   {
      var mouse_so:SharedObject = SharedObject.getLocal("mouseChecker");
      if(mouse_so.data.xmouse != undefined)
         {
            if (mouse_so.data.xmouse == _root._xmouse && mouse_so.data.ymouse == _root._ymouse)
               {
                  // Mouse is in same position so close menu
                  clearInterval(_root.int_rolled_out);
               }
            else
               {
                  // Mouse has moved so store the new mouse position
                  mouse_so.data.xmouse = _root._xmouse;
                  mouse_so.data.ymouse = _root._ymouse;
                  mouse_so.flush();
               }
         }
      else
         {
            // This is the first time we create the SO so store the new mouse position
            mouse_so.data.xmouse = _root._xmouse;
            mouse_so.data.ymouse = _root._ymouse;
            mouse_so.flush();
         }
   }

You put that first line after the comment inside whatever mouse event you're using to open the submenu. That will start the checking process. It will keep firing off every 10000 milliseconds (unless you change that value). If you do close the submenu then you need to copy this line into there as well: clearInterval(_root.int_rolled_out); which will stop it checking the mouse position. That should be all the code you need but you might have to re-hash it to fit your scenario. The function I wrote should be placed on the first keyframe of the main movie.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > Swf working great not so great the html


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 | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway