Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

Tutorial - VB + Flash games!


  • Please log in to reply
47 replies to this topic

#1 travy92

travy92

    CC Resident

  • Just Joined
  • PipPipPipPip
  • 73 posts

Posted 12 September 2007 - 12:53 AM

INTRO

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

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

GUI (LAYOUT):

Here is my GUI:

Posted Image


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

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)


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:


Posted Image

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

And you're done! YAY!

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

CODE:

Here is the code:

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:

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.

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

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).

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

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


  • 2
[SIGPIC]C:\Users\Travis\Desktop\Image Converter\Knight1.bmp[/SIGPIC]

#2 TcM

TcM

    CC Mentor

  • VIP Member
  • PipPipPipPipPipPipPipPip
  • 7563 posts

Posted 12 September 2007 - 02:02 PM

Just a question as this is a very good tutorial, let's say that I have another swf game how can I know the variable name, so that when I press the command button the swf game variable changes to that in the text box? In short, how can I know variables like _root.available_turrets or _root.power??

Thanks.
  • 0

#3 travy92

travy92

    CC Resident

  • Just Joined
  • PipPipPipPip
  • 73 posts

Posted 12 September 2007 - 04:41 PM

Well you need Sothink's SWF decomiler which you can search on google. Then you go to Action>Main to look at the variables.
  • 0
[SIGPIC]C:\Users\Travis\Desktop\Image Converter\Knight1.bmp[/SIGPIC]

#4 TcM

TcM

    CC Mentor

  • VIP Member
  • PipPipPipPipPipPipPipPip
  • 7563 posts

Posted 13 September 2007 - 08:15 AM

I can't find any Action>Main can you state this into more tdetail please? Thanks.

EDIT: Ok I found it! You are great!! +rep given.
  • 0

#5 khaabas

khaabas

    CC Lurker

  • Just Joined
  • Pip
  • 4 posts

Posted 22 September 2007 - 10:07 AM

wow very good
  • 0

#6 LOLOL

LOLOL

    CC Lurker

  • Just Joined
  • Pip
  • 1 posts

Posted 20 October 2007 - 04:08 AM

Very nice. :P

* Goes to hax some games for fun.
  • 0

#7 R-Kempik

R-Kempik

    CC Lurker

  • Just Joined
  • Pip
  • 1 posts

Posted 03 November 2007 - 10:19 AM

Gd thts a great tutorial thx
  • 0

#8 Yakuzaku505

Yakuzaku505

    CC Lurker

  • Just Joined
  • Pip
  • 4 posts

Posted 17 January 2008 - 07:09 PM

Hello Travy I Want To Know How Can I Get Variable Codes For Flash Games Like The _root.available_turrets or _root.power?? I Want To Know How Please Please

(THANKS)
  • 0

#9 travy92

travy92

    CC Resident

  • Just Joined
  • PipPipPipPip
  • 73 posts

Posted 17 January 2008 - 07:17 PM

Hello Travy I Want To Know How Can I Get Variable Codes For Flash Games Like The _root.available_turrets or _root.power?? I Want To Know How Please Please

(THANKS)


Scroll up, i answered this question already.


Offtopic: First time on in like 5 months!
  • 0
[SIGPIC]C:\Users\Travis\Desktop\Image Converter\Knight1.bmp[/SIGPIC]

#10 Yakuzaku505

Yakuzaku505

    CC Lurker

  • Just Joined
  • Pip
  • 4 posts

Posted 17 January 2008 - 07:41 PM

But I Cant Find The Action>main
I Dont Know Where It Is
  • 0

#11 Brimstone

Brimstone

    CC Lurker

  • Just Joined
  • Pip
  • 1 posts

Posted 24 January 2008 - 03:42 PM

Really nice tut...thanks :)
  • 0

#12 ergungozek

ergungozek

    CC Lurker

  • Just Joined
  • Pip
  • 1 posts

Posted 08 March 2008 - 07:15 PM

nice tut
  • 0




Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download