PDA

View Full Version : Inventory, Merchant system



eptigo
May 1st, 2008, 10:33 PM
i wanted to create some sort of an inventory/merchant system in my game with flash 8
but i cant program for beans, and have no clue where to start.

figured i could set it up so that when the user interacts with a certain npc, they go to a "merchants" scene or "merchants" frame where they can buy and sell various items

but whenever i hit the enter button the flash movie increments to the next frame and plays untill it reaches its original frame.

how do i get it to stop playing when i hit enter?

cooldude88
May 1st, 2008, 11:20 PM
have you tried putting: stop(); on your frame?

eptigo
May 2nd, 2008, 11:19 AM
yes, ive tried using 'stop();'
i pretty bad at programming, but im not that bad

read somewhere that the enabled shortcuts on the swf dont work in a browser or something like that

so is this something i really need to be concerned about?

Mr beef
May 2nd, 2008, 11:32 AM
Pressing enter wont have the same effects in a browser. Just use a different button for it, like shift. Then when it comes to finsihing it change the button to enter. Otherwise you won't be able to test it at all without wasting some time.

eptigo
May 3rd, 2008, 10:06 PM
er ... i know that this should be really simple but ... how would i get this thing to move to the next frame.

I placed this case statement inside a function that becomes available when the options in the dialogue appear (or some such thing)
depending on the users input, dialogue_opt = 1 or 2
when dialogue opt==1 then the user should be sent to an item screen.

ive tried using play, nextframe, gotoandplay/stop, i got nothing. how do u get this thing to go to frame with item screen???

-------------------------------------------------------------
switch (dialogue_opt) {
case true :
switch (currently_selected_option) {
case 1 :
play();
nextFrame();
gotoAndPlay(4);
trace("go to next frame")
break;
case 2 :
_root.speach_box.txt_box.text = ("(shift_function)dont be rude");
break;
default :
}

eptigo
May 3rd, 2008, 10:32 PM
no wait, i got it. looks like another navigational issue

it works if i use _root.gotoAndPlay(frame#);

therobot
May 4th, 2008, 11:05 PM
no wait, i got it. looks like another navigational issue

it works if i use _root.gotoAndPlay(frame#);



Don't forget, there is also:

movieClip.gotoAndStop( frame# );