Problems with using a variable of type flash.filesystem.File

I need to parse a file with my flex app.  I can import flash.filesystem.File with no problem but if I try to create a variable of that type, it does strange things at run time.  If the variable is defined inside a function, it's as if that function no longer exists.  The function doesn't get called and I can't step into it.  If I define a File variable at global scope, the swf simply won't do anything at all.
I've added all the AIR libs to my project and don't know what else to try at this point.  Any ideas?
This sample code shows the problem.  If I comment out the File in initData, initData doesn't get called and I can't step into it.  If I comment out the global File, then I get a blank swf.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application           
   xmlns:mx="http://www.adobe.com/2006/mxml" minWidth="955" minHeight="600"
   initialize="initData()">
    <mx:Script>
        <![CDATA[
            import flash.filesystem.File;
            //private var file:File;
            private function initData():void
                //var file:File;  
                testLabel.text = "test";   
        ]]>
    </mx:Script>
    <mx:TextArea y="200" id="testLabel" text="hello" />
</mx:Application>

sorry for my ignorance, I've only been using flex since 4.0
shouldn't you be using WindowedApplication rather than Application for an AIR app?
also there is no need to import File
below is my code that work's fine
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml"
                              layout="absolute"
                              initialize="initData()">
     <mx:Script>
          <![CDATA[
               private var file:File;
               private function initData():void
                    var file:File;
                    testLabel.text = "test";
          ]]>
     </mx:Script>
     <mx:TextArea y="200" id="testLabel" text="hello" />
</mx:WindowedApplication>

Similar Messages

  • Coercion problem when using Shared Variable

    I have a curious coercion problem when using Shared Variables.  I want to share the state of a State Machine, which is an enum saved as a control (typedef) called TYPE State (see attached).  I create a shared variable called State and define it as a Custom Control, using the just-mentioned typedef.  So far, so good.  I've attached three simple VIs -- the first one, Init State, simply wires a constant to the input of the Shared Variable to initialize it -- the wired constant is, of course, defined by the typedef.  However, the Get State and Set State, meant to wire an indicator (for reading the state) or control (for setting it), develop coercion dots when wired into the Shared Variable.  Why?  How do I get rid of the dot?  [I suppose I could abandon my typedef and custom control, but the beauty of typedefs and custom controls is that it "enforces" rules, lets you use enums for clarity, keeps the code "honest", etc. -- I'd hate to give that up just to get rid of a dot!].
    On a related note, the code seems to work.  This is much too simplistic to do anything, but if you open Set State and Get State, set the state to anything, run it (it immediately stops, of course), then run Get State, you'll see the chosen state appear in the indicator.  So it does appear to work.  The "error" (coercion dot) may, I suppose, be a "bug" in Labview because it can't figure out the mapping of the (very simple!) Custom Control, but if so, I hope it gets fixed quickly!
    Bob Schor
    Attachments:
    Coercion Problem1.zip ‏38 KB

    Hello Bob,
    I am also seeing this behavior, I will escalate this question to our LabVIEW developers and post again here no later than next Tuesday, November 27th as National Instruments will be closed for the remainder of this week.
    If this issue does turn into a product suggestion, I would suspect the workaround would to live with the coersion dot for the time being.
    Enjoy the holiday
    Regards,
    Erik J.
    Applications Engineer
    National Instruments

  • I am having problems with certain websites that require adobe flash player because of the restrictions that apple has put in place. Is there a way to get to sites that require flash player?

    I am having problems with certain websits that require adobe flash player

    Please don't start the 1 millionth thread on this subject, which has been answered over and over and over and over and over and over and over.........Use the search bar and type flash and you'll see thousands of posts on this.

  • Problems with reference field in material type

    Hi,
    I have problem with field reference in material type creation.
    When I define a self-defined field reference ZERS (copy of standard field reference HERS) for a own defined material type ZERS (copy of material type HERS), I get the following error message:
    Field reference ZERS has not been set up
    Message no. CZ127
    Diagnosis
    You have specified a field reference that has not been set up.
    Procedure
    Set up the new field reference or use an already existing field reference.
    I do not understand why because the entry ZERS is present in table T130A.
    Here is the IMG config I have made:
    1. Logistics general->Material Master->Field selection->Maintain field selection for Data Screens (here I made copy of field reference HERS and named it ZERS)
    2. Logistics general->Material Master->Basic Settings->Material types->Define attributes of Material types (here I made a copy of material type HERS and named it ZERS. I then tried to set the field T134-FLREF "Field reference" to ZERS, but then the error message appears)
    Does anyone know what config I am missing?
    Or any reason why the error message CZ127 is coming up?
    Thanks

    Must have been system error, I deleted all entries and did it all over again, it worked.

  • After installing Snow Leopard problems with using any of my Helvetica fonts

    I've never really have a problem with any of apple's products until now.
    After installing Snow Leopard I've found problems with using any of my Helvetica fonts,
    which is a BIG problem if you work in DTP or print. You CAN'T remove the system version of Helvetica, and replace it with your own anymore.
    Also Flash CS4 seems to be a dead duck, as after about 5-6 seconds of loading the program it crashes with a "KERNPROTECTIONFAILURE".
    <title edited by host>

    Thanks Tom but the original post title was "Work in DTP, don't install snow leopard", but of course apple were unhappy with the title. I know the issue/problem has been discussed for months, the real problem is that it shouldn't be a problem which everyone has to find work arounds for.
    After 4 days of playing about, I've finally got flash CS4 working and Quarkxpress was also a big problem for a few months. Printer description (PPD) files which snow leopard doesn't like, but worked in tiger & leopard.....means I can't use my two A3 inkjets for proofing anymore.
    I'm just disappointed by snow leopard

  • Problem with Photoshop CS6. If I open a file using Camera RAW

    I have a new problem with Photoshop CS6.  If I open a file using Camera RAW, and process it as usual, CS6 doesn't want to save it the way it used to.  I don't know if I changed something by accident or not. 
    Here's what happens now: After opening from ACR to CS6 and completinhg all of my work, I choose "Save as..."  The save as window opens showing the file name and format.  The default format seems to be .PSD.  I use the drop down to select .jpg.  The file saves normally as a .jpg.  When I go to close the image from, I get a new prompt asking, "Save changes to Adobe Photoshop document DSC_xxxx.NEF before closing?
    I looked up at the file name in the bar above the work space and noticed that it does NOT change from "DSC_xxxx.NEF" to "DSC_xxxx.jpg" after I have saved the file as a .jpg,in my webesite  but it always used to do that.  This adds a few extra steps when closing a document and it really slows me down.
    In fact, I wouldn't swear to this, but I think it used to save to .jpg by default, without me specifying this.
    I don't see a setting in the preferences for what to use as the default file format for saving, so I don't know where to change it back.
    Any ideas?
    Thanks in advance

    You are in the wrong forum;  You actually need Photoshop forum at this link:
    <http://forums.adobe.com/community/photoshop?view=discussions>
    Hope you can repost your question at the correct link.

  • I am going to buy unlocked iphone 5.. i will be going to india nxt months and will stay there for a while... so my question is will i get warrenty in india.. and will there be any problem with using indian sims..?? thnx for the help..

    i am going to buy unlocked iphone 5.. i will be going to india nxt months and will stay there for a while... so my question is will i get warrenty in india.. and will there be any problem with using indian sims..?? thnx for the help..

    The warranty for the iPhone is not and has never been International.
    Warranty and support are ONLY valid in the country of origin.  The only exception is the EU where the entire EU is treated as one country.
    If the device will be used in India, buy it in India.
    An unlocked iPhone will work on any supported GSM carrier world wide.  The LTE portion of a US purchased, unlocked iPhone is unlikely to work outside North America as it does not support the appropriate bands used in other countries.

  • I have two Iphones with different email addresses sharing one Apple ID. Will that cause problems with using messaging and FaceTime?

    I have two Iphones 5 with different email addresses sharing one Apple ID account.Both are using IOS 8.
    I would like to set up a new Apple Id for one of the phones and remove it from the old account.
    If I do that, can I move all of the purchased apps and songs to the new Apple account?
    Also, will sharing one Apple ID account with two devices cause problems with using messaging and FaceTime?

    Sharing an iCloud account between two devices can be done without causing issues with iMessage and FaceTime, just go into Settings for each of these functions and designate separate points of contact (i.e. phone number only, or phone number and unique email address).  While that works, you'll then face the problem where a phone call to one iPhone will ring both if on the same Wi-Fi network -- but again, that can be avoided by changing each phone's settings.
    Rather than do all that, don't fight it -- use separate IDs for iCloud.  You can still use a common ID for iTunes purchases (the ID for purchases and iCloud do not have to be the same) or you can use Family Sharing to share purchases from a primary Apple account.

  • I purchased Adobe Creative Suite C2 and have been using it for years on the same computer no problem with using it. Recently upon opening Photoshop I received a pop up window saying due to Adobe Software security we need you to activate your CS2 software.

    I purchased Adobe Creative Suite C2 and have been using it for years on the same computer without any problems with using it. Recently upon opening Photoshop I received a pop up window saying due to Adobe Software security we need you to activate your CS2 software. I tried, phone activation, web activation, nothing is working. I have the serial number and my Adobe account information. Any suggestions?

    Error: Activation Server Unavailable | CS2, Acrobat 7, Audition 3
    Mylenium

  • Problem with use of COM+ Transaction and DB Transaction

    Problem with use of COM+ Transaction and DB Transaction
    We build a Web site that use sometime COM+ Transaction and sometime DB
    Transaction. If we use a COM+ Transaction and a few seconds later we try to use
    a Database Transaction (OracleConnection.BeginTransaction), we get the error
    Connection is already part of a local or a distributed transaction
    Of course the error does not produce everytime; it takes some try before we get
    the problem. And of course, if i use pooling=false on the connection string,
    the problem does not appear.
    i run the Web page
    and push the COM+ Transaction and DB Transaction one after the other for some
    times and the problem should appear.
    Environment: Windows server 2003, .Net Framework 1.1, ODP.Net 9.2.0.401,
    Database Server 9.2.0.4

    > Why in form builder can't I...
    Is this happening at runtime or at buildtime? You'll need to provide more info on what you are actually doing that's causing the problem.
    Regards,
    Robin Zimmermann
    Forms Product Management

  • Problems with use cases in JDeveloper 11.1.1.1.0

    Use cases made with JDeveloper 11.1.1.0.2 can not be used and edited in JDeveloper 11.1.1.1.0.
    Same problems with Use Case Diagrams.
    And it seems to be impossible to create new use cases in JDeveloper 11.1.1.1.0.
    What are the differences between 11.1.1.0.2 and 11.1.1.1.0 if you look at use cases??

    In JDeveloper 11.1.1.0.2 each use case has one file with the folllowing name: *.xhtml_usc.
    In JDeveloper 11.1.1.1.0 each use case has two files with a names like *.xhtml_usc and *.uml_usc (after standard migration with JDeveloper). I can still edit the *.xhtml_usc files, but I have no idea what to do with the *.uml_usc files. I can only open a Property-editor, but the properties I see have no relation with the text I used in my original use cases . New use cases only have a *.uml_usc file and a Property-editor. In javadoc the new use case does not appear.
    My question is: why do I have two different use case files in JDeveloper 11.1.1.0 and how can I use the Property editor??

  • AxWindowsMediaPlayer problem with using subtitle sami.file in winform

    Hello every body
    I have a problem with using sami caption in axWindowsMediaPlayer;
    how can I use it?
    I used
    axWindowsMediaPlayer1.closedCaption.SAMIFileName="FileNameAddress";
    and
    axWindowsMediaPlayer1.ShowPropertyPages();//and select sami file
    but in both ways the subtitle is not shown in my axWindowsMediaPlayer1 control;
    please help me for solving this problem

    Hi ,
    As i know the Synchronized Accessible Media Interchange (SAMI) file must use an .smi or .sami file name extension.
    set the smi-file direclty like following
    AxWindowsMediaPlayer.closedCaption.SAMIFileName = "subtitles.smi";
    Please also refer here
    for more details.
    Follow the steps below for your Windows Media Player to display captions and subtitles.
    http://support.3playmedia.com/entries/21934486-windows-media-files-windows-media-player-settings
    Related thread, please note the Style secttion.
    http://answers.microsoft.com/en-us/windows/forum/windows_7-pictures/wmp-12-doesnt-play-sami-files-closed-captions/96fe98b7-1cdf-41f5-aa9e-a4e55fd07c0a
    In addition, Could you please provide your smi or sami file and full code? It could be better to help us do some test on my side.
    Have a nice day!
    Kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • I am having problem with using the Basic brush definition

    I am having problem with using the Basic brush definition. When I try to click on it will not allow me to use it and will automatically use the 5 pt. oval brush definition. The only way I can use the basic brush is after I have already drawn something and then I have to click on the stroke and then press basic. This is incredibly annoying and if anyone could help I would greatly appreciate it. (I have Adobe CS6)

    for whatever reason, the basic 'brush' you see in the brushes palette effectively means removing any brush from a path. to draw with the brush tool you need a brush defined. in your case the last one selected being the 5 pt oval one.

  • I am having problem with using my Basic brush definition

    I am having problem with using the Basic brush definition. When I try to click on it will not allow me to use it and will automatically use the 5 pt. oval brush definition. The only way I can use the basic brush is after I have already drawn something and then I have to click on the stroke and then press basic. This is incredibly annoying and if anyone could help I would greatly appreciate it. (I have Adobe CS6)

    Basic is not a brush, only a starting point for you to make a brush. Load the real brush you want before beginning to draw.

  • In FF4.0.1 problem with using HTML creator in WebCT. WHY? Not a problem in FF4.0.0

    In FF4.0.1 problem with using HTML creator in WebCT. WHY? Not a problem in FF4.0.0

    Hi Shane,
    I passed through all the described problems in the list, and after doing several tests the error that you described is always present if the "jpcsclite_en_US.properties" is not present in the same place of the "jpcsclite.properties". I really don't know the reason, I just copied and pasted the same file, renamed the copy and the error was gone... though both of them include the line where the .dll is found!
    That's how it worked for me, but if anybody knows how it works without that dirty trick, it would be good.
    Regards,
    Leandro
    PS: Just in case that somebody is using the version JCSDK3.0, I did not find the .dll in that version, but in the JCSDK2.2.2 *(:-S)*

