Sign in to follow this  
Followers 0
AlmarM

Getting the Value of a Variable in a flash game.

5 posts in this topic

#1 ·  Posted (edited)

Hi,

I think the title says enough.

My script

$GUI = GUICreate("Test", 620, 250, -1, -1)
$oGame = ObjCreate("ShockwaveFlash.ShockwaveFlash.1")
$oGUIGame = GUICtrlCreateObj($oGame, 10, 10, 600, 200)
$Skip = GUICtrlCreateButton("Skip Word", 10, 215, 150, 30)

With $oGame
    .bgcolor = "#000000"
    .Movie = "http://play4traffic.com/game.swf"
    .ScaleMode = 2
    .wmode = "Opaqeu"
    .Loop = True
EndWith

GUISetState()
While 1
    $nMsg = GUIGetMsg()
    Select
    Case $nMsg = -3
        Exit
    Case $nMsg = $Skip
        $oTest = $oGame.GetVariable("woorden")
        MsgBox(0, "", $oTest)
    EndSelect
WEnd

The source from the flash game. (Its about 'woorden')

CODE
// [Action in Frame 3]

woorden = new Array("ambtelijk", "ambtenaar", "advertentie", "applet", "attachment", "analoog", "abnormaal", "academie", "alcohol", "aanvallen", "actrice", "applicatie", "allerlei", "allemaal", "abstract", "adopteren", "advocaat", "bericht", "bibliotheek", "baan", "bevredigend", "betrekking", "bedroevend", "buurman", "bankbediende", "batterij", "beurs", "broadcast", "bookmarks", "browser", "beademen", "beantwoorden", "bobslee", "cabaret", "creditcard", "cabinepersoneel", "computer", "cyberspace", "cookie", "combikaart", "combinatie", "ceintuur", "celebrity", "communicatie", "communiceren", "conceptie", "cruisecontrol", "circuit", "discussie", "data", "database", "deactiveren", "debat", "draadloos", "dynamiek", "dynamo", "display", "dochter", "document", "diamant", "diskdrive", "draaiorgel", "dolfijn", "digitaal", "download", "documentaire", "drempel", "diabetes", "ethernet", "email", "encryptie", "eten", "enter", "echo", "encyclopedie", "evacueren", "evangelie", "examen", "examenvak", "examinator", "freelance", "frequentie", "functioneren", "functionaris", "functie", "fiasco", "forum", "flash", "fiberglas", "goochelaar", "geld", "gokken", "gaspedaal", "goud", "geest", "groen", "gewichtig", "gemeente", "glasbak", "greenpeace", "gezamelijk", "gram", "gemeen", "hacker", "handwerk", "hardware", "harddisk", "hout", "helpen", "handig", "hotmail", "hosting", "help", "html", "homepage", "hypertext", "hyperlink", "ijverig", "identificatie", "instrument", "intranet", "idool", "identiteit", "inaccuraat", "inademing", "insect", "ijdel", "jaloers", "jaloezie", "jaarverslag", "jaarcijfers", "job", "jubileum", "jury", "juweel", "juwelier", "konijn", "kabinet", "kompas", "keyboard", "kleermaker", "kussen", "kangaroo", "keuken", "koning", "koningin", "kathedraal", "katholiek", "kantoor", "laboratorium", "labyrint", "lanceren", "landarbeid", "liefde", "landbouw", "luiaard", "luidruchtig", "luidspreker", "loterij", "leeuw", "lampenkap", "lusteloos", "lustobject", "mes", "matchpoint", "mechanisch", "machine", "medicijn", "muis", "monster", "marathon", "magie", "memoblok", "monitor", "mousepad", "modem", "mobiel", "naakt", "nagels", "netwerk", "nachtclub", "nieuwsbericht", "nieuwsgroep", "nuance", "nucleair", "nucleair", "ober", "omroepen", "online", "oase", "oceaan", "octopus", "oranje", "orgel", "octrooi", "opium", "oliebol", "onaandoenlijk", "parallel", "portemonnee", "pictogram", "programma", "paraplu", "professioneel", "politiek", "politie", "proberen", "proefles", "professor", "piano", "podium", "provincie", "protestant", "processor", "quote", "query", "quotering", "raadhuis", "raadsel", "regen", "rat", "ring", "rennen", "rubriek", "robijn", "spel", "snel", "sleutel", "spiegel", "satelliet", "sociaal", "solliciteren", "sigaar", "symbool", "software", "symfonie", "symmetrisch", "sympathiek", "switch", "swingen", "tuinstoel", "tatoeage", "tango", "telefoon", "toilet", "traceren", "thailand", "theater", "upload", "uitvoering", "uranium", "uniform", "universiteit", "uitzenden", "uitbeelden", "vliegtuig", "vuurwerk", "vocabulaire", "vaccinatie", "valentijn", "vallei", "vampier", "viool", "voertuig", "virtueel", "vlinder", "wachtwoord", "woordenboek", "water", "wapen", "wolf", "wurm", "webdesign", "windows", "winstgevend", "winstmarge", "wonder", "woordenschat", "xenograaf", "xenobiotisch", "yoga", "yoghurt", "zaadcel", "zebrapad", "zedendelict", "zichtbaar", "ziek", "ziekenhuis", "ziekenfonds");

aantalwoorden = woorden.length;

index = Math.round(Math.random() * (aantalwoorden - 1));

typen = woorden[index];

_root.woord.edit = typen;

woord._x = 0;

woord._y = 85.800000;

done = false;

i++;

If you look into my script. I want to get the value of 'woorden' when Skip Word is pressed.

This is my error

C:\Documents and Settings\@UserName\Bureaublad\Test File.au3 (21) : ==> The requested action with this object has failed.:
$oGame.GetVariable("woorden")
$oGame.GetVariable("woorden")^ ERROR

Can anyone help me?

AlmarM

EDIT: Typo

Edited by AlmarM

Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Share this post


Link to post
Share on other sites



Anyone?

AlmarM


Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Share this post


Link to post
Share on other sites

Realy noone who knows this or has any tips for me where to look?

AlmarM


Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Share this post


Link to post
Share on other sites

I don't think the ActionScript snippet you're showing matches the Flash game at http://play4traffic.com/game.swf.

For example, try:

$oTest = $oGame.GetVariable("module.words")

It's loading the wordlist from an XML document. You'll probably need to use a Flash decompiler like Flasm to figure out what variables are where.

Share this post


Link to post
Share on other sites

I have the same problem. My variable is not an array, it is simply something like "power" or "health".

$Game.GetVariable("power") gives

The requested action with this object has failed.:

just like AlmarM...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0