Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Game Target Help: Quick Question



Hello all, I am trying to create a game and hit a snag... I have 2 targets for a crosshair, and I want it so that if target or target1 are hit 5 times, they either disappear or change to a dead graphic and are unclickable... Please HELP!?!?! Here is my code...Attach CodeonClipEvent (mouseDown) {//Fire Torpedothis.torpedoparent.gotoAndPlay(2);//If HS is over target, show effectif (this.hotspot.hitTest(_root.target)) {_root.target.gotoAndPlay(2);//Add to the score_root.score = _root.score+5;//If they get enough points, goto win frameif (_root.score == 25) {_root.gotoAndStop("win");}}//new targetif (this.hotspot.hitTest(_root.target1)) {_root.target1.gotoAndPlay(2);//Add to the score_root.score = _root.score+5;//If they get enough points, goto win frameif (_root.score == 25) {_root.gotoAndStop("win");}}}Edited: 05/21/2008 at 10:28:47 PM by jamocamac



Adobe > ActionScript 1 and 2
Posted on: 05/21/2008 10:28:13 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

I Need Some Quick Help With Tell Target..
How can I have a button in one scene affect a movie clip in another?

MC Target - Complicated Yet Quick Question
I'm trying to target an mc like this
////////////////////////////////////
this[gs_menu].but1.attachMovie("da","da",li_buttonLevel+li_butt onNum);
////////////////////////////////////
and this works fine.
What I really want is the but1 to be variable but when I try

////////////////////////////////////
i=1
var ls_but = "but"+i;
this[gs_menu+"."+ls_but].attachMovie("da","da",li_buttonLevel+li_buttonNum );
////////////////////////////////////

it FAILS.
How do I let the child portion of the mc be variable and still target it properly?

Quick Target Path Question.
Can someone tell me why this target path will not work.

Code:
on (rollOut) {
_root.arrowButton.homeArrow.gotoAndPlay("homeOut");
}

I have a button, which is the "arrowButton" and then on the rollover state I have a movie which is "homeArrow". Now I'm trying to play a frame lable inside the "homeArrow" movie from the main timeline where the button is located. I put the rollout so that when you come off of the button it will play that frame I have labled "homeOut". I should work but is not doing a thing. Any ideas? Thanks

Quick Easy Question About Target
I have a menu loading a new swf file into an empty container on the main stage


on (release) {
loadMovie("pm_cnt_publishing.swf", mc_content);
}


Now i need a link inside pm_cnt_publishing.swf to load a different swf file into the "mc_content" movie container located in the main flash file.

Thanks

Quick Help Needed With Basic Drop Target Stuff...
i have a movieclip called "box" with a button in it, the button has the following actions:

on (press) {
startDrag (_root.box);
}
on (release) {
stopDrag ();

o.k now i have another movieclip just stting there called"vw".
then i have another button on the main stage with the following actions:


on (release) {
if (_root.box._droptarget == _root.vw) {
getURL ("http://www.vw.com/", "_blank");
}
}

so i drag the "box" clip onto the "vw" clip but yet when i push the button nothing happens?


theory1,

Quick One: Target To Combobox In Dynamically Created Movieclip?
I have a movie clip "input_mc" from the Library and attach it to the main timeline using this.attachMovie(). It contains comboboxes, and from the main timeline I want to control the comboboxes, like addItem(). How do I do this?

From the main timeline:
this.input_mc.comboboxInstanceName.addItem("foo") - doesn't work
input_mc.comboboxInstanceName.addItem("foo") - doesn't work
_root.input_mc.comboboxInstanceName.addItem("foo") - doesn't work

I'm puzzled....there must be something really easy that I'm missing....

Thanks!!!

Game Help Plz Its Just Quick
i have a space ship i have all the keys so it moves ok good
well my problem is
i have 1 mc it starts without flames and i have the second frame with flames
what actionscript would i use so
that when i press the right key it shows the frame with flames.

Target Game
Can someone please help!!

I have a target(movieClip) randomly moving around the stage and I need to detect the percentage of time the user keeps their cursor in the centre of the target!

I'm thinking of a time limit of 60 seconds and the user must achieve 20% (12 seconds in the target) to win.


Thanx

Nick

Hit Test And Tell Target For Game Please Help
Ok I am new here and I have searched through the forum and cannot find anthing that will help me, so here is my problem:
I have 2 movie clips "ball" and "needle". frame 1 in ball is the normal ball but frame 5 starts the animation of the ball poping. How would i make it so when the hit test between the two is postitive it goes to frame 5 of the ball movie clip?

Drop Target Game Help
im trying to make a game in which u have to catch "target" which drops from the top of the window ... but im stuck in the drop target part .. i have the following code in my frame :



PHP Code:



stop();

function initGame() {
    // the range of falling targets clips
    firstTarget = 1;
    lastTarget = 0;


    // set the number of targets to fall
    totalTargets = 25;

    // init the speed and time delay
    timeSinceLastTarget = 0;
    TargetSpeed = 5;

}
    



function dropNewTarget() {
    // drop only if it has been long enough
    if (timeSinceLastTarget > 20) {

        // drop only if there are more targets
        if  (lastTarget < totalTargets) {

            // drop only 10% of the time
            if (Math.random() < .1) {

                // create next apple and set its locations
                lastTarget++;
                attachMovie( "Target", "Target"+lastTarget, lastTarget );
                _root["Target"+lastTarget]._x = Math.random()*450+30;
                _root["Target"+lastTarget]._y = 0;

                // reset time delay for next target
                timeSinceLastTarget = 0;

                // increase target speed
                if (TargetSpeed < 10) TargetSpeed += .5;
            }
        }
    }

    // even if no target dropped, get closer to next drop
    timeSinceLastTarget++;
}

function moveTargets() {
    // loop through all existing target clips
    for (i=firstTarget;i<=lastTarget;i++) {

        // get target location
        x = _root["Target"+i]._x;
        y = _root["Target"+i]._y + TargetSpeed;

        // see whether target reached ground
        if (y > 400) {
            removeTarget(i);

        

        // continue to move target
        } else {
            _root["Target"+i]._y = y;
        }
    }
}

function removeTarget(n) {
    // take away target movie clip
    _root["Target"+n].removeMovieClip();

    // reset range of targets to move
    firstTarget = n+1;
    
    // see whether this was the last target
    if (n == totalTargets) {
        gotoAndPlay("GameOver");
    
    }





and the follwing code in an empty mc " made to just hold scripts" which is in the main timeline also


PHP Code:



onClipEvent (load) {
    _root.initGame();
}

onClipEvent (enterFrame) {
    _root.dropNewTarget();
    _root.moveTargets();





by the way the mc to be droped is named "Target"

can anyone please tell me whats wrong with it ?

help will be greatly apreciated

Quick Help Plz [game Time Counter]
can anybody help to make a gameplay time counter?
i did make one but it only showed seconds and milisecons (with gettimer())).
As soon as the player hit the button "submit" the time has to start to count. As the player reached his maximum turns the game goed to the next frame and the timer should top. The game starts over (from frame2) so the timer has to begin over again.

Need Quick Fix On Flash Game, Like Tonight
It's something so simple (it's gotta be) but I can't figure what it is. Anyone willing to help out tonight? I gotta have this thing finished for the am tomorrow. It's probably as easy as changing a gotoandplay(). If anyone has some time and is actionscript savvy give me a pm or reply to this thread and I'll get ahold of you. I've got paypal on standby if need be.

Quick Help Plz [game Time Counter]
can anybody help to make a gameplay time counter?
i did make one but it only showed seconds and milisecons (with gettimer())).
As soon as the player hit the button "submit" the time has to start to count. As the player reached his maximum turns the game goed to the next frame and the timer should top. The game starts over (from frame2) so the timer has to begin over again.

Help With Ranks On My Target Shooting Game
Ok so on the target shooting game i am workng on i made it so that after the level ends it will show your score and your rank..
here is my code:


Code:
stop();
if (_root.score >= 80) {
_root.rank = _root.rank = "Target Shooter";
}
if (_root.score >= 50) {
_root.rank = _root.rank = "Noobie. Need Work.";
}
if (_root.score >= 130) {
_root.rank = _root.rank = "Expert Target Shooter";
}
if (_root.score >= 100) {
_root.rank = _root.rank = "Average Target Shooter";
}
if (_root.score >= 1000) {
_root.rank = _root.rank = "Absolute God";
}
if (_root.score <= 50) {
_root.rank = _root.rank = "YOU SUCK!";
}
but when i finish the level and i get like an 84 it tells me "noobie. need work."

is there a better way to code this?
i cant get it to work properly
thanks for any help in advance

please let me know if you need anymore info
or if this is unclear

Quick Question About Multiple .swf Game Preloading
Hi everyone

I am relatively new to flash so please bear with me!

I have made a flash game that comprises of multiple .swf files which hold different levels of the game. It runs smoothly from my machine and the transitions between levels all work perfectly as you'd expect. I want to put the game on a website but have now run into the problem of preloading and waiting for each level to load when it is called upon.

Before I jump in at the deep end I want to get a few things clear in my head (I have searched but couldn't find the exact info I needed!)

Anyway, a couple of questions if you don't mind;

Is it possible to load the initial .swf file on it's own and then load others in the background whilst the player is playing the first level? (This way there would be no delay in loading the next level when the player completes level1) I would not need a preloader display bar for the background levels, each level should take more than 1 minute to complete which should be more than enough time for the next level to have loaded in the background.

Is it better for me to continually load the game in the background as multiple .swf files therefore reducing the initial load time it takes the player to start playing, as opposed to combing them all into one huge .swf and loading the whole thing at the start?

Can anyone point me in the direction of a tutorial that would suit what I want to do please? I have looked at a few but don't want to start adapting one until I know it can do what I want!

Thanks for any help offered!

Submitting Highscores In Flash Game - Quick Question
I own an arcade site and thought it would be fun to have highscores for people. I want to do something simillar to playaholics.com (not my site obviously) when you finish the game and all that, you get a chance to submit your score. So I open it in sothink swf quicker, I find the submit button, and change the actionscript for the submit button so it submits to my site. (All of this done with the authors consent of course)

Now this is where I get lost, Im not sure of the exact actionscript I would have to put for the button. I have almost no knowledge of flash just enough to get around.

I know I have to use getURL() and on (release) or what not, but I would need to pass the game ID and the actual score they got in the flash game to a php file.

I know how to do all the PHP part, its just passing the game name and score they got to the PHP file that I need help with.

any help is appreciated

Thanks

Newbie Movement Question - Move Number Of Pixels NOT To Target Or Even PRECISE TARGET
Like a lot of people im using the code below to move a movie clip my question is this - how do i move the clip exactly a set number of pixels from its current position (lets say 20 pixels) rather than setting a target?

(what im using now)

onClipEvent (enterFrame) {
if (_root.go==1 && root._x<300) {
_x = _x+2;
}
}

ive tried lots of things but there must be a simply answer - someone please help.. thanks.

My second question is how do i move something to a specific x target ie not use <300 or such like - ive tried != and stuff like that but to no avail..

1st question more important right now though - thanks!

Apply Glow Filter On Target MC While Dragging An Object And Rolling Over The Target
I can get my filter to apply to a movie clip if i simply rollover or roll out of it. When the mouse rolls out, the filter is set to undefined. The problem I am having is that I want the object that is in effect the hit area to glow (have a filter applied) when the draggable object is being dragged over it.

This would make is easier for the user to visually identify that where they are currently hovering over, whilst dragging, is the area that they should drop the object.

Part of my code looks like this


Code:
this.onRollOver = function () {
if(_global.isDragging == 1){
this.filters = glowFilterArray;
}
}



this.onRollOut = function () {
_global.isDragging = 0;
this.filters = undefined;
}
_global.isDragging is set to 1 at the onPress stage, when startDrag occurs.
_global.isDraggin is set to 0 onRelease of the draggable object.

Are there any ideas for a solution?

Quick Question - Need Quick Answer - Load Movie
If I load an swf movie into one mc named "mc1". and then I want to load the same swf movie into another mc "mc2", will the swf need to load again into mc2 or will it already be catched.

I am assuming yes ...

Thanks,
DRB
[Edited by funner on 06-14-2001 at 09:53 PM]

Drop Target In "drag And Drop Game"
Im very much confused that how the code is wrong here..?on (press)
{
startDrag (this, false);
}
on (release)
{
stopDrag ();
if (_droptarget eq _root.cpu)
{
_root.score = int(_root.score + 1);

gotoAndStop(2);
}
else
{
_root.score = int(_root.score - 1);
gotoAndStop(2);
answer.gotoAndPlay("wrong");
} // end else if
}

Here im prepairing a game where i had palce this script inside a movie clip,having two option Correct amd Wrong,
I had created a box name keyboard
where an image of keyboard when placed it should show that its correct,and..if the movie clip calledkeyboardbutton is placed outside then it shoul show its wrong.
keyboardbutton is the instance name for that keyboard,
Actually its a game showing the Process of flow of operation in Computer..
Where i had also used the CPU and Monitor..please anyone help me out here...
here is a sample file for that:

Action On Button, Tell Target, Error=target Not Found
Hello, beings of helpfulness!

I am working at a non-profit and trying to make a website from a Flash template with minimal, but some Flash experience. The template has multiple timelines (main page, content pages, and buttons). This part I am still learning. On the home page, I have an image (mc) that loads, with an instance name of "girls." Menu buttons take the viewer to corresponding content pages, which is when I want the image on the main page to dissapear to make room for the content. When the viewer selects the home page again, I want the image to appear again. At first I put in the following action (except for the home page), alpha=0. It worked! And now it doesn't! I did play with the button timelines some. I tried taking the actionscript out and putting it in again, to no avail.

The action in my button is


on (release) {
tellTarget ("_root.girls") {
_alpha=0;
gotoAndPlay(11);
}
}

And the error I now get is: Target not found: Target="_root.girls" Base="_level0.instance58.instance543"

Any ideas? I'm quite stuck. Thanks so much for any help, or suggestions to do this another way.

I've attached the swf, but the compressed fla was too big. I can email it to anyone willing to fix what is probably very simple, except to the newbie with little but increasing experience!

I'm using Flash MX.

Best Way To Script A Quick-slow-quick Movement ?
Hi

I'd like to make a clip move across the stage like this :

- first it moves fast and then decelerates to a slow crawl for a short while then re-accelerates and moves fast to the end of its movement

what's the best way to do this ?

is it better to use mx transitions or intervals or another system ?

thanks

LoadMovie In A Target Without Inherit Of Target Properties?
hi,

I load a SWF-FILE in a target MovieClip with loadMovie(). After that I want to read the _width and _height of loaded MovieClip (from the SWF-FILE), but I only get the properties of the target MovieClip.

loadMovie ("test.swf", "dummySwf");
trace("height:"+dummySwf._height+"width:"+dummySwf ._width);
//put out the properties from target, not from new clip :-((

any idea?

thanks

Target A Specific Frame In And Instance Using Tell Target
is it possible to target a specific frame in and instance using tell target? I can get the effect i want by using goto frame, however i want to use this mc or .swf in a movie, and i don't want goto frame to affect the whole movie, just the mc.

Target JS Button To Target Frame Swf At Different Html...how?
this is my 2nd post regarding this problem, i'm seeking for many input nad perhaps the example soource file/code...

kind like a loading specific frame of swf from a html hiperlink?!? can it be done?

- say we have a 3 frame swf, located at index1.html
- then i have a button(gif/jpeg htmlpage not flash), located at index2.html

- what i wanna do is when i click the button(JS) on index2.html, it will open the index1.html then start play the swf at frame 2 NOT 1(beginning)

how can we do that?

Quick Quick....masking Problelm
Hi everyone
Um facing a problem regarding masking
well, i know how to mask texts with objects that I CREATE like a circle, for example the masked layer has text & the mask layer has a circle that I DRAW USING FLASH...this if fine...it works well
My problem is my masking does not work when i the mask layer has an object that is imported, for example an imported heart instead of a drawn circle....it does not work at all....!!!!
What's the problem?? & How could i solve it??
Any help is highly appreciated
thanks in advance

Quick Question = Quick Answer
I have a movie with an animation on one layer. Just a motion tween over 5 frames. In this movie I also want to target a blank clip and have another .swf load into that clip.

I'm putting the loadmovie script on a blank frame in my actions layer (frame 1) telling the .swf to load into the blank clip.

nothings happening? any fixes?

Load Movie Into Target And Tell Target
when i load a movie into target i can effect thie movie with setproperty but not with tell target, is this "normal"?

Needs EXPERT Help: 1. Save Game For Replay, 2. Reset Game
I'm rather new to Action Script, but doing not bad. I have searched the Board, found a link to a tutorial on ActionScript[Org], titled: "save a local copy of file". But that was yet not clear enough for me.

2 Questions at the moment (files attached):

1. Save Game for Replay: How can I save the set to a file in the Same Folder so it could reload for further play from that point on?

2. Reset Game: How can I Reset the Game for a NEW Attemp? I need to remove all Actors at once, to start a new game, without closing this SWF and reopenning it.

If you'd be so kind as to explain very clearly, and add Action Script, taking into consideration that I still get confused by trying to deal with Arrays and so. I promise to study your lesson carefully - this GameTest attached is the fruit of this week studies.

THANKS A LOT
Nit Kalish

Was This Game Made From Flash ? (Zadarider) Download The Game
Was this game made using flash 8 because it seems to run very well even when i have made up to 10000 lines.

Flash Game Help The Game Runs Too Slow In A Browser
lo there!
I'am so frustrated!

I have made a plattformgame in flash, and after I had published it I tested it (local) when it was embedded in a browser, and it hacks and laggs! But when I play it in the flash player it works just fine.
What should I do?

I removed all the heavy graphics, lowerd the fps to 30fps and removed all the code so now its just the bassis left (gravity, collision, key checking etc. and yes u should bounce on the walls giving a wall jump effect).

Anyone please! I am in big need of help!
Is it my code? Did I publish it wrong?

here are the links:

http://smh03.lbs.se/smh03niklas/prof...ofilbollen.swf
http://smh03.lbs.se/smh03niklas/prof...ofilbollen.fla
http://smh03.lbs.se/smh03niklas/prof...filbollen.html


//Qui

Target Not Found: Target="_root.info1"
Okay my problem arises when I load an external swf to a target on my main movie. now the the external swf works great on its own, it has a few MC's which are called via a simple button script - on release -> tell target -> go to and play .... the target is "_root.info1" . However When the file is loaded into my main movie I get the error message ' Target not found: Target="_root.info1" ' obviously it is trying to find the target in the main movie and not in the external swf. Well I just dont know how to fix it, any ideas ?

Thanks

Easy Q: Target Not Found: Target="downtrigger"
I have an MC thats called 'slider' that will slide around the main stage. When different buttons are pressed it will slide in to place and each place will have a dynamic text field that will scroll the appropriate text. When I test the movie the text is viewable but when I click the scroll arrows I get the following error:

Target not found: Target="downtrigger" Base="_level0.slider"

What I would like to know is where I place the

'_level0.slider' on my tell target script, which is as follows:

on (press) {
tellTarget ("downtrigger") {
gotoAndPlay(2);
}
}
on (release, releaseOutside) {
tellTarget ("downtrigger") {
gotoAndStop(1);
}
}

If anyone is interested in looking at the .fla let me know and I can email it. Much appreciated, by the way I have around 2 weeks to get this project finished!

How To Disply Time In Game And How To Stop After The Game..
Hi all,

i need help on drag and drop game...

i have done the drag and drop function, for this game timer has to be shown, after user finishes the drag & match, it should give finish alert and time taken for this game (please tell me also how to stop time after he finish the game) is to be sent to some external file or some database...

can it be done?
i have attached the .fla file also..

[F8] Game Studio Needs Flash Game Programmer
Hi -

I've been working on cartoon Flash interfaces for awhile. Now my clients want games, so I'm looking for one or two Flash game actionscripters who can help out and maybe start a studio. Since it's a startup, I'm looking for someone who's good, but not yet making millions - hoping we can do that ourselves eventually. Someone dependable, easy-going and easy to get along with. Would be great to find someone relatively local, but not absolutely necessary.

We'll be creating custom Flash games for an existing client.

Hoping to check out people's games first.

J.

[F8] How Can I Make A Game With Levels And A Game That Restarts?
I know this sounds stupid, but I just can't figure it out. I need to make a platform game. I'm fine with making a points system and a scrolling background and it functions but I don't know how to get the player to touch an object, or reach a goal and then transport to another level...I don't want to make the user have to click something to go to a new level.

Also, when the character hits an enemy, I can make it die, but I don't know how to make a button or something appear saying 'Game Over - Try again', so they can pretty much restart the level.

Hopefully someone can help me.
Regards,
Andrea

Help With A Game.. Game Is Running Slow In Browser..
I am working on this game for work and for now all i have is placeholder art for the most part and nothing very heavy on the graphics end yet my game is running very slow.. i bumped the FPS to 60 since at 30 i was getting image tearing or a double vision effect.. the upped FPS fixed that but the game is still running very slow. To give you an idea of what's going on i have different intervals running so different things can happen at different times.. there are 2 constant onEnterframes for the 2 enemies flying around the screen.. there is 1 for the main loop, 1 for the character, 1 for whenever tickets generate which removes itself and deletes the enterframe when they disappear, 1 for the wrecks that occur on level 2 which also remove themselves and delete enterframes for themselves, and 1 for a holder that handles all the money flying in which removes themselves as they collide with the player or leave the screen. All enterframes that run during gameplay delete themselves at the end of each level and re-initialize at the beginning of the next.

I can't figure it out.. please take a look at the fla and html files attached. Could it be just the sheer size of the game screen.. should i make it about half the size?? I appreciate any help and thank you.

Also the game's scripted animations seem to be running a little choppy if you watch their movement closely like there is a little glitchy jump every second or so.. is this fixable?

AS Help Needed In Game(i Will Give Credit In Game If You Help)
ok so basicly this is my game so far
23.swf

my probelm is that i want to make my charcter a flame and the tips of his head will move depending on the direction you are going.
So here is basicly this what its like

Moving left-Flames bend to right
Moving left and down-Flames bend at an angle between the left and down
Moving Down-Shorter Flames
Moving Up-Stretched Flames
etc...

ill put borders on after i get the flames down

Project Opp - Quick $ Quick Job
I have a project that requires a rotating menu. It needs to be done today. If anyone is interested they should reply with their email address or send an email to eerkel @ hotmail .com.

I will then send a Fireworks file that shows clearly how the menu should operate.

Thanks

If Target Is Between 1 And X Begion Tell Target... HELP
I have some actionscript in a button that works successfully when a MC has reached a certain frame but doesn't take into account if the MC is already playing, so I want it to say, in actionscript language:

If (/overview:_currentframe is between 1 and 50)
Begin Tell Target.... etc.

How is this done?

I Need Your Quick Assistance, Just A Quick "check, See, Tell"
Hello! Could you please go to this address

http://www.geocities.com/friendlyflashfun/clock.html

And tell me if my clock shows up?? I have FlashMX 7 Pro and it doesn't show up on my computer.

If it does or doesn't show up on yours could you please tell me how to correct this problem?

Thanks in advance,

Kelly

Target Not Found: Target="undefined" Base="_level0.hero"
For some reason whenever my hero mc jumps i get this
Target not found: Target="undefined" Base="_level0.hero"

the code for the jump is:
code:

onClipEvent (load) {
vel_y = 0;
jumping = true;
speed = 5;
}

onClipEvent (enterFrame) {
if (Key.isDown(Key.SPACE) && !jumping) {
vel_y = 35;
jumping = true;
}
}
onClipEvent (enterFrame) {
fall = true;
if (this.hitTest(_root.floor)) {
fall = false;
vel_y = 0;
grav = 0;
}
if (fall) {
grav += vel;
vel += 1;
if (grav>=10) {
grav = 10;
}
this._y += grav;
}
}
onClipEvent (enterFrame) {
if (jumping == true)
this.gotoAndStop(2);
}
onClipEvent (enterFrame) {
if (fall == true && vel_y<=5)
this.gotoAndStop(3);
}
onClipEvent (enterFrame) {
if (fall == false)
this.gotoAndStop(1);
}


Any idea how i can clean this up or help w/ the target identifier?

thnx in advance

How Do I Rid Of This Error: Target Not Found: Target="OverworldTheme" Base="_level0"
I was making a main menu and I had looping music on it. I tried to make the music stop after I click the play button so I used the following code:


PHP Code:



on (release) {
    tellTarget ("OverworldTheme") {
        stopAllSounds();
    }
}
on (release) {
    gotoAndPlay(2);





And while I play the video and press the button, the following error comes up:

Target not found: Target="OverworldTheme" Base="_level0"

Any advice on how I could fix this?

Updating Game Stats During Game
B"H

hi - happy new year

i have a small problem - i run a college sports website - i want to update game stats during the game and ppl would go my website and access the stats as i type them - they are in microsoft database and i have php cgi flash mysql on my server (just not asp) and i want it to be that as i type the scores and then switch cells w/o uploading the new file - flash could still access the files from my computer and update the page auto - (it could load the files from my i.p. addy)

what is the best way to do this - do you have any examples?

thanks

yechi

[CS3] Snake Game, Game Size
I'm using this snake game code from the old Nokia phones. The game takes place in a 150X150 square, i want this to be 384X512 but ideally it would be in a var so it can be changed easily. Can anyone help?


PHP Code:



var unit = 15;//size of snake partsvar uwh = 20;//?var canMove = false;var dir = 2;var score = 0;aPieceList = new Array();mouseListener = new Object();mouseListener.onMouseDown = function(){    if (!canMove)    {        canMove = true;        startGame();    }};Mouse.addListener(mouseListener);k = new Object();k.onKeyDown = function(){    var k = Key.getCode();    if (k == Key.UP && dir != 2 && canMove)    {        dir = 0;        canMove = false;    }    else if (k == Key.LEFT && dir != 3 && canMove)    {        dir = 1;        canMove = false;    }    else if (k == Key.DOWN && dir != 0 && canMove)    {        dir = 2;        canMove = false;    }    else if (k == Key.RIGHT && dir != 1 && canMove)    {        dir = 3;        canMove = false;    }};Key.addListener(k);function addPiece(){    var p = this.attachMovie("piece", "piece" + aPieceList.length, aPieceList.length);    p._x = aPieceList[aPieceList.length - 1]._x;    p._y = aPieceList[aPieceList.length - 1]._y;    aPieceList.push(p);}function moveFood(){    var moveIt = true;    while (moveIt)    {        food._x = Math.floor(Math.random() * uwh) * unit;        food._y = Math.floor(Math.random() * uwh) * unit;        moveIt = false;        for (var i = 0; i < aPieceList.length; i++)        {            if (aPieceList[i]._x == food._x && aPieceList[i]._y == food._y)            {                moveIt = true;            }        }    }}function gameOver(){    delete this.onEnterFrame;    tScore.text = "You Lose.  Score: " + score;    canMove = false;}function startGame(){    for (var i = aPieceList.length - 1; i >= 0; i--)    {        aPieceList[i].removeMovieClip();        aPieceList.pop();    }    score = 0;    var p = this.attachMovie("piece", "piece" + aPieceList.length, aPieceList.length);    aPieceList.push(p);    p._x = 10 * unit;    p._y = 10 * unit;    var food = this.attachMovie("food", "food", -1);    var c = 0;    moveFood();    var startingLength = 3;    for (var i = 1; i < startingLength; i++)    {        addPiece();    }    this.onEnterFrame = function()    {        canMove = true;        tScore.text = score;        for (var i = aPieceList.length - 1; i > 0; i--)        {            aPieceList[i]._x = aPieceList[i - 1]._x;            aPieceList[i]._y = aPieceList[i - 1]._y;        }        if (dir == 0)        {            aPieceList[0]._y -= unit;        }        else if (dir == 1)        {            aPieceList[0]._x -= unit;        }        else if (dir == 2)        {            aPieceList[0]._y += unit;        }        else if (dir == 3)        {            aPieceList[0]._x += unit;        }        if (aPieceList[0]._y / unit == 20)        {            aPieceList[0]._y = 0;        }        else if (aPieceList[0]._y / unit == -1)        {            aPieceList[0]._y = 19 * unit;        }        else if (aPieceList[0]._x / unit == -1)        {            aPieceList[0]._x = 19 * unit;        }        else if (aPieceList[0]._x / unit == 20)        {            aPieceList[0]._x = 0;        }        if (aPieceList[0]._x == food._x && aPieceList[0]._y == food._y)        {            score += 10 * aPieceList.length / 2;            moveFood();            addPiece();        }        for (var i = 1; i < aPieceList.length; i++)        {            if (aPieceList[0]._x == aPieceList[i]._x && aPieceList[0]._y == aPieceList[i]._y)            {                gameOver();            }        }    };}

Save Game/load Game
How do you get the browser to remember all the variables and what point you're in on the timeline when you press "Save Game," and how do you get it to reload those variables when you press "Load Game." Is this some extremely complicated process?

How To Save A Game And Load A Game?
I don't know the codes that can make a game can be saved and be loaded. I have been trying out some codes but they doesn't work. So, can anyone help me please? Im using Flash MX 2004 and Im doing a standalone game.
So, how to make it? Can teach me step by step? Please??

Card Game (turn-based) - Lobby Room And Game Room, Maintain State
Hi all, I´m new in this forum, since now i appreciate for any help.

I´m developing a turn-based card game in Flash 8 (multiplayer), using the concepts of lobby and room. In this case when the user login de game, he always see the lobby, where he can choice the games, then the user selects a game in a dataGrid and enter the game.

Inside the game (that resides in another frame in my .fla), there is a button that when clicked brings de users to the main lobby ( gotoAndStop(“lobby”) ) so that the user can visualize the lobby with the game running in background with the others users.
The problem is when the user return to the game ( gotoAndStop(“game”) ), the images, cards, players name and chat history text disappear, all the game object disappear, remaining only the original graphics (movie clips) to the game room.
In fact, I need a solution to maintain the state of the game when the user decide to visualize the lobby (with the game running) and after return to the game.

Thanks for any help.

Regards,

Luiz Filipe (CURURU)

Os: Sorry for my bad english -

Copyright © 2005-08 www.BigResource.com, All rights reserved