+ Reply to Thread
Results 1 to 5 of 5

Thread: Adobe Flash CS4 not loading external SWF files into UILoader

  1. #1
    smithee's Avatar
    smithee is offline x10Hosting Member smithee is an unknown quantity at this point
    Join Date
    Aug 2009
    Location
    NIMBY
    Posts
    45

    Question Adobe Flash CS4 not loading external SWF files into UILoader

    Hi everyone,

    I'm following a tutorial book I've borrowed from a friend of mine on ActionScript 3.0. It's for Adobe Flash CS5, but I'm adapting, and creating my own files instead of using the ones mentioned in the tutorials.

    Anyways, I'm up to the stage where it describes the process of loading external files dynamically by using a UILoader component. I have followed it to a tee, however when I came round to test it, it doesn't seem to load it properly. In the book, it describes that it "will seamlessly load into the interface with its full functionality"... but it doesn't! To test if it may be the scripting itself, I've added a random image into the list to see if it will load that, of which it does. Therefore I don't think it's anything to do with the scripts themselves, which is why I'm posting this here and not in Programming Help.

    Can anyone shed any light onto this? Files can be downloaded below for personal analysis (in a ZIP folder). The files in concern are "uiloader.fla" and "uiloader.swf":

    http://csmith.x10hosting.com/tutoria...toUILoader.zip

    Here's a preview of the .fla file:
    Adobe Flash CS4 not loading external SWF files into UILoader-uiloader_flashscreenshot.png

    Many thanks!
    .

    Be nice to nerds. Chances are you’ll end up working for one. - Bill Gates

  2. #2
    sankalpgarud98 is offline x10 Sophmore sankalpgarud98 is an unknown quantity at this point
    Join Date
    Feb 2011
    Posts
    107

    Re: Adobe Flash CS4 not loading external SWF files into UILoader

    Hey, why dont you try to load that file not by using action script but by using flash itself. I dont remember the name now, but its something like uiloader properties or somewhere along those lines. If that files successfully loads, then you may have problem with the script, I know uve tested with another file.I probably think that you are trying to load a file which isnt supported by the UI loader.
    cheers mate, you just refreshed my memories with flash coz Ive left it this year to devote more time in academics.
    Thx
    Love to help
    visit http://adobewhatisit.x10.mx for free tutorials and articles.
    If you like to posts articles and help others, you are welcomed as well...

  3. #3
    smithee's Avatar
    smithee is offline x10Hosting Member smithee is an unknown quantity at this point
    Join Date
    Aug 2009
    Location
    NIMBY
    Posts
    45

    Smile Re: Adobe Flash CS4 not loading external SWF files into UILoader

    Quote Originally Posted by sankalpgarud98 View Post
    Hey, why dont you try to load that file not by using action script but by using flash itself. I dont remember the name now, but its something like uiloader properties or somewhere along those lines. If that files successfully loads, then you may have problem with the script, I know uve tested with another file.I probably think that you are trying to load a file which isnt supported by the UI loader.
    cheers mate, you just refreshed my memories with flash coz Ive left it this year to devote more time in academics.
    Thx
    Okay, that sounds like an idea to test what's what. I've created a new Flash file, and just put a UILoader straight in, and defined it without any AS. This was done by clicking it, going to the Component Inspector, and manually entering in the file to load. I tested this on the image, which works fine. I've then tested this on a newly created SWF file that simply has scribbles on, and that shows up fine. When loading both of the SWF files as before, neither was working. Therefore it must be the scripting in them.

    To determine what it didn't like, I copied over assets across from instruments.swf bit by bit to the SWF that did work, starting with the button, and then parts of the code itself. The strange thing is that I copied everything across, and that file works! I then did the same for paint.swf, and the same results appeared! When I loaded them into the original uiloader.fla/swf, they actually worked!

    Well... one at a time. When I ran it, it will load one up fine, and then when you proceed to view the next one, you get errors like this:

    Code:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    	at noAS_test_fla::MainTimeline/startDrawing()
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    	at noAS_test_fla::MainTimeline/stopDrawing()
    If you went to re-launch the movie and click the second one first, that will load up fine... but the first one wouldn't! I'm guessing that's due to the EventListeners for the previous clip is still being called, as I'm still able to draw when I click "Instruments".

    It's a shame you can't have destructor that get automatically called, like in C++. I could have used such a thing to automatically remove the listeners.

    Thanks for suggesting your method! Looks like a bug to me, but I suppose I'll have to live with it...
    .

    Be nice to nerds. Chances are you’ll end up working for one. - Bill Gates

  4. #4
    sankalpgarud98 is offline x10 Sophmore sankalpgarud98 is an unknown quantity at this point
    Join Date
    Feb 2011
    Posts
    107

    Re: Adobe Flash CS4 not loading external SWF files into UILoader

    type errors are very very common and generally are nonsense.... although some are genuine...
    When you migrated all the codes and assets, there is a possibility that you havent changed its paths (location on your system) . Thats the probable reason i can think of. What you said, the automatic event destructors arent available in as3 , but I remember there was a stop code. Also you may wanna try stopping it with a function ie embedding a stop code inside of a function and then triggering it whenever needed. Sorry I couldnt be specific because i could not remember...
    cheers and toasts
    Love to help
    visit http://adobewhatisit.x10.mx for free tutorials and articles.
    If you like to posts articles and help others, you are welcomed as well...

  5. #5
    hieufpt156 is offline x10Hosting Member hieufpt156 is an unknown quantity at this point
    Join Date
    Apr 2011
    Posts
    19

    Re: Adobe Flash CS4 not loading external SWF files into UILoader

    you are trying reinstall Flash player new Verson

+ Reply to Thread

Similar Threads

  1. Free Copy of Adobe Flash Builder 4
    By Danielx386 in forum Computers & Technology
    Replies: 4
    Last Post: 03-24-2010, 06:57 PM
  2. Adobe Flash crashes
    By Mitch in forum Computers & Technology
    Replies: 3
    Last Post: 11-11-2008, 12:50 AM
  3. Adobe unveils Reader 9 with Flash
    By pokerhaji in forum Off Topic
    Replies: 0
    Last Post: 07-02-2008, 01:12 AM
  4. PHP / mySQL variable issue with Adobe flash
    By cvocvo in forum Free Hosting
    Replies: 0
    Last Post: 01-21-2008, 06:50 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers