ActionScript 2.0 :: Get A Character To Pick Up An Item And Throw The Same Item?

Oct 30, 2005

Im doing my platform game and I want to know in ActionScript how to get a character to pick up an item and throw the same item.

how do I do that? whats the code?

View 1 Replies


Similar Posts:


ActionScript 3.0 :: Delete The First Character In An Item In An Array

Apr 20, 2011

How would I go about removing only the first character of an item in an array? All my items are strings, so for example I want to turn this:

pseudo code:

Array["01234","01234"]

to this:

Array["1234","1234"]

Or if that isn't possible, I could just turn each element into a string, modify it and re-Array it. The issue is using split(charAt(0)) isn't correct syntax. I just don't know what function to call and every search turns up only replacing specific characters, not character at a position.

View 2 Replies

Flex :: Select Item In Details Form Dropdown When Datagrid Item Is Selected

Feb 15, 2011

I have this datagrid:

<mx:DataGrid id="dgCompetenteN" includeIn="Test" left="10" right="472" top="69" bottom="149"
dataProvider="{colCompetente}" editable="false">
<mx:columns>

[Code]....

What I want to do is, when I select an item in the datagrid, the selected item of the dropdown should be the correct one (the one which has the field idCompSuperioara equal to the third element in the selected datagrid row).

View 1 Replies

Flex :: Get List Item Selection Working When Using A Png Mask In An Item Renderer In A 4.5 Mobile App?

Jun 10, 2011

I'm creating a mobile app in which I need to show a calendar with months at the top. The months are part of a component that extends from SkinnableDataContainer (and has some custom scrolling/behaviour - which is why I did'nt use a spark list). I need the months to be shown as a 'trapezium' shaped tab and so I'm using a png image as a mask in the item renderer for the component.

When the mask is not applied, it all works well - the months render, the list/data container selection works when I click on a month and so on.When the mask is applied, it renders well, scrolling and everything else seems to work well - but when I click on a month, nothing happens visually. And from the trace statements in my code, it appears list item selection is not changing. Looks like mouse clicks are not working.

Code:

public class TopCalendarMonthRenderer extends LabelItemRenderer {
[Embed(source="/assets/trapezium_alpha.png")]
private static var TrapeziumMask:Class;
private static var trapeziumMaskInstance:BitmapAsset;

[code]...

View 1 Replies

ActionScript 2.0 :: Display Item In Datagrid In Order It Was Chosen And Remove Selected Item

Jul 20, 2010

I am in search of finding a way to display shopping cart items in a flash 8 datagrid in the order it was chosen by the user & also to ability to delete an item if the user choses. Currently I have the items displaying however they are displaying in a position as it is stored and called in the array. [code]

View 5 Replies

Drop Down Menu Bug - Invisible Bottun Around Each Item Interferes With The Item Besid It

Jul 22, 2011

I have made a drop down menu with 7 items but as the invisible bottun around each item interferes with the item besid it, when i try to roll the mouse from one item to another, the invisible bottum dont work and the dropdown remains open.

View 1 Replies

Flex :: Access TileList Item Index In A Custom Item Renderer?

Mar 4, 2011

<mx:itemRenderer>
<mx:Component>
<mx:Canvas>

[code]......

View 2 Replies

Flex :: Toggling States - When Other Item Is Selected The First Item Does Not Change Its State?

Apr 26, 2011

I have used states in my application.The thing is I have made the first item in my list to be selected. so I gave like this,

if(itemIndex == 0)
this.currentState="selected";

this works fine.The problem is when other item is selected the first item does not change its state,it remains in the selected state until its clicked.My code looks like this,

<s:BorderContainer id="outerCont" width="275" height="100" borderVisible="false"
backgroundColor.normal="#3D3C3C" backgroundAlpha.selected="0.1"
backgroundColor.selected="{data.color}">

My states are like this,

<s:states>
<s:State name="normal" />
<s:State name="hovered" />[code]........

View 1 Replies

Actionscript 3 :: Trigger Flex Piechart Item Click Event When A Datagrid Item Is Clicked?

Nov 4, 2011

Is it possible to trigger Flex Piechart Item click event when a Datagrid Item is clicked.If so can anyone give some example.

View 3 Replies

ActionScript 2.0 :: Select An Item From List Component And Fire A Function Directly Related To Selecting That Item

Jul 13, 2009

I want to be able to select an item from my list component and fire a function directly related to selecting that item. list is called "tidlist" function is "selecttid(n)" the "n" needs to be replaced with the index number... so if run my swf and the list component displays my items... when i select one (the third one for example)... i want to fire "selectTid(3)".... cant seem to grasp.

View 1 Replies

Actionscript 2.0 :: Select An Item From List Component And Fire A Function Directly Related To Selecting That Item?

Jul 13, 2009

I want to be able to select an item from my list component and fire a function directly related to selecting that item.

list is called "tidlist"
function is "selecttid(n)"

the "n" needs to be replaced with the index number... so if run my swf and the list component displays my items... when i select an item (the third one for example)... i want to fire "selectTid(3)".... cant seem to grasp.

View 1 Replies

Show Item Index In My Item Renderer?

Mar 10, 2011

How to show the item index in my item renderer.Owner of the item renderer is TileList. [url],..

View 2 Replies

ActionScript 3.0 :: Record The Current Position Of Any Of The Items Item In Order To Use That Data To Change The Position Of The Item After The User Clicks?

Jan 2, 2010

If I have several items that move across the screen but the user can click any of them at any time, how do I record the current position of any of the items item in order to use that data to change the position of the item after the user clicks?

This is what I am doing: I have 11 images that slide accross the screen. The user can click any of them at any time. When he clicks one I am scaling the image so it looks like it is comming forward (z axis) and then the rest of the images are scaled down so it looks like they are going back on z axis. So what I am trying to do is get the current position of the image when the user clicks the image so that I can use that to correctly estimate the scaling and moving of the image to make it look like it scales from the center and not from the top left corner. So if have a variable that gets the current position of the image being clicked I'm thinking I can change its position using something like: x = currentposition + -45;

View 9 Replies

Actionscript :: Get A Menu Item's Width Before Displaying The Menu Item In Flex?

Mar 11, 2011

I'm trying to get the menu width of a menu item in flex 4. I can get it but I have to show the menu first, then hide the menu, do a calculation, and show it again. Is there an easier way to get the item menu width without this hassle?

View 1 Replies

ActionScript 3.0 :: Stop The Preloader To LOAD An Item When I Click In Another Item To Load?

Oct 27, 2009

how do I stop the preloader to LOAD an item when I click in another item to load.. Is that possible? Here in my example the preloader runs perfect, but when I start another mouseevent CLICK the old loading still active (on BANDWIDTH PROFILER, but the Preloader Movie Clip is removed).. How Do I stop the event when another different loading starts?Not visual aspect but functional.

View 1 Replies

Position Item Using X And Y Co-ordinates?

Apr 26, 2009

allowing a user to enter there own x and y co-ordiantes and then a rectange gets position in the x and y co-ordinates declared

View 4 Replies

Loading An Item From The Library

Jun 10, 2009

I've been quite frustrated over a very simple flash program I have, where I try to use code to add an item from the library to the stage. I've attached the .fla file. The errors I'm getting are: 1046: Type was not found or was not a compile-time constant: playerShip. 1180: Call to a possibly undefined method playerShip.

View 3 Replies

ActionScript 3.0 :: Get The Last Item Of The Xml File?

Nov 9, 2011

I am having a problem traversing an xml file. I can get the last item of the xml file with the code below but I want all the items.

[Code].....

View 2 Replies

Building An Item In Flash

Aug 18, 2009

I have no idea what to call it or where to start looking, so I am putting it in the generic and hopefully someone can point me to the right forum or area. Here is my project and I am trying to teach myself how to do these things. I had great help in making buttons on here a while back, now I am trying to build an object right in flash. The easiest thing for most to relate to is a computer that is being built from scratch. So, You start with a base picture of an open sided computer with a list of components underneath. By draggin those components to the box, it snaps them in place. You can also remove them the same way. When done, you click a tally button and it shows a list of all the components you added with product numbers.

View 2 Replies

ActionScript 1/2 :: XML Current And Next Item?

Dec 15, 2011

I have this code within the flash to load in the XML file. A list of buttons is generated from the XML list. How do I find out which is the current 'item' selected, and then how to select the next 'item' from the XML list

myXML = new XML();myXML.ignoreWhite = true;myXML.load("items.xml");myXML.onLoad = function(_status) {if (_status) {var clientList:Array = [];var clientRegistry:Object = {};tempxml = myXML.firstChild.childNodes;var space = 10;
for (var i = 0; i<tempxml.length; i++) {var clientData:Object = {};var item = all_items.list_mc.attachMovie("clip", "clip"+i, i);

[code]....

View 3 Replies

Xml :: Select A Tree Item?

Sep 22, 2010

I'm working on a tree component using a XMLLIST as a data provider.

<list>
<menuItem label="Home" menuItemId="1" >
<menuItem label="Info 1" menuItemId ="4"></menuItem>

[Code]....

I need to select a nested node by the property 'menuItemId' without knowing the index.For example, select the item with the menuItemId 4.

View 2 Replies

Flex4 :: Get Second Item From DropDownList

Jul 4, 2011

Does any one know how it's possible to get in Flex 4 a value of the second item from Drop Down list, assuming I have 3 items listed there?[code]

View 1 Replies

Actionscript 3 :: Get Item Value From An ArrayCollection?

Jul 18, 2011

I trying to read a value from an ArrayCollection, I use getItemAt and get an object:

masterData.getItemAt(0,0)

Then i use: masterData.getItemAt(0,0).toString(); and get:

<d>
<i>The value that I need</i>
</d>

Now How can I get the value in "< i >" tag?

View 2 Replies

ActionScript 3.0 :: How To Add Item To Array

Aug 27, 2009

I want to know if there is a method or some code to add new items to an array, but it want the items have the name of the buttons's instance name, or the label's name, so when i push the button, it adds its name to an array. Here is my code:

ActionScript Code:
tauri.addEventListener(MouseEvent.CLICK, addAddress);
abydos.addEventListener(MouseEvent.CLICK, addAddress);
tollana.addEventListener(MouseEvent.CLICK, addAddress);
dialNow.addEventListener(MouseEvent.CLICK, dialTo);
var tauriAddress:Array = ["tauri","abydos"];
var newAddress:Array = new Array();
function addAddress(event:MouseEvent):void {
newAddress.push();

I don't know if I should use the push method here, tell me what to put here for adding the instance name of the button to the array
trace(newAddress);
}

View 3 Replies

ActionScript 3.0 :: Catch One Item And Not The Other?

Oct 7, 2011

In my game, I have to catch one item and not the other. I have used an external .as file to code it and it works fine on it's own, but when I add something before the game (a title screen) and something after the game (a 'game over' screen) and 'call' the external .as file to the frame with the actual game play, I receive the error:

[Code]...

View 9 Replies

ActionScript 2.0 :: Sum Up Item In Array?

Jul 25, 2004

below is my script,to sum up the number in my array....but the output is all the numbers in array and not the sum up numbers....

CorrectMark =correctArray[0]+correctArray[1]+correctArray[2]+ correctArray[3]+ correctArray[4];
display.text=CorrectMark;

View 2 Replies

ActionScript 2.0 :: Only Last Item From Xml Showing?

Sep 30, 2008

I am loading pics via xml and i want each button to load an image once it is clicked, but I only get the last image name for each button and not the rest.

path = "images/ring/gk_th2/";
ballPath = "images/ring/bigger/"
var myXML2:XML = new XML();

[Code]....

View 3 Replies

ActionScript 3.0 :: Add An Item To An Array?

Mar 19, 2010

I'm trying to add an item to an array, but when I do, it keeps the results (prizeField) from before and adds the new ones to it. i.e. at the beginning if I push a string to the array I have 4 items. If I push another, I then have 9. Then 15 and so forth. Here is my code:

Code:
var myFlexParent:Object;
var prizeArray:Array = ["apples", "bananas", "cranberries"];
var textFormat:TextFormat = new TextFormat("Cairo", 48);[code].....

I know that I need some sort of removeChild() in there, but I cannot get it to actually work.

View 1 Replies

ActionScript 2.0 :: Add Each Individual Item

Jun 23, 2004

[code]I would like to populate 'allLinks' with objects 's'.However I have been unsuccessfull in my attempts.I need this loop to work for a a large number of items so I dont really want to have to add each individual item.

View 2 Replies

Import Movie As A Library Item?

Jan 30, 2003

how can I import a movie as a library item for another movie?

View 2 Replies







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