Error Handling when File/URL not found

I am paging through a list of items in a datagrid and calling
a URL (actually a local file) based upon which item in the grid was
clicked. I'd like to throw an error if the file does not exist, but
I can't figure out how. Can some one give me a clue? The docs on
this subject are confusing to me. Here is the code:
//add the search function for when the button is pressed
import fl.controls.DataGrid;
import fl.data.DataProvider;
import fl.events.ListEvent;
import flash.display.Sprite;
getAcrobat.addEventListener(MouseEvent.CLICK,acroReader);
backButton.addEventListener(MouseEvent.CLICK,goBack);
litGrid.addEventListener(ListEvent.ITEM_CLICK,showPDF);
function acroReader(e:MouseEvent) {
var urlAcro:String = "
http://www.adobe.com/products/acrobat/readstep2.html";
var request:URLRequest = new URLRequest(urlAcro);
try {
navigateToURL(request, '_blank');// second argument is
target
} catch (e:Error) {
trace("Page was not found!");
function goBack(e:MouseEvent) {
gotoAndPlay(1,"Scene 1");
var XMLLiterature:XML = new XML();
var XMLLit:URLRequest = new URLRequest("literature.xml");
var XMLLoad:URLLoader = new URLLoader(XMLLit);
var urlArray:Array = new Array();
var theSelection:int = 0;
XMLLoad.addEventListener(Event.COMPLETE,loadLit);
function loadLit(e:Event):void {
XMLLiterature = new XML(e.target.data);
for each (var item in XMLLiterature.lit) {
var litTitle = item.litTitle;
var url = item.fileName;
//var fileName = item.fileName;
litGrid.addItem({AvailableLiterature:litTitle});
//urlArray.push({Title:litTitle,url:url});
function showPDF(e:ListEvent):void {
var theSelection = e.rowIndex;
var theRequest =
"pdf/"+XMLLiterature.lit.fileName[theSelection];
var theLitRequest:URLRequest = new URLRequest(theRequest);
try {
navigateToURL(theLitRequest, '_blank');// second argument is
target
} catch (err:Error) {
trace("Page was not found!");
stop();

When you setup your URLLoader, also listen for an
IOErrorEvent, which will fire if the file does not exist. Here is
an example:
package {
import flash.display.Sprite;
import flash.events.IOErrorEvent;
import flash.net.URLLoader;
import flash.net.URLRequest;
public class IOErrorEventExample extends Sprite {
public function IOErrorEventExample() {
var loader:URLLoader = new URLLoader();
loader.addEventListener(IOErrorEvent.IO_ERROR,
ioErrorHandler);
var request:URLRequest = new URLRequest("MissingFile.xml");
loader.load(request);
private function ioErrorHandler(event:IOErrorEvent):void {
trace("ioErrorHandler: " + event);
}

Similar Messages

  • Getting authorization error message: Required file was not found or has a permissions error. Correct this permissions problem and try again, or deauthorize this computer if the permissions cannot be changed.

    I have recently purchased this MacBook used and am trying to authorize it on the iTunes Store but even after uninstalling iTunes and re-installing it with a fresh copy I'm getting this error message: "The required file was not found or has a permissions error. Correct this permissions problem and try again, or deauthorize this computer if the permissions cannot be changed."  And I have no idea of where or how to fix this issue.  Any help or suggestions will be greatly appreciated.  I even tried to deauthorize this computer and got the same error message.  HELP!

    I used Terminal to change the permissions on the folder in question.  I followed the instructions in this article:
    iTunes: Missing folder or incorrect permissions may prevent authorization
    In my case, the folder was there, so I needed the command to change permissions on the folder, not to create one.   I was hesitant to use Terminal b/c I know that if I made an error I could wipe out my hard drive or render my computer unusable.  So to be SURE I didn't make an error, I carefully copied the command from that page and *pasted* it into Terminal.  Also, before I could do anything in Terminal, I had to go change my admin password (it had been a blank password before and that's not acceptable for making changes in Terminal).  I was just super careful when entering my password or doing anything else while Terminal was open (making sure I didn't accidently hit the spacebar or another key, etc.)  And it fixed the problem right away.
    What was confusing for me was that the iTunes error message said to change permissions in the FINDER, which is what I was trying to do.  It didn't mention Terminal.  What would really be helpful is if Apple included a link to a page like this in their error message.

  • Sun One Directory Proxy unable to start error DPS.pid file was not found

    We finally able to install Sun One Directory Proxy 5.2 , but we are unable to start the Proxy server, we are getting error "Since the DPS.pid file was not found, DPS-server is assumed down
    Anybody has any clue / ideas that we would very help fulll?
    Thank

    I've been struggling with this and another problem with DPS for a couple of weeks.
    It generally starts up fine when you dont have SSL enabled. The moment you enable SSL, a couple of things go for a toss:
    1. The problem mentioned above surfaces. Are you facing this problem even without SSL?
    2. If you log into the Administration console, and try to make changes to the DPS configuration, it will give an error stating that "Error in writing to Configuration Directory". But apparently, it will manage to save things. Just that when you try to start it with SSL enabled, it won't. Neither from the command line, nor the GUI.
    Anyone managed to fix this? Sun informed us that there is a problem with Jars, but thats about it.

  • I am getting an error that the file is not found when I sync my photos on my 3gs phone

    I am trying to update my phone with my new pics and when I tried to sync it I am getting an error message that states the Iphone cannot be synced because the file cannot be found. How do I correct this I have an Ipad and I dont want to try syncing it till I get this error fixed with my phone

    Try deleting what is called the iPod photo cache from your computer's hard drive.
    http://support.apple.com/kb/ts1314

  • Itunes wont start, i tried to repair with a reinstall and i still get an error saying this file is not found, "MSVCR80.dll"

    somehow my itunes program became corrupted when i tried to update my Quicktime player.  the upgrade was interupted and aftward when i tried to boot my itunes, an error window popped up saying that this file could not be found, "MSVCR80.dll "  I attempted to reinstall a repair about a dozen times but that's not fixing the problem.  i do not want to uninstall as i may lose data that hasn't been synched yet.  how can i get this file from Apple and manually instal it?

    Go to Control Panel > Add or Remove Programs (Win XP) or Programs and Features (later)
    Remove all of these items in the following order:
    iTunes
    Apple Software Update
    Apple Mobile Device Support (if this won't uninstall move on to the next item)
    Bonjour
    Apple Application Support
    Reboot, download iTunes, then reinstall, either using an account with administrative rights, or right-clicking the downloaded installer and selecting Run as Administrator.
    The uninstall and reinstall process will preserve your iTunes library and settings, but ideally you would back up the library and your other important personal documents and data on a regular basis. See this user tip for a suggested technique.
    Please note:
    Some users may need to follow all the steps in whichever of the following support documents applies to their system. These include some additional manual file and folder deletions not mentioned above.
    HT1925: Removing and Reinstalling iTunes for Windows XP
    HT1923: Removing and reinstalling iTunes for Windows Vista, Windows 7, or Windows 8
    tt2

  • Error message when hyperlink page not found

    I have setup hyperlink for one of the field. I would like to display error message when hyperlink page is not exists. Currently it displays standard page not found error.
    Message was edited by:
    user448086

    This sometimes is the result of firewall software protecting you from changed applications. Or it might be something else. Can you review this article and see whether it helps: [[Firefox can't load websites but other browsers can]].

  • URL not found error while loading photo on Linux

    Hi,
    I have a AIR 2.0 appliaction which works perfectly well on Windows but while I run it on Linux Loader object can't load any photo. I tried many path variations but I always get Error #2035: URL Not Found.
    Here's how I load a photo (with hard coded URL)
    _imageLoader.load(new URLRequest("/home/piotr/105755/damage_photos/17.jpg"));
    I'm sure that "/home/piotr/105755/damage_photos/" path is correct. I pasted it to files explorer address text input and expected directory was opend. I'm also sure that 17.jpg file exists in that directory.
    When I trace IOError message it says: Error #2035: URL Not Found. URL: app:/home/piotr/105755/damage_photos/17.jpg
    My questions are:
    What "app:" does in my URL... can it cause the problem? If yes, how can I get rid of it?
    Is there anything specific about UNIX systems and Loader that should I know about?
    How can I load file from hard drive other way than by Loader object?
    I use AIR 2.0 SKD, Flex 4.5 SKD and Ubuntu 10.04. Could anyone help me, please?

    Hi,
    Just a test, can you try to do this:
    var f:File = new File(File.userDirectory.nativePath+File.separator+"105755"+File.separator+"damage_photos" +File.separator+"17.jpg");
    _imageLoader.load(new URLRequest(f.url));

  • Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.

    I get this error:
    Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.
    Here is my code:
    import fl.transitions.*;
    import fl.transitions.easing.*;
    //Assign CLICK listeners for each menu button
    Home.addEventListener (MouseEvent.CLICK, buttonClicked);
    Big_Square_Baling.addEventListener (MouseEvent.CLICK, buttonClicked);
    Wrapping.addEventListener (MouseEvent.CLICK, buttonClicked);
    Chopping.addEventListener (MouseEvent.CLICK, buttonClicked);
    Tillage.addEventListener (MouseEvent.CLICK, buttonClicked);
    Raking.addEventListener (MouseEvent.CLICK, buttonClicked);
    //Make the buttons look like buttons
    Home.buttonMode = true;
    Big_Square_Baling.buttonMode = true;
    Wrapping.buttonMode = true;
    Chopping.buttonMode = true;
    Tillage.buttonMode = true;
    Raking.buttonMode = true;
    //This loader is used to load the external swf files
    var loader:Loader;
    //URLRequest stores the path to the file to be loaded
    var urlRequest:URLRequest;
    //This array holds all the tweens, so they
    //don't get garbage collected
    var tweens:Array = new Array();
    //Stores the current page we are displaying
    var currentPage:MovieClip = null;
    //Stores the next page that we are going to display
    var nextPage:MovieClip = null;
    //This function is called when a menu button is clicked
    function buttonClicked (e:Event):void {
    //Create a new loader instance
    loader = new Loader();
    //If we clicked the first button, we load the the Home page
    if (e.target == Home) {
    urlRequest = new URLRequest("Home.swf");
    loader.load (urlRequest);
    //If we clicked the second button, we load the Big Square Baling page
    else if (e.target == Big_Square_Baling) {
    urlRequest = new URLRequest("Big_Square_Baling.swf");
    loader.load (urlRequest);
    //We load the Big Square Bale Wrapping page since we know that the home page or the Big Square Baling page
    //is not clicked
    else if (e.target == Wrapping) {
    urlRequest = new URLRequest("Wrapping.swf");
    loader.load (urlRequest);
    //We load the Chopping page since we know that the home page, the Big Square Baling page, or the
    //Big Square Bale Wrapping page is not clicked
    else if (e.target == Chopping) {
    urlRequest = new URLRequest("Chopping.swf");
    loader.load (urlRequest);
    //We load the Tillage page since we know that that the home page, the Big Square Baling page, the
    //Big Square Bale Wrapping page, and the Chopping page is not clicked
    else if (e.target == Tillage) {
    urlRequest = new URLRequest("Tillage.swf");
    loader.load (urlRequest);
    //We load the Raking page since we know that the home page, the Big Square Baling page, the
    //Big Square Bale Wrapping page the Chopping page, and the Tillage page is not clicked
    else {
      urlRequest = new URLRequest("Raking.swf");
      loader.load (urlRequest);
    //We want to know when the next page is finished loading
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE, fileLoaded);
    //This function is called, when we have finished loading a content page
    function fileLoaded(e:Event):void {
    //The loader contains the page we are going to display.
    nextPage = e.target.content;
    //Let's animate the current page away from the stage.
    //First, we need to make sure there is a current page on the stage.
    if(currentPage != null) {
      //Tween the current page from left to the right
      var tweenX:Tween = new Tween(currentPage, "x", Regular.easeOut,
          currentPage.x, 500, 1, true);
      //Decrease the alpha to zero
      var tweenAlpha:Tween = new Tween(currentPage, "alpha", Regular.easeOut,
          1, 0, 1, true);
      //Push the tweens into an array
      tweens.push(tweenX);
      tweens.push(tweenAlpha);
      //currentPageGone will be called when the tween is finished
      tweenX.addEventListener(TweenEvent.MOTION_FINISH, currentPageGone);
    //There is no current page, so we can animate the next
    //page to the stage. The animation is done in
    //the showNextPage function.
    else {
      showNextPage();
    //This function animates and displayes the next page
    function showNextPage():void {
      //Tween the next page from left to the center
      var tweenX:Tween = new Tween(nextPage, "x", Regular.easeOut,
          -200, 0, 1, true);
      //Tween the alpha to from 0 to 1
      var tweenAlpha:Tween = new Tween(nextPage, "alpha", Regular.easeOut,
          0, 1, 1, true);
      //Push the tweens into an array
      tweens.push(tweenX);
      tweens.push(tweenAlpha);
      //Add the next page to the stage
      addChild(nextPage);
      //Next page is now our current page
      currentPage = nextPage;
    //This function is called when the current page has been animated away
    function currentPageGone(e:Event):void {
    //Remove the current page completely
    removeChild(currentPage);
    //Let's show the next page
    showNextPage();

    To help figure out what's wrong, you can use an absolute path to your SWF files. (Such as "C:/Program Files/My Project/MySWF.swf") If the error goes away, then the filename is correct and there is simply some confusion as to where the local path is. Remember that the parent project (your main.swf) should be in the exact same directory as the SWFs being loaded)
    ~Plystire

  • My movies are giving a URL not found on server error message, last week they worked fine. After deleting one of them, I don't get any retries for a free download. How do I contact the seller to complain?

    My movies are giving a URL not found on server error message, last week they worked fine. After deleting one of them, I don't get any retries for a free download. How do I contact the seller to complain? Obviously the one of the other movies first..

    Stan -
    Thanks again for the simple but valuable tip.
    I'm just going to repeat the relevant sections from my previous post with the screenshots this time:
    Below you'll see a snip of how my current folder structure appears. It's identical to yours, except there are no button files in the General Folder. Since you were kind enough to include a file name, I did a search on that specific one and it's nowhere to be found on my hard drive. Hmmm....
    I've seen others remark on how... "challenging".... Adobe's instructions can be sometime. I'll admit to having the same feeling when I was trying to download and install all the content files and the 7-zip stuff. Is the answer somehow that I screwed up that?  Note the 7-zip folder right above the Adobe folder. Here's a screen shot of that expanded folder contents:
    Does that look like you think it should? Have I not installed or extracted something correctly?
    Finally, the only other thing I can think of to give you as much info as you might need is to include a screenshot of where the "Functional Content" stuff got saved. Adobe's instructions about this (if I recall correctly) were that it did NOT have to be installed anywhere specific, but you then had to go into Encore (& Premiere) and through preferences point to this stuff, which I believe I did. But I don't see any button type files in these anyway.
    Other thoughts or advice?
    Thanks!

  • When trying to download the latest version of iTunes, I receive the following error "Apple Application Support was not found", any suggestions?

    When trying to download the latest version of iTunes, I receive the following error "Apple Application Support was not found", any suggestions?

    For general advice see Troubleshooting issues with iTunes for Windows updates.
    The steps in the second box are a guide to removing everything related to iTunes and then rebuilding it, which is often a good starting point unless the symptoms indicate a more specific approach. Review the other boxes and the list of support documents further down page in case one of them applies.
    Your library should be unaffected by these steps but there is backup and recovery advice elsewhere in the user tip.
    The section Install missing components has advice on breaking down the iTunes installer into the individual .msi files which might prove useful if one component, such as Apple Application Support, won't install normally.
    tt2

  • Error code; original file could not be found, would you like to locate it?

    when i try to transfer songs from my library to my ipod shuffle, i get this error message (error code; original file could not be found, would you like to locate it?). Then an exclamation point(!) in the first column it appears next to the song in the library.
    When i go to the folder mymusic/itunes/itunesmusic folder, the song is there, but why is there an exclamation point next to the song in the library? And how do I restore all these songs, and what causes this?

    Sounds like your iTunes .ITL library file got corrupted.
    What are the iTunes library files?
    There are some posts around here by Buegie on how to fix that...

  • Error message - Original file could not be found

    When I open itunes, and try to click on a song, there is an "!" and I get the error message "original file could not be found. Would you like to locate it?"
    It does this for every song. I have to trace it down to "My Music\itunes\itunes\itunes music" and under that I have hundreds of files by artist.
    How can I listen to the songs so I don't have to click on each one to make them play?
    I hope you can help me.

    First, a correction from my previous post: At the beginning I meant to write The iPod wasn't designed to sync playlist-related information back to iTunes.
    And as for the polydorus link, let's try this .
    Sorry about that.
    Does that make sense? Do I need both folders?
    No, in the end you'll only need one but I'm still not sure which one.
    *I think the difference is there are no folders like in wndows, but the itunes library leads me directly to my library on the itunes website
    I don't understand what you mean by the itunes library leads me directly to my library on the itunes website.
    It sounds like there is only one iTunes database - iTunes Library.itl - file and that it's in your iTunes1 folder. Whether or not that is the case, what I'd like you to do is follow the instructions in this article in the Apple Knowledge Base for opening an alternate iTune Library file. Select the Choose Library option and use the navigtion window that appears to make your way to an .itl file.
    Select the .itl and iTunes will open with a Library that may - or may not - be different than what you last saw: somewhat different contents or exclamation marks may be present again.
    If it's not a library you're happy with, close iTunes, wait ten seconds or so and then repeat the procedure looking for another .itl file - each one contains references for a different iTunes library.
    When you find a library you're happy with, i.e. all the contents are listed and no exclamation marks, make a note of the location of that .itl. It's the one you're going to want to work with.
    Using that database file, you can go back to iTunes, right-click various songs > Get Info > Summary tab and look to the bottom of that window to find out where that Library is being directed for those files. Make a note of that location.
    When we know those two things, we should be able to proceed from there with deleting things.
    In the future, when I buy new songs from apple, where will they automatically get stored?
    In the location that's been selected in iTunes Edit menu > Preferences > Advanced tab for the iTunes Music folder.
    What will happen when I sync my ipod on the computer?
    That brings us back to the beginning of this post, by default the synch goes from iTunes to your iPod. So you shouldn't synch your iPod unless there's a satisfactory Library being displayed in iTunes.

  • I can't sync my macbook air with my ipad, problems with authorization... this keeps cropping up: "The required file was not found or has a permissions error. Correct this permissions problem and try again, or deauthorize this computer if the permi"

    Help, cannot sync completely with my ipad, and i also cannot remove or delete shared photos which are clogging up my ipad 64GB memory! Some issue with this keeps croppin gup, so frustrating:
    "The required file was not found or has a permissions error. Correct this permissions problem and try again, or deauthorize this computer if the permissions cannot be changed."
    Not sure how we can correct his permissions problem, and whether authorising or deautorizing makes any difference, with more and more errors keep popping up, this got to be such after an update of the OS, can remember which!?
    HELP!!!

    follow this:
    Launch iTunes
    select iTunes Store from the menu on the left side.
    sign in via the link on the top right area if you haven't done so already
    click the link where you Apple ID email appears, enter your Apple ID password, click View Account, this will take you to a page displaying detailed information about your Apple ID account.
    The last item under Apple ID summary should be Computer Authorisations, click Deauthorize All
    now reauthorize any computers as needed when the system prompts you.
    good luck.

  • I am trying to back up my new iPhone after downloading/updating iTunes with iCloud. I get this message: The required file was not found or has a permissions error. Correct this permissions problem and try again, or deauthorize this computer if the permiss

    I am trying to back up my new iPhone after downloading/updating iTunes with iCloud. I get this message: The required file was not found or has a permissions error. Correct this permissions problem and try again, or deauthorize this computer if the permiss
    how do I find the file and replace it or install it?

    I'll reload it tonight when I get home...basically, I bought a new iPhone and downloaded some new medical apps. also had to download an update for iTunes into my mac laptop so I could access iCloud (which was NOT on my prior iTunes software)
    When I synched my new iPhone with the newly downloaded iTunes, I registered my iphone and tried to "back it up" to iCloud and the message indicating that "the required file was not found or has a permissions error...." popped up.
    How do I correct the permissions error, or...am I able to do this somewhere? Or...how do I find the file that is missing?
    Dr. Bob001

  • I keep getting this error message The required file was not found or has a permissions error. Correct this permissions problem and try again, or deauthorize this computer if the permissions cannot be changed.

    I keep getting this messae when I try to share itune to my new mac The required file was not found or has a permissions error. Correct this permissions problem and try again, or deauthorize this computer if the permissions cannot be changed.

    Doublechecking. In the course of your troubleshooting to date, have you worked through the instructions from the following document?
    iTunes: Missing folder or incorrect permissions may prevent authorization

Maybe you are looking for

  • Table of balance stock split by status stock on posting date

    Could you please suggest me for  the table of balance stock split by status stock on posting date? MCHB can not support my requirement because it  has current stocks.

  • CCTV DVR No Longer Showing Images On IE9

    Hi there, I hope someone may have an idea as to what may be causing the below issue. Our business has a CCTV DVR that we have been using via Internet Explorer successfully for over 12 months now. However, since updating to IE9 on a few of our Windows

  • Best Way to Get Indexed in Google

    What is the best technique for indexing a new site in google? I have been using social bookmarking with good success, but I was wondering what everyone else is doing.

  • Difference between Oracle 10g and Oracle 11g when using Distinct in SQL

    Hi All, When I use Distinct in Oracle 10g, the result would be sorted in ascending order automatically, while there is no sorting in the result set in Oracle 11g. I was using plsql developer to run my sql. May I know if anyone have the same experienc

  • POST FOLLOW-UP QUESTIONS FROM 1/21/11 DIRECTIONSMAG WEBINAR HERE

    We're trying something new. If you have any questions you didn't get to ask after the Directionmag.com Webinar "Maps, BI and Network Management-- Together at Last" aired on Jan. 21, 2011, please post them here and we will answer them. If you missed t