Maybe you are looking for

  • Project Management Vs Project Costing

    Hi, Is it true that I have to use Project Management(Project Super User responsibility) to create projects/templates in order to fully utilize Project Management Module(Project Super User responsibility)? Does it matter which responsibility/module yo

  • Memeber server in a domain connected with external trust. The agent operation failed, DPM could not communicate with the DPM agent. Error ID 270

    I manually installed the agent on a member server in a domain (domainB) that has an external trust with the domain the DPM 2010 server, mydpmserver.domainA.int,  is in. I pointed the agent on myprotectedserver with setdpmserver -dpmservername mydpmse

  • Itunes 6.0.4 - no sound

    upgraded to 6.0.4 and now when I play any content in itunes I get no sound from the speakers (soundsticks). The speakers work in other applications and have also lost the option of whether to select remote speakers connected through airport express.

  • Is it possible to add a JComponent as a JTree node? If yes then please help

    I am writing a java program in which I want to make my tree nodes editable by adding textfields, comboboxes, radiobuttons as nodes to the tree. So if anyone has any soluition please help!!!

  • Restoring Mail

    Last night I had a kernel panic (don't know why exactly) and one of the consequences is that Mail seems to be "reset" to most of its default settings. The biggest change is that my Gmail account is no longer recognized in Mail. Everything is still in