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


Similar Posts:


Flash :: Air For Android - Implement SMS Functionality?

Aug 1, 2011

I'm developing an Android App by using Flash Air 2.6. How to implement SMS functionality?

View 1 Replies

ActionScript 3.0 :: Implement Undo/redo Functionality?

Sep 5, 2009

How to implement undo/redo functionality? Actually I have a painting canvas in flash in AS3.0. For it I need UNDO/REDO functionality as user draws.

View 2 Replies

Flex :: Flash - How To Implement Ajax Functionality

Apr 15, 2010

I have a requirement like when I type 2 characters in email field if that email id exists in DB then I need to show remaining emails starting with those characters needs to display in dropdown list. Like Tags part in stackoverflow site, Is it possible in flex this functionality?

View 2 Replies

Flex :: Implement Wcf Callback Functionality In Client?

Jan 26, 2012

I want to send notification from wcf to flex client, how to do as flex client only provides client socket functionality.

View 1 Replies

ActionScript 3.0 :: Program Using Drag And Drop Functionality

Dec 29, 2009

i am designing a program using drag and drop functionality.i created three movie clips i.e circle_mc ,square_mc and triangle_mc.here circle is source and square is target if "circle_mc" is dragged and dropped on the "square_mc" then the "triangle_mc" should rotate 90degrees(clock wise). and if the "circle_mc" is removed from "square_mc" then the triangle should rotate 90degrees(anti clock wise).

View 4 Replies

ActionScript 3.0 :: Alert.show() Changing Functionality Of The Program?

Dec 8, 2010

I created an event handler to override the tab and tab + shift functionality, as tabIndex was not working as I expected it to. (I have some dynamic check boxes and it was taking two tabs to get into the VBox group and a couple of other anomalies).

I added some alert boxes so I could see what the current target is, now I have the functionality working perfectly...but when I remove the alert boxes the tab and shift/tabs do not work.

I tried to replace the alerts with trace's to no avail. I also tried to enclose the code around a switch statement and add breaks.

View 4 Replies

Professional :: Adding "new Page" Functionality For Drawing Program?

Mar 28, 2010

I have created a paint/drawing program, and I want to be able to add a button to the menu that allows you to open a new page. When you create the new page it creates a tab inside of the application and not just opening a new browser tab. I can do the new page to a new browser tab, but I want to be able to keep it inside the program itself.

View 2 Replies

ActionScript 3.0 :: Add An Exit Button Onto Program So When Its Clicked It Exits The Program Completely

Nov 4, 2008

Im trying to add an exit button onto my program so when its clicked it exits the program completely.. I've tried some of the suggestions on the forums but they arnt working. what I have been using and its not working..

// CLICK to Exit
exit_Btn.addEventListener("mouseUp", goExit);
function goExit(evt:MouseEvent) {
fscommand("quit");
};

View 9 Replies

ActionScript 2.0 :: Start An Unrelated Program (such As Window's Media Player) From Inside Of A Flash Program?

Sep 29, 2010

Is there a way to start an unrelated program (such as Window's media player) from inside of a flash program?

View 2 Replies

ActionScript 2.0 :: Program A Timer For A Typing Tutorial Program?

Mar 24, 2003

I need to program a timer for a typing tutorial program. It needs to go to 5 minutes. When the timer gets to 5 minutes the movie has to go to frame 13 which displays the results of the typing test.

View 1 Replies

Media Server :: RTMP Based HTTP DVR Functionality And HLS Based IOS Functionality?

Jan 20, 2012

I want to use RTMP based HTTP DVR functionality and HLS based IOS functionality, So I need to know how to MPP from my existing DVR app to the livepkgr app so that the stream being recorded at the DVR app can be used by the Flash and Stream MPP over to livepkgr app and can be used by the IOS HLS.

View 1 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

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

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 :: 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 :: 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

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

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 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 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

Actionscript :: Connection From Program To The Server Using XAMPP Server And Program In Flex?

Oct 26, 2010

i have the following code ]

[Code]...

but no connection established what is the reason behind not know help required and one more thing XAMPP is installed in D: drive.

View 1 Replies

ActionScript 3.0 :: Create An Inventory For An Adventure Game - Getting Error #1009: Cannot Access A Property Or Method Of A Null Object Reference?

Jan 17, 2010

Im trying to create an inventory for an adventure game (escape the room esque interface).Basically I have an array inventory system - you click on an object that is listed in the array,it moves the item off the main screen and into your inventory (bottom of the screen) and resizes it. Then you can use the object as an inventory object.This is fine on frame one (where all the items are at the moment).But when you move to another frame and then come back to frame one the items are back on the screen in their original position but now non clickable(aswell as being in your inventory working how they should). If i put the items in frame two and no items in frame one I get the following message and the items become unclickable:

Code:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Inventory/makeInventoryItems()
at InventoryOne

Im guessing the errors are because the items don't exist on all frames but the code does as it is in the games properties as the class type (class Inventory), but i have no idea how to get around it.

Inventory/makeInventoryItems() is the following AS code.

Code:

function makeInventoryItems(arrayOfItems:Array) {
for(var i:int=0;i<arrayOfItems.length;i++) {
arrayOfItems[i].addEventListener(MouseEvent.CLICK, getItem);[code]............

View 2 Replies

Flash8 : Run A Flash Program From Another Flash Program?

Jan 29, 2010

I have created a flash program and I would like to run a second flash program from inside the first. To explain, say I am running a program that draws a circle and fills it with a color. Then, I have designed a second program that will divide a circle into sectors by entering percentages, to turn that circle into a pie chart. Is there a way to be running the "draw a circle" program and have a button that opens the "divide the circle into sectors" program in a new window and then passes information from that program to the first program. I am sure I will have to send the information from the second program to an XML file and then have the first program recieve it from the XML file (which I can do), but I don't know if I can run the second program from inside the first program.

View 1 Replies







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