?
Solved

on timeOut() problems with MIAW's

Posted on 2006-06-21
4
Medium Priority
?
220 Views
Last Modified: 2013-12-24
Hi,
I have a movie script that returns my application to starting point with something like this:

on timeOut
    play movie "xxx"
end

This works fine even if I have several different movies in my application but when I have MIAW's I'll get problems. The stage doesn't seem to now anything about the mouse clicks in MIAW and on timeOut -handler occurs even if I'm having some action in MIAW. How can I avoid the timeOutLength not to fill when MIAW is open and clicked?

On the other hand, I also had the situation where I opened a MIAW and after that the on timeOut never occurred.

It seems kind of random which effect I do get.
0
Comment
Question by:-J-
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 20

Expert Comment

by:MediaMacros
ID: 16955273
Timeouts are based on a set time, not on when you last clicked.  You can check the lastEvent to see when the user last clicked, pressed a key, etc.  That can be used inside the timeout event to see if enough time has passed and if not reset the timeout interval acordingly.
0
 

Author Comment

by:-J-
ID: 16958139
This is a quote from director help about timeOut handler:

"System message and event handler; contains statements that run when the keyboard or mouse is not used for the time period specified in timeOutLength."

So it says that it's the last klick or key press that starts counting towards the timeOutLength.

I've set the timeOutLength for a few seconds (for test purposes) and it works fine when I have just stage and keep clicking the mouse. When I stop clicking director acts accordingly and plays movie "xxx" after that few seconds.

But when I open a MIAW I get those problems I described.

BTW, I'm using MX 2004 if that makes any difference.
0
 
LVL 20

Accepted Solution

by:
MediaMacros earned 600 total points
ID: 16959022
Sorry, I thought you were trying to set up a custom timeout object.  

The problem is that each window gets its own "space" so if you want the timeout to be handled across both you will need to roll your own custom handler.  

You can add to your script to check the lastevent of each window by looping through the window list using the tell command.  You can then see if anything was done in a time less than the timout period and if so reset the period acordingly.
0
 

Author Comment

by:-J-
ID: 16999676
I added in movie script "on enterFrame" handler with this kind of a line:

if the lastevent > foo then bar

I use that script globally in every movie and that made it, I didn't even have to loop the windowlist.
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Turn A Profile Picture Into A Cartoon Using Photoshop And Illustrator This tutorial will teach you how to make a cartoon style image out of a regular picture. I have tried to keep the tutorial as simple as possible. I used Adobe CS4 for this tuto…
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 insert an Iframe into WordPress. 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 : Open Page or Post…
The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…
Suggested Courses

752 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