Solved

on timeOut() problems with MIAW's

Posted on 2006-06-21
4
215 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 150 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

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 guide will walk you through the essential considerations and tech stack for building scalable websites. Know how to grow your business the smart way!
The purpose of this video is to demonstrate how to automatically show related posts at the bottom of a blog post in WordPress. This will be demonstrated using a Windows 8 PC. Plugin “Yet Another Related Posts Plugin” will be used. Go to your…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…

696 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