ActionScript 2.0 :: [F8] Make Random Items Go Into An Inventory?

Dec 13, 2007

I have a character that can move on two dimensions, and i've got coins and a money counter. I'd like to learn how to make random items go into an inventory.

View 1 Replies


Similar Posts:


ActionScript 3.0 :: Selecting Items From An Inventory

Dec 9, 2010

So you start off with all of the items in the inventory. You do not have to collect them.I have 8 MovieClips on the stage each with a different instance name. I made a class called Rebound and linked all the inventory MoivieClips to the Rebound class as the base class. they each have their own unique class.What I'm trying to do is select one of them. when you release the mouse off the movie clip (MOUSE_UP)it goes to frame 2 of its movieclip and making a variable I made up called isSelected = true.but when you click another item in the inventory I want it to deselect the item you clicked first so it goes back to frame 1 and isSelected = false. The problem I'm having is that it selects the first item when you click it. But when I click another the first stays on frame 1 and isSelected stays true. So if I click all 8 in a row they all become selected.[code]I thought this. called on every movieclip of the Rebound class?So instead of this. if there is something that can choose all of the movieclips that belong to the Rebound class I think I could use that instead. If there is such thing.

View 1 Replies

ActionScript 3.0 :: Selecting Items From An Inventory?

Dec 9, 2010

So you start off with all of the items in the inventory. You do not have to collect them.

I have 8 MovieClips on the stage each with a different instance name. I made a class called Rebound and linked all the inventory MoivieClips to the Rebound class as the base class. they each have their own unique class.

What I'm trying to do is select one of them. when you release the mouse off the movie clip (MOUSE_UP)

it goes to frame 2 of its movieclip and making a variable I made up called isSelected = true.

but when you click another item in the inventory I want it to deselect the item you clicked first so it goes back to frame 1 and isSelected = false. The problem I'm having is that it selects the first item when you click it. But when I click another the first stays on frame 1 and isSelected stays true. So if I click all 8 in a row they all become selected.

here's the class

