Connect with Facebook Lost Password?


Go Back   CodeCall Programming Forum > Software Development > Tutorials > VB Tutorials

VB Tutorials Visual Basic Tutorials and Code

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-12-2007, 03:53 AM
travy92's Avatar   
Learning Programmer
 
Join Date: Sep 2007
Location: Australia
Age: 16
Posts: 73
Rep Power: 7
travy92 will become famous soon enough
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 in this forum your post count must be 1 or greater. You currently have 0 posts.
__________________
C:\Users\Travis\Desktop\Image Converter\Knight1.bmp

Last edited by Jordan; 09-13-2007 at 08:13 AM..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 09-12-2007, 05:02 PM
TcM's Avatar   
TcM TcM is offline
Code Warrior
 
Join Date: Aug 2006
Posts: 9,792
Blog Entries: 6
Rep Power: 82
TcM is a name known to allTcM is a name known to allTcM is a name known to allTcM is a name known to allTcM is a name known to allTcM is a name known to all
Default

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 09-12-2007, 07:41 PM
travy92's Avatar   
Learning Programmer
 
Join Date: Sep 2007
Location: Australia
Age: 16
Posts: 73
Rep Power: 7
travy92 will become famous soon enough
Send a message via MSN to travy92
Default

Well you need Sothink's SWF decomiler which you can search on google. Then you go to Action>Main to look at the variables.
__________________
C:\Users\Travis\Desktop\Image Converter\Knight1.bmp
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 09-13-2007, 11:15 AM
TcM's Avatar   
TcM TcM is offline
Code Warrior
 
Join Date: Aug 2006
Posts: 9,792
Blog Entries: 6
Rep Power: 82
TcM is a name known to allTcM is a name known to allTcM is a name known to allTcM is a name known to allTcM is a name known to allTcM is a name known to all
Default

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.

Last edited by TcM; 09-13-2007 at 12:03 PM..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 09-22-2007, 01:07 PM
Newbie
 
Join Date: Sep 2007
Posts: 4
Rep Power: 0
khaabas is an unknown quantity at this point
Default

wow very good
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 10-20-2007, 07:08 AM
Newbie
 
Join Date: Oct 2007
Posts: 1
Rep Power: 0
LOLOL is an unknown quantity at this point
Default

Very nice.

* Goes to hax some games for fun.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 11-03-2007, 01:19 PM
Newbie
 
Join Date: Nov 2007
Posts: 1
Rep Power: 0
R-Kempik is an unknown quantity at this point
Default

Gd thts a great tutorial thx
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 01-17-2008, 09:09 PM
Yakuzaku505's Avatar   
Newbie
 
Join Date: Jan 2008
Posts: 4
Rep Power: 0
Yakuzaku505 is an unknown quantity at this point
Send a message via Yahoo to Yakuzaku505
Default

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)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 01-17-2008, 09:17 PM
travy92's Avatar   
Learning Programmer
 
Join Date: Sep 2007
Location: Australia
Age: 16
Posts: 73
Rep Power: 7
travy92 will become famous soon enough
Send a message via MSN to travy92
Cool

Quote:
Originally Posted by Yakuzaku505 View Post
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!
__________________
C:\Users\Travis\Desktop\Image Converter\Knight1.bmp
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 01-17-2008, 09:41 PM
Yakuzaku505's Avatar   
Newbie
 
Join Date: Jan 2008
Posts: 4
Rep Power: 0
Yakuzaku505 is an unknown quantity at this point
Send a message via Yahoo to Yakuzaku505
Default

But I Cant Find The Action>main
I Dont Know Where It Is
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VB 6.0: Tutorial, Making a Port Scanner TcM VB Tutorials 109 06-30-2009 02:30 PM
VB 6.0: Tutorial, How to Make Glass2K!! TcM VB Tutorials 17 05-01-2009 06:31 AM
VB 6.0: Tutorial, How to make a GIF in your application TcM VB Tutorials 17 07-01-2008 03:26 PM
VB 6.0: Tutorial, Explaining the VB 6.0 GUI TcM VB Tutorials 1 05-18-2007 10:25 AM
John's Java Tutorial Index John Java Tutorials 0 01-11-2007 03:05 PM


All times are GMT -5. The time now is 01:29 AM.

Freelance Jobs

XML/XSL: Need code for Book with Chapers using XML
Create an XML file for a book of your creation, and a basic CSS file that will format it to display ...
Earn: $40.00


C++/C: Simple firework cue sequencer
What I require is a rework of a simple cue sequencer. I have a piece of hardware (an Arduino boar...
Earn: $50.00


HTML/XHTML: Menu Rework - ASCIIBin
I'm placing this in the HTML/XHTML section of the Freelance site but you are not limited to HTML. Wh...
Earn: $20.00



CodeCall Goal

Goal #1: 1,000 Blogs
Goal #2: 1,000 Wiki Pages
Goal #3: 300,000 Posts
Goal #4: 20,000 Threads
Done: 30%, 23%, 55%, 75%

Ads