Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   GuiFlash with Flash 10.1 (or higher) (https://forums.graalonline.com/forums/showthread.php?t=134260372)

born2kill 08-30-2010 06:00 PM

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" ) {
    
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;
    
= ( screenwidth width ) / 2;
    
= ( 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" ) {
    
Flash_Movie.x;
    
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);
  
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

12171217 08-31-2010 07:28 PM

Cool, cool.

Is there any way to communicate with the Flash being run, to transfer variables between the two?

cyan3 08-31-2010 07:34 PM

Quote:

Originally Posted by born2kill (Post 1597507)
Might only work on a Windows OS not on mac / linux - needs testing =/
(But hey 98% of all Graal PC players use windows)

Flash In Graal uses ActiveX Controls so it probably wouldn't work on Mac or Linux but great that you got it working on Windows.

cbk1994 08-31-2010 10:28 PM

Quote:

Originally Posted by cyan3 (Post 1597789)
Flash In Graal uses ActiveX Controls so it probably wouldn't work on Mac or Linux but great that you got it working on Windows.

This. Ideally Flash should be kept to a minimum though, the only valid reason to use it that I can think of is for video playback. Even the Skills games were rewritten into GS2 (on Skills Debug).


All times are GMT +2. The time now is 03:02 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.