Multiple axis creation via MXML works fine: http:[url]...
But when I'm trying dynamically create horizontal and vertical axis then I'm getting extra axes. I believe this is Adobe bug. How I can fix this behavior?
I'm doing quite a complicated game with a lot of code but one thing I can't quite figure out is how to trigger a function on the main stage from a dynamically added object.I've tried using custom events, but it doesn't work and doesn't throw any errors either.Here's the code for the CustomEvent class:
Code: stage.addEventListener(CustomEvent.CUSTOM, checkMoney); //more code here function checkMoney(e:CustomEvent)[code].....
All of the above seems to work, because it doesn't throw an error, but it doesn't trace money when the event is dispatched.Before you ask, the event IS being dispatched or at least the if method it's in is entered.Any other method to tell the stage it's time to run the function is welcome also
I'm adding a line to a canvas using canvas.moveTo(0, 0); canvas.lineTo(100, 100);, but I then want the user to move the mouse to set the rotation of the line.Google suggests using the rotation property,but I don't have a reference to the line object.Can I get a reference to the line or should I rotate the whole canvas?
I'd like to be able to dynamically access objects from with in a function. In javascript I might say something like window[objectName] and assign it to a temp var or call a method from it. How can I do this in AS3?
Use case:I have a currentReport var that holds the name of the currently active report. When a new report is called I want to unload the current report then load the new one and finally set the currentReport var to the new value.
I am trying to move an internal app from a Windows Media Encoder-based solution to an Adobe Flex/Air solution that involves streaming video/audio. I can use the Camera and Microphone classes in Flex to access webcams, etc. but our DV cameras (connected via Firewire) don't show up in those collections.
Does anyone have any insight on how to get around this? Target platform is primarily Windows 7 (although bonus points for a solution that would also work on Mac OS X). I'm willing to consider almost anything that will expose the audio and video streams from the DV camera to the Flex app, preferably via the Camera and Microphone classes.
Screen class in actionscript provides the latest total screen bounds and available screen bound, but doesn't allow to attach listener to listen for changes on runtime.
is there any way of detecting screen resolution changes on runtime, it is required to size the application whenever screen resolution is changed. e.g. in case when machine display is connected to projector/high resolution monitor and then switched back to normal.
Now when I want to access a function from the itemrendered/combobox i use parentApplication.funcName but what about accessing the other way, how can I access a property of the combobox from outside the itemrenderer? I tried myEditor2.pickState but it is now working
I've found several examples and documentation that show how to read and write files on the system, but all show user intervention or reading/writing files in user profile directories. There are a few things I want to do:
Monitor system and other application log files for changes, then automatically load those files when changes occur Reload a previously open file when the application launches Write files into a log directory, which probably will not exist in the same path as the application.
In my very quick search, it seems that there may be a security model that constrains an AIR application's access to the file system, so that files can only be read or written to directories selected by the user with the file system dialog OR files can be written within the user profile or air application directory.
Does an Adobe Air application have unconstrained access to the file system?
I am created a dynamically adding a VBox, that contains two images. Into a Custom Component that is derived from UIComponent. The problem is the Vbox that contains the two image is only a really tiny size. I would like the VBox stretch to the size of the two images. This is how I am creating the Vbox....
<fx:Script> <![CDATA[ import mx.controls.*; import mx.controls.TextInput; import mx.events.ListEvent; public function init():void { [Code] .....
I have implemented this one. I am getting 5 textboxes with empty value, if I entered some value in each textbox then, I want to get specific 3rd textbox value wen some event trigger.
I'm trying to access local file system from Flex web application. I know it is pretty difficult, but I think there must be a way. Is there a way that Flex app can use AIR components or maybe web application can call some AIR module in order to choose files and upload?
I am learning Adobe Air and want to get the current selected item in the spinner list I have created, however every time I use selectedItem I keep getting the same value over and over, no matter what option I select. I am trying to make an application for the Playbook and this this my SpinnerList code:
In one area of my application I am creating a display that builds itself with actionscript during a loop. (in my actual app there are A LOT of nested children and my function might be looking for any of those children) In that AS I assign each item an ID, but when I try to access that item by it's id it fails. What gives? and how can I accomplish finding a UI component without having to go through knowing all of it's possible parents? [code]
I wok on desktop Adobe AIR application. It creates .DMG for mac os builds. It is actually command line application. What I want is the ability to call it from command line - add it .../*.app/Content/MacOS to $PATH. Is there any standard way to do it with AIR ? I need it to work on Windows as well.
I have a custom component which contains many promptingTextInput controls. When i click a button, I want the text field of all the promptingTextInputs to become blank. (Note: I have around 60 promptingTextInputs) How do i access the controls dynamically ? I am looking for a flex equivalent of $('input[type=text]') (like in jquery).
var sp:Sprite = new Sprite(); sp.x = sp.y = 40; addChild(sp);
[Code].....
I want different actions for different MCs, but I can't access my MCs. I gave them names btn.name = "btn" + i;, but whenever I tried using MCs instance name "btn0" or "btn1" and so on it didn't work. So what is an instance names for my MCs?
I have encountered strange problem. I have created simple Flash text field control and I wanted to compare its content with some other string. This comparison in triggered when user is pressing the button.In Action Script 2.0 code I noticed that a caret return character () was added at the end of the string coming from the input text field.It is easy to overcome the problem obviously, however I would like to understand what is going on. I use Flash CS4 with AS 2.0.
I'm more of a Flex than Flash developer so I'm hopeful this is something easy. Short story, I have a scrollpane in a flash-created swf. In my pure AS3 project I dynamically create menuitems within a new movieclip.
I also have a bit of code to stop the video from playing and then resuming again.import flash.net.NetConnection;import flash.net.NetStream;import lash.events.AsyncErrorEvent;import flash.events.NetStatusEvent;import flash.utils.Timer;
/*1)convert the video into an flv or f4v supported format2) go to library and select new video3)place the video to the stage4)give an instance name of videoHolder*/var myVideo:NetConnection = new NetConnection ();//null because we are going to use the video
I've added a movie clip dynamically using the following code:
var apie=new cPie() apie.x=100 apie.y=100 stage.addChild(apie)
I now have a pie on my stage. Yum. Assuming this works like a movie clip placed on the stage by dragging and dropping, I added this in to change an instance in the pie.
- I have a constructor method which is trigerred automatically once the program starts - The method's argument determines whether or not an enter frame event is to be added(move:Boolean = true) - If true, add the event listener - there are getters and setters created to access the variables from another class
The problem is that the event listener is run only once - at the initial phase, so it checks the move's value just once (true - add, false - don't add), so it can be turned on and off only in this class. I want to allow a user to change its value from an external class, which is impossible even with getters and setters, because it adds the listener before the user even gets a chance to change it. I want the listener to be added only if the user wants it to. I know it looks complicated,
I have a question about Tweening for dynamically added movie clips: In Main.as constructor file I added a movie clip: addChild (new Arrow()); in Arrow.as I want the new arrow to tween as soon as it is added by Main.as file.
To do so, in Arrow.as I put this code: import fl.transitions.Tween; mport fl.transitions.easing.*; ... private function onAddedToStage(event:Event):void { tween= new Tween (this, "x", Regular.easeInOut, x, 400, 60, false); }
But "this" seems not to work because the file simply adds my movie clip to the stage without tweening or error messages. What I should put instead of "this" in the Arrow.as? Or any other options to tween this movie clip?
What I have is a navigational button. On click, it adds a MovieClip that contains a SWF.This SWF is a third party news reader/blog. My problem is that when I click on another Navigational button, I can't remove the added SWF (whether I use removeChild() or unload()).The container MC that was added to hold the SWF is removed but the newsreader stays. I assume this is because, that while the newsreader itself works great, it has too many unremoved event handlers, connections.
My main problem is that I can't figure out how to call that added swf by it's name and where on the displaylist it resides. Because I really want to use this newsreader, I've come to accept that I can't remove it. What I'm doing instead is trying to set up a conditional that looks to see if this SWF is already on stage, if so, do nothing but make it visible again(don't re-add the SWF).This is what I have so far, but it's not working (or at least not working without error)
Code: var blogNewsMC:BlogNewsMC = new BlogNewsMC(); function loadBlog(url:String) {
In my .fla file, I have a mask that masks one layer that has one movie clip in my .fla file. When I run the file, all symbols that are added at runtime are masked as well. Is there a way to initially mask one symbol on the stage and have all dynamically added symbols not masked? I tried setting the dynamically added symbols like so: example.mask=null; But this did not work.