Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

2 Pages V  < 1 2  
Closed TopicStart new topic
> Flash Script, malucifer's SWF Script
kenth21v
post Sep 8 2011, 12:00 PM
Post #21



Group Icon

Group: Member
Posts: 3
Type: None
RM Skill: Beginner




QUOTE (anime4mage @ Apr 29 2008, 07:55 AM) *
Author - Malucifer
Original RMXP Tread Here

-Not recommended for Full Screen.-
-Warning you will need a Flash editor to put necessary Action Script-
-This means your Flash is original to you-

There are a lot of you that would like Flash put in with your game.
Not to mention that a flash file is small in size.

Well I asked a friend (malucifer) and he agreed it is beneficial to everyone here.

Download the Demo Here

All you Have to do is copy this code into Script Editor
Title it whateveruwant I called it Scene_Flash
CODE
$library_dir=(Dir.pwd).concat("/malib")

class Malib
   def playFlash(fileName)
    if(File.exist?((Dir.getwd).concat("/flash/").concat(fileName)))
      tempDir=(0.chr)*255
      Win32API.new("kernel32", "GetTempPath", ['L', 'P'], 'L').call(254, tempDir)
      tempDir=tempDir.delete(0.chr)
      tempDir=tempDir.tr("\\", "/")
      filenum=1
      tempFileDel=tempDir+"RMXPFS"+(filenum.to_s)+".maltmp"
     while(File.exist?(tempFileDel))
       filenum+=1
       tempFileDel=tempDir+"RMXPFS"+(filenum.to_s)+".maltmp"
     end#while
      createTempFile=File.new(tempFileDel, "w+")
      createTempFile.close
      myLibShell=$library_dir+"/RMXPFlash.exe "+fileName
      myLibShell+="malstrsplit"+tempFileDel
      Win32API.new("kernel32", "WinExec", ['P', 'L'], 'L').call(myLibShell, 1)
      flashWaitTimer=Thread.new do
      loop do
        if(File.exist?(tempFileDel))
          Graphics.update
          sleep(0.75)
        else
          flashWaitTimer.stop
        end#if
      end#loop
      end#Thread
    end#if
    return
  end#def
end#class
<div style="margin:20px; margin-top:5px"><div style="margin-bottom:2px">[Show/Hide] Example</div><div style="margin: 0px; padding: 6px; border: 1px inset;"><div style="display: none;"></div></div></div>Create two Folders
[ Malib ] & [ Flash ]
in your Game Directory
'MyDocument'/RM##/Project/'folders here'


Take(copy,move) 'RMXPFlash.exe' to the Malib Folder
#From the Demo or on the attachment here#


Now in the Flash Folder
Your Flash Projects go here (swf files)
You can delete the .fla files when you finish your game project
-If you don't your game will have a higher file size

##-!This is Necessary!-##
in your fla files (flash editing) you will have to put an action script on the first & last Frame.
First frame
CODE
fscommand("RMXPCommand", "nohang")

Last Frame
CODE
fscommand("flashFinished", "return")

Exact Character Keys and Capitalization required
##-!This is Necessary!-##

For 'last frame' you can use a button and put it anywhere in the frame timeline.
(if you make an arcade game and don't want to autoexit)
CODE
on (press) {fscommand("flashFinished", "return")}

See Step 4 on 2nd post for example
##---------------------------------------------------------------------------------------------##

OK to call a Flash Scene just call this script
CODE
(Malib.new).playFlash("intro.swf")
<div style="margin:20px; margin-top:5px"><div style="margin-bottom:2px">[Show/Hide] Example</div><div style="margin: 0px; padding: 6px; border: 1px inset;"><div style="display: none;"></div></div></div>
Where intro.swf is the name of flash file plus its suffix.

To Call intro
In Script Editor on Main before begin call
CODE
(Malib.new).playFlash("intro.swf")

begin
  Graphics.freeze
.....
<div style="margin:20px; margin-top:5px"><div style="margin-bottom:2px">[Show/Hide] Example</div><div style="margin: 0px; padding: 6px; border: 1px inset;"><div style="display: none;"></div></div></div>
##------------------------------------------------------------------------------------------------##

Download the Demo Here -or- Get exe & swf attachment here \/



sori for a noobie question,
but is it possible to play a flash game inside the rpg maker xp?
i tried importing my flash presentation in rpg maker but when I click the button the flash already terminates smile.gif
i hope there is way. smile.gif
Go to the top of the page
 
+Quote Post
   
Night5h4d3
post Sep 8 2011, 12:32 PM
Post #22


The past tense
Group Icon

Group: +Gold Member
Posts: 1,199
Type: Scripter
RM Skill: Undisclosed




Its not likely to work, I believe all swf scripts only run the swf, and don't execute the actionscript.


__________________________
Got 30 minutes? Then you've enough time to play this awesome game:

- potentially promising project page
- thanks holder
My growing space of user-bars:

about me:







I made the following!





Go to the top of the page
 
+Quote Post
   
kenth21v
post Sep 11 2011, 07:46 AM
Post #23



Group Icon

Group: Member
Posts: 3
Type: None
RM Skill: Beginner




QUOTE (Night5h4d3 @ Sep 8 2011, 12:32 PM) *
Its not likely to work, I believe all swf scripts only run the swf, and don't execute the actionscript.

oh dats bad.
uhm.. what about, how can i change the "clicking the button will stop the flash" into pressing enter instead?
Go to the top of the page
 
+Quote Post
   

2 Pages V  < 1 2
Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 24th May 2013 - 04:29 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker