Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #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" ) {
    
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
__________________
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
  #2  
Old 08-31-2010, 07:28 PM
12171217 12171217 is offline
Banned
Join Date: Jan 2009
Posts: 453
12171217 has a spectacular aura about
Cool, cool.

Is there any way to communicate with the Flash being run, to transfer variables between the two?
Reply With Quote
  #3  
Old 08-31-2010, 07:34 PM
cyan3 cyan3 is offline
Registered User
cyan3's Avatar
Join Date: Nov 2005
Location: England
Posts: 2,919
cyan3 has a brilliant futurecyan3 has a brilliant futurecyan3 has a brilliant futurecyan3 has a brilliant futurecyan3 has a brilliant futurecyan3 has a brilliant futurecyan3 has a brilliant future
Quote:
Originally Posted by born2kill View Post
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.
Reply With Quote
  #4  
Old 08-31-2010, 10:28 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by cyan3 View Post
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).
__________________
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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