View Single Post
  #1  
Old 08-30-2010, 06:00 PM
born2kill born2kill is offline
Mainly GS2+Java Scripter
Join Date: Nov 2006
Posts: 17
born2kill will become famous soon enough
Cool GuiFlash with Flash 10 (or higher)

Hey everyone =P
Last year I've made an awesome find on how to play a flash movie
with a GuiFlash and Flash 10
A lot of people asked me how I did it since then (for example at the Unholy Cinema) and I finally decided to post it up on the graal forums for everyone

If you knew the problematic already you can skip the part below

Problem:

Graal's plugin to work with flash movies had some strange problems with the (new) flash 10 used by xp service pack > 1, vista and 7
Some example to show what I mean:

PHP Code:
//#CLIENTSIDE

function onCreated() {
  new 
GuiFlash( "Flash_Movie" ) {
    
x = y = 0;
    
width = 768;
    
height = 432;
    
requiresactivex = false;
    
requiresplugin = false;
    
tryactivex = true;
    
tryplugin = true;
    
loopmovie = false;
    
downloadwebfiles = false;
    
moviename = "http://www.youtube.com/v/SMWi7CLoZ2Q&autoplay=1";
    
playmovie();
  }
} 
For the most people (like me) this would either result in a
only partially playing movie, an error, a game freeze
or in multiple error windows popping up
This problem belongs to all those threads:

http://forums.graalonline.com/forums...hp?t=134257691
http://forums.graalonline.com/forums...ad.php?t=86228
http://forums.graalonline.com/forums...ad.php?t=71449
... and countless more

If you are lucky you could have just used an old flash 9 version with windows xp or lower but that's everything


Solution:

Its pretty tricky and I found this "bug" by accident after wasting hours of time searching for a solution (I never gave up )
But first of all install the newest internet explorer flash plugin here:
http://get.adobe.com/flashplayer/otherversions/

Well the actual problem lies in the function called by the GuiFlash:
"playmovie();"
Weirdly I found out that when you create another GuiFlash ontop of the one whos containing the movie with the same size for like a second and destroy it after then the flash will start by itself without haveing playmovie() called
So it looks like this:

PHP Code:
//#CLIENTSIDE

function onCreated() {
  new 
GuiFlash( "Flash_Movie" ) {
    
width = 768;
    
height = 432;
    
x = ( screenwidth - width ) / 2;
    
y = ( screenheight - height ) / 2;
    
requiresactivex = false;
    
requiresplugin = false;
    
tryactivex = true;
    
tryplugin = true;
    
loopmovie = false;
    
downloadwebfiles = false;
    
moviename = "http://www.youtube.com/v/SMWi7CLoZ2Q&autoplay=1";
  }
  
  new 
GuiFlash( "Flash_Loader" ) {
    
x = Flash_Movie.x;
    
y = Flash_Movie.y;
    
width = Flash_Movie.width;
    
height = Flash_Movie.height;
    
requiresactivex = false;
    
requiresplugin = false;
    
tryactivex = true;
    
tryplugin = true;
    
loopmovie = false;
    
downloadwebfiles = false;
    
moviename = "";
  }
  
  
sleep( 1 );
  
Flash_Loader.destroy();
} 
And voila the flash works all fine :P

PS:
Might only work on a Windows OS not on mac / linux - needs testing =/
(But hey 98% of all Graal PC players use windows)

PS2: nom nom nom nom nom nom nom...

PS3: Sorry for coming up with this after a long time - better late then never =D
__________________
I keep messages in forums to the most important ones
Check out all of my other usefull threads here:
http://forums.graalonline.com/forums...&starteronly=1

Last edited by born2kill; 08-30-2010 at 11:49 PM..
Reply With Quote