ActionScript 1/2 :: Declare A Global Xml Item In It?
Nov 21, 2009How do i declare a global xml item in as2?
View 1 RepliesHow do i declare a global xml item in as2?
View 1 RepliesI'm trying to get a value from a function which is a URLLoader COMPLETE event but even with declaring variables outside of the function will not allow me to get the value out. I'm stuck.It seems that the Asynchronous nature of Flash makes it impossible to get a value out: e.g. this works:
// Initialise a URLLoader to get XML data from XML file
var myFPBLoader:URLLoader = new URLLoader();
myFPBLoader.load(new URLRequest("flightPlannerBoard.xml"));
[code]...
I was wondering something to do with global functions, it seems if you declare a function as global inside the first frame of a movieclip...and try call it from the first frame of the _root timeline it does not work.
Example.
This code is in a movieclip on the first frame of the timeline called "my_mc";
Code:
_global.Test = function(){
trace("Test ok!");
}
Then the code on the main timeline, first frame would be a call like this.
Code:
Test();
I am trying to declare a global variable, a variable that will be recognized throughout the entire site. Then I am checking for that variable with a function inside of a movieClip, that is inside of another movieClip.[code]...
View 6 RepliesHow to declare global variable for MovieClip. Normally for other datatype, i just declare:
package
{
public class MyGlobal
{
[Code]......
i have searched the actionscript reference page and can't seem to find how to declare simple global variable.
View 3 RepliesHow can i declare a Global Variable or Public Variable?
View 6 Replieshow a can i declare global variables in mx 2004? i want 2 declare a variable that can be accessed by all buttons & movie clips. i tried to put it in the main thingie (the one u find in the actions panel when you're not selecting anything)
View 3 RepliesI have some filters set up, and have assigned some global vars to them, which I then use in my Filters code to display the filters: myText:Filters [globals.data.glow1, globals.data.stroke1, globals.data.shad1] Works perfectly. Now I want to assign a global var to each global filter var to determine if it should be shown or not. So...
[Code]...
Is it possible to make global functions, much in the same way you make a global variable, reachable from anywhere in the project?
View 1 Repliesi defined the global variable in the first frame of my file, and i can access it on other frames, however i am trying to access it within a movieclip, and flash is telling me that it is undefined. does anyone know why this could be?
View 1 RepliesI'm try to calling my sloppy global function by calling my global function class as u can see below.[code]
View 2 RepliesI 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).
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]...
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 RepliesI 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<mx:itemRenderer>
<mx:Component>
<mx:Canvas>
[code]......
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]........
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 RepliesI 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 RepliesI 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.
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?
How to show the item index in my item renderer.Owner of the item renderer is TileList. [url],..
View 2 RepliesIf 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;
Which is the best way to decalre variable?
Inside a class or Inside a constructor
I need to declare an array of objects in as3. Does anybody know the code?
View 7 RepliesI have a flash project that involves using glow filters on several mcs all over the site, the problem is, the current way I'm doing it requires me to declare and assign the filter on every MC's container.
Is there a way where I can just declare the glow filter once on the maintime line, and then simply apply the filter on the MCs where needed?
this is what I use for every MC, and it's really tedious and hard to keep track of/change.
Code:
var Glow1:GlowFilter = new GlowFilter();
Glow1.color = 0xFFFFFF;
Glow1.inner = false;
[Code]...
i wonder if there is a way to get the declare location of one object suppose i declare an instance of ClassB in ClassA do the classB's instance have a method to know its born location,that's ClassA?
PS:forget the solution that direct set a refrence of ClassA in classB's constrator
I have a swf page where the external swf will load, there is any way to declare variables who work in all swf. What I am trying to do is: like a switch, with several options in which all these are listed in the main swf
View 9 RepliesDeclare variable in flex vs this? [code]...
View 1 Replies