ActionScript 3.0 :: Identifying An Item From A Xml File?
Feb 28, 2012
I have an xml and it has items, you can trace the items in Flash, but how do I call them to allow me to identify that object getting clicked on the stage?
e.g. Item 1.2- how can I identify it in Flash?
<?xml version="1.0" encoding="UTF-8"?>
<menus>
<menu id="1">
[Code].....
View 2 Replies
Similar Posts:
Feb 24, 2011
How can I read the click tags names used by a flash file?
View 1 Replies
Feb 23, 2007
I have an AS3 application which seems to be leaking memory slowly while running. I've been looking for a profiler for Flex 2 / AS3 and haven't been able to find one yet, in fact I saw posts from people at Adobe saying they were working on it but no release in the short term!
Does anyone have any more news on this, or more usefully have any information on a profiler or other way it is possible to find memory allocation and usage during runtime of an AS3 application? It would really help me to identify what areas of my application are leaking memory.
View 4 Replies
Oct 27, 2009
I am trying to produce an auto check on the synchronizing process between XML values (string based by nature) and object properties.
E.g. if the property on the instance is of
Code:
public var isThere:Boolean
public var anum:Number
the code should know the type and adjust the property value
Code:
isThere = Boolean(xmlValue)
anum = Number(xmlValue)
Its all swell apart from Arrays, which mainly are identified as 'object'.
Anyone know the best check to differ between Array and Object?
View 4 Replies
Jun 1, 2004
I have 16 layers of movieclips (one in each layer), each has been given the instance name, "line1" through to "line 16". I'm trying to figure out how to hide all of them through actionscript, so far, my code is:
for(x=1; x<17; x++){
line[x]._visible = false;
}
but for some reason, it doesn't hide all the instances. I've tried typing it in seperatly, (line1._visible = false; , line2._visible = false; , etc...) and it works, but for some reason, when I use the for loop, it doesn't work..
View 2 Replies
Apr 11, 2012
I've been scouring the web to see how to do this, and now I'm not even sure it's possible. However, it seems there must be way. What I want to do is create a function that will take x,y coordinates and tell me what MovieClip or Sprite is at that location. I want it to happen automatically, without any MouseEvents or anything like that.
View 8 Replies
Jun 1, 2004
I have 16 layers of movieclips (one in each layer), each has been given the instance name, "line1" through to "line 16". I'm trying to figure out how to hide all of them through actionscript, so far, my code is:
for(x=1; x<17; x++){
line[x]._visible = false;
}
but for some reason, it doesn't hide all the instances. I've tried typing it in seperatly, (line1._visible = false; , line2._visible = false; , etc...) and it works, but for some reason, when I use the for loop, it doesn't work...what am I doing wrong?
View 2 Replies
Nov 23, 2009
I am creating a selection of checkboxes that are supplied from XML. These checkboxes are to provide additional details to a background picture and therefore they each have a unique name and an eventlistener to add the extra details to the background picture. Depending on other buttons clicked on the stage, the list of checkboxes could change for the same background picture. I have a selection of 5 different background pictures all of which have a different list of checkboxes. I therefore want to load the checkboxes dynamically. When a button is clicked to change the background picture, I want to remove all the checkboxes associated with that picture and display a new set for the new picture.
[Code]...
View 3 Replies
Jan 15, 2011
I want to identify specific strings in a text box from user input to add to a score variable, like so -
[Code]...
The example given adds 1 to the score, but if a user adds a space then a second word the text box views it as a whole and not individual words, resulting in no values added to the score variable.The problem lies with the whole text box being viewed as one entire string. Instead, I want to split it up so word1 will add 1 to the score, word2 will add 1 to the score, etc.
View 1 Replies
Dec 28, 2011
I want to do something where I collect functions to be invoked later when a certain condition is met. E.g.
function doSomething(someArg:Object):void {
if (conditionIsFalse){
operationsToDoWhenConditionIsTrue.push(function(){
doSomething(someArg);
[Code]...
Basically if doSomething is called twice, I only want operationsToDoWhenConditionIsTrue to hold the most recent invocation. Obviously since the invocations are wrapped in function(){} all the functions are the same. Is there any way I can accomplish what I want?
View 1 Replies
Feb 4, 2009
How do I determine what objects are underneath a given x or y coordinate on the stage or within a sprite? Preferably, I'd like to be able to do this so that a class that extends Sprite and is a child of the Stage can determine what's underneath a given x coordinate of itself, regardless of position on the stage. This has to be done without user input.
I'm not clear on what methods might make sense for this. The hitTest stuff requires more info than I'm likely to have. Maybe localToGlobal, but to use that, I need to know what the objects are already. There are a finite number of them, so I could have them testing for this all the time, but that doesn't seem right and may not even get me what I'm looking for.
View 3 Replies
Dec 9, 2009
I have several array element each assigned to different symbols on the stage and now I have assigned one function (fcn1) for each element's MOUSE_OVER event as follows:.
for(h = 0; h < fields.length; h++)
{
fields[h].addEventListener(MouseEvent.MOUSE_OVER, fcn1);
[code]....
Now in fcn1, I have to identify which element the mouse was over it. I could not do this because I can't pass any parameter to fcn1 other than e:MouseEvent. And I tried to look the properties and methods of e:MouseEvent that might give any information about the source element (in this case, array elements).So far, only way out of this was I create function for each array element which in turn call fcn1 with appropriate parameter, but it is cluttery.
View 1 Replies
Mar 13, 2008
how can i find (possibly with flash ) the listing of sub properties for events?i would not know if sub properties even exist for an event if i'd not done a tutorial stating so.for example.
var listenerObject:Object = new Object();
listenObject.cuePoint = function(evtObj){
trace(evtObj.info.name); //how do i find out if such sub properties exists for events?
[code]....
View 3 Replies
May 9, 2009
taking the time to look at my query:Essentially I want to know what to replace the 1_mc with.
Code:
var various_mc:MovieClip = new 1_mc;
addChild(various_mc);
[code].....
View 5 Replies
Jul 13, 2011
I have an html text being brought in from XML to a dynamic text field. The html text has a <br> in it. I need an If statement that can detect if the text has the "<br>" in it or now. How do I do that?
View 8 Replies
Sep 30, 2009
I'm working on a pretty simple game similar to Pingu Throw involving hitting an egg as far as possible. It uses very basics physics and involves a bit of moving some movieclips with bitmaps inside around to simulate a parallax background. For some reason, if you hit the ball at a certain angle, the whole thing slows down horribly (ironically, the slower the ball moves, the bigger the drop in frame rate).
I have no idea why this is occurring and have taken the following steps to rectify the problem with no success:
- tried 'cache as bitmap' both on and off for all the assets.
- disabled all non-necessary objects and methods.
- made sure assets are optimised and of an appropriate size.
I just cant get rid of the slow down without removing the code that is used to scroll the game sideways (pretty essential to the game). I need to get this game done ASAP. Here's a link to a .zip of the files. You'll need TweenMax in your classpath.
[URL]
View 2 Replies
Jun 27, 2009
Over the past years I have created many different .fla's of aircraft panels( ie. hydraulic panel, electrical panel, pressurization panel, etc.) Each .fla has only one panel in it. Each panel is a movieclip and made up of movieclips, graphics, etc. It has it's own code built in and the idea was to be able to copy the panel from the original .fla to a new .fla, that contained other panels, and together would become part of a training program for the company. No I wasn't smart enough to uniquely name each asset(switch, guage, light, etc.). I did avoid the default names like symbol1, symbol2, etc.
Now I need to take each of the panels from the individual .fla's and put them into one larger .fla to act as a single library for all the panels. This single .fla will become the master Library that I will link all future .fla's to. As you would guess I get the "One or more library items already exist in the document:" message when I try to copy and paste a panel(movieclip) into the new .fla.
Question:Is there an easy way to identify specifically which items are in conflict without having to do a direct comparison between each of the libraries?
View 5 Replies
Jan 12, 2011
how to identify which marker overlay is being clicked.
I've looked up solutions online and the only thing that ever traces back for me is [object Marker] I need a way to identify the marker icon and manipulate the icon.
this is the marker code:
ActionScript Code:
function createMarker(latlng:LatLng, number:Number, tip, myTitle, myContent):Marker {
trace(this);
[Code]....
View 1 Replies
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
Sep 27, 2008
The following script works perfectly, but I can't get the library item (which is a mc, class "helmet") to display. Do I need to import additional classes to display the mc?
package {
import flash.display.MovieClip;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.events.Event;
import fl.controls.listClasses.CellRenderer;
[Code]...
View 3 Replies
Jan 26, 2010
Is there a way to know how many times a library item is being used in your Flash file?
View 6 Replies
Jul 24, 2007
I am loading an external text file. What I want to be able achieve is see if a certain dynamic text box has text/image loaded in to it.[code]
View 2 Replies
Dec 3, 2010
I am stuck on the last stage of my flash actionscript project I have already used actionscript to loaded the xml file which includes names, link, titles, description but for some strange reasons it said it couldn't find the location of the link, so here's my code for teh actionscript:
[Code]....
View 5 Replies
Feb 21, 2008
I want to duplicate a movie clip for each item selected from an XML file. I can't seem to find anything that works. Can somebody give me something to start with?
View 2 Replies
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
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
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
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
Mar 4, 2011
<mx:itemRenderer>
<mx:Component>
<mx:Canvas>
[code]......
View 2 Replies
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