New topic: 

Movieplayer problem on Mac

<http://forums.realsoftware.com/viewtopic.php?t=46199>

         Page 1 of 1
   [ 4 posts ]                 Previous topic | Next topic          Author  
Message        DanSandbergUCONN          Post subject: Movieplayer problem on 
MacPosted: Tue Dec 11, 2012 8:55 am                         
Joined: Fri Dec 21, 2007 9:50 am
Posts: 197                Hi All -

When I launch my program a fullscreen window plays a 7 second movie clip (.mov 
format) of animated text with the program name. In the window's 'open' event 
handler I have the following code, which will wait until the video stops, close 
the window, and make the next window (the 'control panel window') visible:

self.show() //Make sure window containing the opening graphics is visible
dim duration as double
duration=Window_SFS.MoviePlayer4.Duration //Record the duration of the movie

do
  app.doevents(0)
loop until 
abs(Window_SFS.MoviePlayer4.Position-Window_SFS.Movieplayer4.Duration)=0 //Loop 
until the movie ends

Window_ControlPanel.show() //Make the control panel window visible
self.close() //Close the window containing the opening graphics


This code works flawlessly. 

Now, I want to include code to allow the user to skip the intro by clicking 
anywhere on the first window (its full screen so any click on the screen should 
close it). To handle this I simply tried putting: Window_ControlPanel.show()
self.close()
 in the 'MouseDown' event handler of the window. When I click the screen the 
program quits and I get the following error message:Quote:SFS_Beta.debug quit 
unexpectedly. This same error message appears if I quit the program before the 
video finished by pressing command-Q. I'm on an MacBook pro and the following 
lines appear in the Problem Report for the crash Quote:Exception Type:  
EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x000000000000013b   
                             Top                Paul Lefebvre          Post 
subject: Re: Movieplayer problem on MacPosted: Tue Dec 11, 2012 9:16 am         
              Site Admin                
Joined: Fri Sep 30, 2005 9:35 am
Posts: 862
Location: South Portland, Maine                Your use of App.DoEvents could 
be causing the problem. You should really not be calling that method in a GUI 
app (it's really for console apps).

I recommend using a Timer instead. Have the Timer periodically check if the 
Movie is done and when the movie is done, the timer can stop and close the 
window.

You might consider making sure you stop the movie before closing the window as 
well in your other code.      
_________________
Paul Lefebvre
Developer Evangelist
Real Software, Inc.

The Real Studio Developer Conference is back: April 23rd-26th, 2013 in Orlando, 
FL.  
                             Top                DanSandbergUCONN          Post 
subject: Re: Movieplayer problem on MacPosted: Tue Dec 11, 2012 9:45 am         
                
Joined: Fri Dec 21, 2007 9:50 am
Posts: 197                Paul Lefebvre wrote:Your use of App.DoEvents could be 
causing the problem. You should really not be calling that method in a GUI app 
(it's really for console apps).

I recommend using a Timer instead. Have the Timer periodically check if the 
Movie is done and when the movie is done, the timer can stop and close the 
window.

You might consider making sure you stop the movie before closing the window as 
well in your other code.

Solved. Thanks Paul and my apologies for wasting your valuable time. I knew 
App.DoEvents was taboo but this is the first time its cause me a problem.   
                             Top                Paul Lefebvre          Post 
subject: Re: Movieplayer problem on MacPosted: Tue Dec 11, 2012 9:49 am         
              Site Admin                
Joined: Fri Sep 30, 2005 9:35 am
Posts: 862
Location: South Portland, Maine                DanSandbergUCONN wrote:Solved. 
Thanks Paul and my apologies for wasting your valuable time. I knew 
App.DoEvents was taboo but this is the first time its cause me a problem.
Not a problem. Glad I could help.      
_________________
Paul Lefebvre
Developer Evangelist
Real Software, Inc.

The Real Studio Developer Conference is back: April 23rd-26th, 2013 in Orlando, 
FL.  
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 4 posts ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to