Code:
package {
import flash.display.MovieClip;
import flash.events.MouseEvent;

[Code]....

I thought this. called on every movieclip of the Rebound class?

So instead of this. if there is something that can choose all of the movieclips that belong to the Rebound class I think I could use that instead. If there is such thing.

View 1 Replies

ActionScript 3.0 :: Selecting Items From Inventory

Dec 6, 2010

I have 8 MovieClips on the stage each with a different instance name. I made a class called Rebound and linked all the inventory MoivieClips to the Rebound class as the base class. they each have their own unique class.What I'm trying to do is select one of them. when you release the mouse off the movie clip (MOUSE_UP)it goes to frame 2 of its movieclip and making a variable I made up called isSelected = true.but when you click another item in the inventory I want it to deselect the item you clicked first so it goes back to frame 1 and isSelected = false. The problem I'm having is that it selects the first item when you click it. But when I click another the first stays on frame 1 and isSelected stays true. So if I click all 8 in a row they all become selected.[code] if there is something that can choose all of the movieclips that belong to the Rebound class I think I could use that instead.

View 7 Replies

ActionScript 3.0 :: Selecting Items With Different Instance Name From Inventory

Dec 9, 2010

So you start off with all of the items in the inventory. You do not have to collect them. I have 8 MovieClips on the stage each with a different instance name. I made a class called Rebound and linked all the inventory MoivieClips to the Rebound class as the base class. they each have their own unique class. What I'm trying to do is select one of them. when you release the mouse off the movie clip (MOUSE_UP). It goes to frame 2 of its movieclip and making a variable I made up called isSelected = true. But when you click another item in the inventory I want it to deselect the item you clicked first so it goes back to frame 1 and isSelected = false. The problem I'm having is that it selects the first item when you click it. But when I click another the first stays on frame 1 and isSelected stays true. So if I click all 8 in a row they all become selected.

Here's the class
Code:
package {
import flash.display.MovieClip;
import flash.events.MouseEvent;
public class Rebound extends MovieClip {
public var isSelected:Boolean;
public function Rebound():void {
this.addEventListener(MouseEvent.MOUSE_UP, starting);
[Code] .....

I thought this. called on every movieclip of the Rebound class? So instead of this. if there is something that can choose all of the movieclips that belong to the Rebound class I think I could use that instead. If there is such thing.

View 1 Replies

ActionScript 2.0 :: CS3 Making Inventory Items Fill Up Empty Spaces

Jun 28, 2009

I am using the tutorial for the simple inventory system located here. I've got it working fine within my game I'm making. However, if the player uses an item in the middle (or, in fact, anywhere other than the end) of the inventory list, it leaves a gap where it once was. How would I go about making each of the found items in the inventory move back one slot upon the player using an item?

I've uploaded a sample of my current inventory system here. To understand what I mean, pick up all four items (in any order) and then "use" one of the first three items you picked up. You should see a gap has been left in the inventory. I want this gap to be filled in by the remaining items in the inventory once said item has been used.

I've been thinking about it and I think a method that may work would be to do a hit test for all of the slots every time an item is used (to check if any slots don't have any items overlapping them), and move all of the items that are positioned to the right of it left by 60 pixels (as each slot and item is 60x60). This could work in theory but I'm not sure if it's the best method, or how to actually do it. Does anyone know how I could achieve this? Or know of any better tutorials for inventory systems that include this feature already?

View 1 Replies

ActionScript 3.0 :: Saving Progress (inventory Items Or Partial Actions Taken)

May 21, 2010

I am learning flash, and to do so I'm writing a little adventure game. My current issue is with saving progress; namely, having the game remembering what was done on previous frames. I've experimented with Booleans, who work nicely for small stuff, but it's proving more difficult to save things like inventory items or partial actions taken.

Google pointed me towards SharedObject, which would save data regardless of frame, handy! It seems to have the side effect of remembering the data even when closed though, meaning I have to erase it before every test. So now I'm thinking of turning it into a proper save & load system, like in a real game. But now I'm left to wonder, is SharedObject really the best way for me to save progress made in individual rooms? It's really simple stuff like redKeyTaken = true or greenDooropen = false (wheres then the movieclips of redkey or greendoor jump to their correct frames) What would you guys recommend for keeping track of individual room(frame) status? Keep using SharedObject and just flush at every action, or is there a better way?

View 4 Replies

Flex :: Make List Items As Tool Tips For Combo Box Items?

Dec 1, 2009

How to make list items as tool tips for combo box items?

View 2 Replies

ActionScript 2.0 :: Random Placement Of Array Items?

Nov 18, 2008

I have an array with 8 items, and I want them to be randomly placed on the stage with each load, or when a "shuffle" button is pressed. Just a simple puzzle where the pieces are to be scrambled and then dragged and dropped by the user.Current code that isn't working:

Code:
var myArray:Array = new Array();
myArray[0] = puzzle1;

[code].....

View 1 Replies

ActionScript 3.0 :: Do A Math.random On Selecting A Certain Number Of XML Items?

Jul 5, 2009

anyway to do a Math.random on selecting a certain number of XML items?

View 8 Replies

ActionScript 2.0 :: How To Display Moving Items In Random Order

Mar 29, 2005

I'm creating my first game in Flash mx. Its a conveyor belt game where toys move from left to right. There are several boxes located underneath the belt. The user has to drag and drop each toy into its correct box. I want each toy to continuously come out in a random order. (1 idea) randomly select movie clips from the library? Each movieclip representing a toy.

View 3 Replies

ActionScript 2.0 :: Display Moving Items In Random Order?

Mar 29, 2005

I'm creating my first game in Flash mx. Its a conveyor belt game where toys move from left to right. There are several boxes located underneath the belt. The user has to drag and drop each toy into its correct box.

I want each toy to continously come out in a random order.

(1 idea) randomly select movie clips from the library?

View 3 Replies

ActionScript 2.0 :: Make Random Backgrounds More Random With It?

Sep 20, 2004

I'm working on my site and I have a random background script setup. Heres the code that Im using now.[code]...

Now I love the way thats its working and but one thing that is kinda crappy is that sometimes it suffers from repeating the same background a couple of times before going to another random background. Now I know that its because the script is working properly but can anyone think of a method that I could use to make it not be able to pull up the last background that it has already loaded? I dont want to make it static because not only do I have this setup for when you enter the site but also its random when you click on one of the nav buttons because I want to try to keep my site dynamic.

View 6 Replies

ActionScript 2.0 :: Random Script That Will Make Movie Clips Play In "random" Order

May 5, 2009

I have 5 boxes on the stage as movie clips, each one with the same animation waiting to be targeted. What I need is a random script that will make them play in "random" order. This should occur after a few seconds of inactivity where they each play, but once there's mouse movement, whichever ones did animate should "reset" or play back to their original positions, (assuming there's more boxes and there's movement before all of them play). I have some code in there for arrays and some random script that isn't working right now. I just need the random setup, really. I may be able to figure out the time delay, (maybe), and then be able to tweak the rest of it for how I need. Right now, I've just simplified everything in a 5 box example hoping someone might be able to work with what I have.

View 6 Replies

CS3 Adding An 'inventory' System?

Mar 5, 2012

I'm making a sort of interactive graphic novel and was wondering how would I implement some sort of inventory system. Btw, I'm using Actionscript 2.0

----INVENTORY SYSTEM 001----

You see, I would like the ending screen to show a summary of what the player has done in the game.And certain points in the game would add certain 'items' into the inventory which will in turn affect what is displayed in the summary screen.The 'items' here being words or phrases.eg:

Quote:
You _______ with the _______ and proceeded to _______. But you _______.


For example, if the player chooses Path A, summary screen will show: eg:

Quote: You stabbed the unicorn with the shark fin and proceeded to shag your mistress. But you ate a pecan pie.But if the player chooses Path B, the summary screen will instead show eg:

Quote: You stabbed the tree with the shark fin and proceeded to shag the corned beef. But you smashed a watermelon and caused a civil war.

----INVENTORY SYSTEM 002----

I think with a few modifications, this inventory system could also be used to affect the outcome of the movie depending on what item the player currently owns? Please enlighten me if this system is feasible.

The player is given a choice to pick up a spoon or a fork in the beginning of the game.The player is later faced with a soup crisis. If the player has previously picked up a spoon, the soup can be consumed. Otherwise, the soup is left well alone.

View 13 Replies

How To Make Draggable Items

Aug 29, 2004

I only started yesterday with no knowledge at all.How do you make draggable items? I looked around and I saw things about actionscript and all that but what do you do?

View 5 Replies

How To Make Menu Items Clickable

Jun 15, 2009

I'm creating an xml generated gallery/menu, I have the gallery and menu populating fine but my issue arises when I try to make the menu items clickable.

This is inside my populate menu function
_root["mainMenu"+[i]].onRelease = function() {
trace(this);
var splitThis:String = this
var splitThisArray:Array = splitThis.split("Menu");
trace(splitThis)
trace(splitThisArray[1])
};

Now the trace output I get is
_level0.mainMenu1
_level0.mainMenu1
undefined

Although when I set splitThis to "_level0.mainMenu1" manually I get "1" or whatever number comes after "Menu".

View 2 Replies

Flash 8 :: Make Items Appear Randomly On The Map?

Sep 7, 2011

In the car game i am working on, I now got a point system set up so the car hits different items and the points rise but i want the items to appear in random places instead of 1 place only
 
[URL].. Game link so far - but not published the point system yet. don't provide to straght forward advice such as "copy this code (code here)" etc
 
Please can you provide the code i need. The MC car is called 'car 1', the MC items have different names such as g1, t1, pt1, pb1 and shine. Please tell me where i need to place the codes in the firstplace.Whether i need to click the car or the item and paste the code in frame 1 etc?
 
Over all, all layers have a total of 3 frames. 1 key frame i believe and the other two are normal frames.

View 3 Replies

Professional :: Create An In-house App For Pricing And Inventory?

Nov 8, 2011

I know this might sound odd, but if I wanted to create an app using Flash for my iPad, but just for me,not for distribution, do I still have to have an Apple Developer license?
 
I just want to create an in-house app for pricing and inventory. It's a unique business, so selling it isn't even an issue, but I don't want to have to spend another $99 just to try it out and see if this would be something we'd use long-term.So, can I make an iPad app just for myself without anything extra?

View 2 Replies

ActionScript 3.0 :: Implement An Inventory Functionality Into Program?

Jan 18, 2012

I'm trying to implement an inventory functionality into my program, i.e. equipping and taking items off a player character. I have created a superclass named 'Item' which I would like another two classes to inherit from. Those would be 'Weapon' and 'Armor' classes. The superclass 'Item' contains at this moment a list of variables that can describe any item, e.g. name, slot, armor, damage, durability. No methods have yet been added. My question is: if my superclass holds all the properties of an item, how exactly would those properties be inhertied by the other two classes? Is it even a good idea? My initial thought was to create a motherclass to hold all the variables and later methods, you could name it a 'variable pool', wherefrom each one could be used by other classes, but it makes me wonder if's going to be of any use. If you don't mind, would you create for me two short code snippets to show me how a superclass can cooperate with its subclasses?

View 1 Replies

ActionScript 2.0 :: An Inventory System That DOESN'T Work

Mar 27, 2005

I'm having trouble getting a certain function in my inventory to work properly.

View 5 Replies

ActionScript 2.0 :: Making An Inventory In A Separate Frame?

Oct 10, 2005

Right now i have an inventory, but it is on the same page as the character and the map and stuff. I am trying to get it so when you pick up an item that it will go to a seperate frame or something. Like just an inventory page. And then I would need to know how to go back to the main screen from where you left off.

View 2 Replies

IDE :: Creating Inventory - TypeError: Error #1034?

Sep 25, 2009

I have been creating an Inventory for my game and some thing go wrong... here is my code :

[code]...

TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::Shape@2565a101 to flash.display.MovieClip.at Untitled_fla::MainTimeline /drop Item()

View 2 Replies

ActionScript 2.0 :: Creating Inventory For Flash Games?

Oct 24, 2002

how to create an inventory system for a flash game? Ya know, those stuff that like lets say there's a box on the screen, you click on it and it is added to your inventory, then you can select it from your inventory screen and use it for stuff.

View 3 Replies

ActionScript 2.0 :: Inventory System That DOESN'T Work?

Mar 27, 2005

I'm having trouble getting a certain function in my inventory to work properly... here's what I have...

View 6 Replies

ActionScript 1/2 :: Flash 8 - Make Items Appear Randomly On The Map?

Sep 7, 2011

Flash 8 - How do i make items appear randomly on the map

View 1 Replies

IDE :: Make Batch Rename Library Items?

Feb 1, 2006

Is there a method, technique or third party item that will allow you to batch rename items in a Flash library?

View 3 Replies

ActionScript 2.0 :: Make A Menu Which Consists Of Items?

Apr 25, 2007

i need to make a menu which consists of items, that are supposed to fold out in a spiral motion around a specific point.I found some very useful code here on the site:

[Code]...

View 1 Replies

ActionScript 3 :: Flash Game Inventory - Design Pattern

Aug 23, 2011

I'm still studying OOP designs, so what's the best way to achieve an inventory for a simple flash game? It seems that more than one design pattern could deliver some kind of an inventory but I would lose the flexibility if I try to adapt it somehow without a good knowledge about the subject. For money to buy what is available in an inventory I thought of Singleton. If there's enough cash earned while playing the game, then one can buy new skills. Maybe decorator pattern could list many thumbnails as buttons, and clicking on it applies new features and skills to the character.

View 1 Replies

ActionScript 3.0 :: Make Items In A List Move Infinitely?

Mar 11, 2009

I have an MC that is a giant text box that contains 20 different items laid out vertically, like this for example[code]...

I want to make the list infinitely moveable/draggable on its y position, meaning the user can drag this list up and down but the list never ends.....In other words when the user drags to the last item in the list, the list, the list starts over again. And the same works in the reverse; if the user is dragging up and gets to the first item, the last item pops up after and then goes in reverse. In other words no ending. Think The Price Is Right Wheel or the alram clock on the iPhone or iPod touch.

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved