View Single Post
  #1 (permalink)  
Old 09-12-2007, 03:53 AM
travy92's Avatar   
travy92 travy92 is offline
Learning Programmer
 
Join Date: Sep 2007
Location: Australia
Age: 15
Posts: 71
Rep Power: 4
travy92 is on a distinguished road
Send a message via MSN to travy92
Post Tutorial - VB + Flash games!

INTRO

Well in this tutorial we'll be making a Flash game player with some "hacks".

----------------------------------------------------------------

GUI (LAYOUT):

Here is my GUI:




----------------------------------------------------------------

What you need:

Here is what items/buttons you need:

3 Command Buttons with:

#1 Command Button:
Name: cmdCash
Caption: Get Cash

#2 Command Button:
Name: cmdPower
Caption: Get Power

#3 Command Button:
Name: cmdTurrets
Caption: Get Turrets

3 Text Boxes with:

#1 Text Box:
Name: txtCash
Caption (None)

#2 Text Box:
Name: txtPower
Caption: (None)

#3 Text Box:
Name: txtTurrets
Caption: (None)

Quote:

And the last thing you need to add is a ShockwaveFlash item by:

Go to components or just press CTRL+T. Then scroll down to ShockWave Flash and tick it. A new item should appear on your toolbox, it looks like a piece of paper.

Now click it and make a big box because this is what you'll be viewing/playing the flash game with.
Give it the:
Name: Movie


Now to get the flash game playing.....

First go to a flash game site (like miniclips or something) and load up a game. Wait until it's 100% fully loaded and then go into your "Temporary Internet Files" folder and find the game name with the extension ".swf". Right-Click it and then copy the location, in this case mine's:

http://www.funny-base.com/games10/turretdefense.swf


And then go back to VB and click on the Movie box (The thing we just made) and then do this:


And you're done! YAY!

----------------------------------------------------------------

CODE:

Here is the code:

Quote:
Private Sub cmdCash_Click()
Call Movie.SetVariable("_root.money", txtCash.Text)
End Sub

Private Sub cmdPower_Click()
Call Movie.SetVariable("_root.power", txtPower.Text)
End Sub

Private Sub cmdTurrets_Click()
Call Movie.SetVariable("_root.available_turrets", txtTurrets.Text)
End Sub
----------------------------------------------------------------
CODE EXPLANATIONS:

Quote:
Private Sub cmdCash_Click()
Call Movie.SetVariable("_root.money", txtCash.Text)
End Sub
This just means every time you click the "cmdCash" button, it changes the variable (code) number to the number specified in the txtCash Text Box.

----------------------------------------------------------------

Quote:
Private Sub cmdPower_Click()
Call Movie.SetVariable("_root.power", txtPower.Text)
End Sub
This does exactly what the first one does BUT it changes a different code (_root.power).

----------------------------------------------------------------

Quote:
Private Sub cmdTurrets_Click()
Call Movie.SetVariable("_root.available_turrets", txtTurrets.Text)
End Sub
Also does the same as the two other codes! Again, it just changes a different code (_root.available_turrets).

----------------------------------------------------------------

If you need any help with this tutorial/Sothink's SWF Decompiler/Flash games then please feel free to PM me or post in this Thread!

Thanks to TheComputerMaster and Tcm9669 for the ScreenShot programs.

Thanks to you for reading this tutorial!

Made by me, Travy92.

SAMPLES!:
Attached Files To view attachments your post count must be 1 or greater. Your post count is 0 momentarily.
__________________
Quote:
The pacifist's task today is to find a method of helping and healing which provides a revolutionary constructive substitute for war.

Last edited by Jordan; 09-13-2007 at 08:13 AM.
Reply With Quote

Sponsored Links