UILoader.content stays null after load

I've started with a new Flash file and wanted to toy around with loading images and resizing the UILoader to the size of the loaded image. I've added a UILoader (instance name: loadImage) component to the main timeline and added the following code in the Actions window:
loadImage.source = "bookmark.png";
trace( loadImage.content );
The image displays properly after compiling and viewing the SWF. However, loadImage.content returns null, instead of the DisplayObject that contains the image. This way, trying to resize the UIloader according to the loaded image doesn't work, since I can't access variables of an object that hasn't been initialized.
All the documentation states that loadImage.content should contain the DisplayObject that's loaded after setting loadImage.source or using loadImage.load( new URLRequest( "bookmark.png" ) ) (which also has the same problem). So I'm stumped.
Can anyone help me out?

The content is only defined when the loading has completed, which you need to set up an event listener to detect.
loadImage.source = "bookmark.png";
loadImage.addEventListener(Event.COMPLETE,imageLoadListener);
function imageLoadListener(e:Event):void{
trace( loadImage.content );
loading from an external source is 'asynchronous' which basically means actionscript continues to execute while its happening. You need to set up listeners to run when events happen for the asynchronous calls you make (in this case, setting the source property does that too, with autoLoad defaulting to true).

Similar Messages

  • Content viewer crashes after loading google map

    Greetings! I am making progress, finally on my first Edge Animate CC 2014 / InDesign CC 2014 DPS edition.
    I have finally gotten to the pplace where I need to display a Google Map for two different locations, each map will be loaded with a different button on click and replace the previous map. It works fine in the browser, but when I upload my folio through InDesign and load it into the Adobe Content Viewer on an iPad (Air) after clicking the MAP button (either one), the map loads and appears to be fine, then after about 10 seconds, the Viewer crashes. I have tried it repeatedly and by clicking both map buttons, the produce the same results.
    What should upload for someone to look at, or has anyone else ran into this issue?
    Below is the code for the Action(s):
    downtownMapButton:
    // insert code for mouse click here
    var mapFrame = sym.$("mapContainer");
    var map ='<iframe width="'+mapFrame.width()+'" height="'+mapFrame.height()+'" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://mapsengine.google.com/map/embed?mid=zE2zuZhUFeMU.kVkOwZos-Fiw" ></iframe>';
    mapFrame.html(map);
    // Show an element
    sym.$("mapBox").show();
    // Show an element
    sym.$("downtownPointerSym").show();
    // Show an element
    sym.$("mapContainer").show();
    sym.$("closeButtonSym").show();
    sym.$("prestonPointerSym").hide();

    Found a solution.
    https://blogs.adobe.com/indesigndocs/2013/06/memory.html
    Hopefully this helps someone else.
    Cheers!
    S

  • Premiere Elements 8 won't do anything after opening - and after loading contents disk

    Similar to an earlier thread, ie: http://forums.adobe.com/message/3058854#3058854 I couldn't get Premiere Elements to work - but this was back in July and I hadn't found the forums at that point, getting baffling lost trying to find anything at all useful on the Adobe website.
    Premiere Elements 8 did originally display an error message if you tried to open a project, ie I managed to open an existing project or create a new one, but the program only ever showed a blank screen and no menu options could be selected so these projects were empty. This error message appeared if I tried to open a project I'd just created with premiere elements 8. It didn't even seem to like its own files.
    It's a brand new pc, so it's never had any other versions of premiere on it. It came from Dell preloaded with premiere/photoshop elements but only the latter works.
    Initially I spent hours trying to get this to work, searching for clues on the Adobe website, but then other pressing things have intervened and I gave up on it until today.
    About the last thing I did was to download a trial version and install that and I entered my full version registration number when doing this. Still nada and I gave up.
    Well today I had another go. If I opened my empty project from the organiser I got a blank screen, then I tried again from within Premiere. I also tried opening it as a new project giving it the same name as the original. Surprise, surprise, it worked and the monitor and timeline, etc, appeared. However it was temperamental and if I closed the program down I seemed to have to open it a few times in Premiere (not the organiser that never seemed to work) before the workspace appeared.
    I should have thought myself lucky and left things like this. When the program started it reminded me that the stuff on the contents disk wasn't loaded. I decided to load it up too but in the process I got an error message. I think it said something about Framework 4 being loaded? by user system and that this needed to be changed. I let it go ahead and do this and left all the contents loading up. Takes a long time doesn't it? Needless to say this isn't the first time I've done this.
    Well it was after this that I arrived back at the blank screen, nothing opening up at all just as it was when I started - a little loading project window appears, the blue progress line gets to 100%, but the application screen remains grey and none of the menu options can be selected. I tried loading the 8.01 patch but this made no difference.
    Has anyone got any clues on this?
    It's a Dell Studio 15, i5, 4Gb RAM, Windows 7 Ultimate, 400 Gb free space.

    There may be some clue in that while I was briefly able to use the application I added a few picture files and put them on the timeline.
    Tidying up the pictures on the pc into one folder meant that one of these was no longer where Premiere Elements 8 expected it to be and on one of my trys at getting it to run again (with the same multiple attempts at opening a project as before) it did actually display a dialog asking for the missing file and then wonder of wonders the monitor window, timeline, etc, appeared as before.
    This meant that the menus are accessible at present and so I've been able to check the background rendering preference and it is set to off.
    Once I close the application down again I'm sure it's going to behave as before, ie blank screen again. True enough just tried this and it's back to blank screen mode. I didn't save the project so the files are still 'missing'.
    BTW I've already turned off Autoanalyse in the Organiser.

  • TS1702 I played HayDay on my iPhone until the app shut down very shortly after loading.  Then repeated that all on my iPad with same results, even though I am signing in through the Game Center.  Why doesn't the app stay open so I can play this enjoyable

    I played HayDay on my iPhone 4 to level 26-29 or so, then it didn't stay loaded when returning to play. Same scenario with iPad at level 26 even when signed in through Game Center.  Why does the game quit within a few seconds after loading?

    Never mind. I've did a hard reboot no matter how hard I pressed the power button. Thank goodness!!!

  • Loader Event.INIT fires but Loader.content is null

    The title describes the problem: Loader.load() is firing the INIT event, but in my listener it's reporting loader.content as null. The description for INIT event is "Dispatched by the associated LoaderInfo object when the properties and methods of    the loaded SWF file are accessible."
    I'm loading a lot of JPG images, and 95 percent of the time it works fine; the init listener fires and reports valid loader.content. I absolutely need loader.content available because I need to set the bitmap smoothing property to true.
    I've tried using Event.COMPLETE and it has the exact same problematic behavior.
    Any ideas?

    I didn't try contentLoaderInfo.content before. When the problem occurs, it throws this:
    Error: Error #2099: The loading object is not sufficiently loaded to provide this information.
    So INIT and COMPLETE fire, but it's not sufficiently loaded to even access the content? Weird.
    Note that in the event handler, Event.currentTarget points to the contentLoaderInfo, which may have the "content" defined, while it's not yet defined on the Loader instance yet. But thatt's just a wild guess though.
    Well what do you know, you're right. loader.content is null, loader.contentLoaderInfo.content is inaccessible, but event.currentTarget.content is available. I've tested around and sure enough, the same situations before where loader.content is null is now working fine with event.currentTarget.content -- I am able to cast the content as Bitmap, set smoothing to true, and resize the content.
    Kinda buggy if you ask me, but glad it's working now and it makes think I should use currentTarget more than often as it's apparently more reliable, at least in this situation it was.

  • Mac won't boot, starts with white apple screen and spinning wheel. Also has grey loading bar which disappears after loaded then stays at white apple screen.

    Mac won't boot, starts with white apple screen and spinning wheel. Also has grey loading bar which disappears after loaded then stays at white apple screen.

    Hi cybertoof,
    Welcome to Apple Support Communities.
    It sounds like you're seeing a startup issue with your Mac, it's booting to a gray screen with an Apple logo. Try the suggestions in the article linked below, they will resolve most issues related to starting up your Mac.
    Mac OS X: Gray screen appears during startup
    http://support.apple.com/kb/TS2570
    I hope this helps.
    -Jason

  • I can't get my games to stay open after they load. Please help.

    My games load but when games are about to start after loading they completely shut down.  No errors. Any suggestions?

    Hi Pam0656!
    I have an article for you that should be able to help you address this issue with your apps:
    iOS: An app you installed unexpectedly quits, stops responding, or won’t open
    http://support.apple.com/kb/ts1702
    Thanks for coming to the Apple Support Communities!
    Cheers,
    Braden

  • SkillBuilders Modal Page... closes immediately after loading

    I would like to use the Modal Page plug-in from http://www.skillbuilders.com .*
    I installed the two sample applications from their web site with different results:
    The employee example works fine.
    The example with the modal feedback worked fine yesterday, but today it shrinks (after loading normally) so that I can't see anything but the bar with the window name and the close button.
    In my own application it's even worse:
    I have links in a table which should open a modal window on click.
    I tried several settings, but the only thing that's happening is that the window closes immediately after loading and showing the page for a half a second (or not at all).
    Leaving the "Auto-close On Element Selector" empty did not work. The default value "div#success-message" kept coming back until I replaced it with "null". But still no effect.
    Does anyone have any idea what could cause this behaviour?
    Best regards,
    Sabine
    The Security Settings for all three applications:
    Cache: Enabled
    Embed in Frames: Allow

    In the meantime I had the problem that the window didn't close at all, but I think I figured it out.
    So if the Modal Plug In does not work properly, check the following:
    <li>Does every process that should close the window have a 'Success Message' defined?
    <li>In the unconditional branch, is "include process success message" checked?
    <li>In the dynamic action, is "Auto-close On Element Selector" set to "div.t1success" in the true action?
    BTW: The "shrinking problem" described in the first post still exists - in IE. In Firefox, it works fine.
    Best regards,
    Sabine

  • Why CreateNewFrame() returns as NULL after successful created 136 child frame window and trying to create 137th child frame window in MDI application

    I am working on MDI application which was developed in VC++ in VS 2012. When my application is launched, it will display a Tree. Under a tree there are 254 nodes. Basically
    these nodes data are read from Configuration xml file and loaded into the Tree. By double clicking on each node, first it will create object for document class ( By calling CreateNewDocument() method) after that member variables for that
    document class will be initialized and then it will create the new frame window (by calling
    CreateNewFrame(pDoc,NULL). New child frame window will show under Main window to the user.
    User able to see the data from child frame window.
    Similarly by double clicking on each node it will create another object for the same document class and new child frame window will be opened for that node. Each child frame window runs
    in different data and showed under the Main window.
    Existing requirement by double clicking on each node, node data shall show in separate child window and there is no requirement for all 254 child windows opened simultaneously.
    But current requirement is , all 254 child windows shall open simultaneously by double clicking on each node one by one.
    In debug mode I have tried double clicking on each node. I able to open up to 50 nodes. After 50th child windows are opened, I unable to access to the application
    (Unable to open further node data window since application is getting hanged).
    Each child window is having tree, multiple splitter window and some additional controls (static text, ...).
    Same I have tried in release mode, I able to open up to 136 child windows. After that the application fail to create the new frame window in VS 2012. i.e CreateNewFrame() return
    NULL after successful created 136 child frame window. Debug purpose I have added the code to retrieve last error code by calling GetLastError() method. I got the value as "0". By closing any existing child window then I able to open remaining nodes.
    At any point of time I can reach maximum of 136 child frame window that can be opened under Main window. Failing to open all 254 child frame window
    simultaneously,  currently I fail to meet the current requirement.
    current Requirement is all 254 child frame window are opened simultaneously. Please let me know what may be the reason fail to create new frame window after 136 frame window that are
    opened already. In Microsoft site, mentioned that there is no limitation for creating frame  window in MDI application. I have tried another sample MDI application having limited number of controls, in which I able to create "n"
    number of child frame windows. why not able to create more than 136 child frame window in my actual application?
    Is there any possibility by changing project settings allow me to create 254 child frame window??
    Code Snippet as below:
    CDiagBaseDoc * CDiagBaseMDocTemplate::OpenDiagView( ...)
         CDiagBaseDoc* pDoc = NULL;
        if (pDoc == NULL)
            pDoc = (CDiagBaseDoc*)CreateNewDocument();
        if ( pDoc )
           CFrameWnd* pFrame = NULL;
           if (bAlreadyOpen)
                  // If Child frame window already opened, then handling the code here.
         else
               pFrame = CreateNewFrame(pDoc, NULL);
               if (pFrame == NULL)
                  ASSERT(FALSE);
                  delete pDoc;       // explicit delete on error
                 pDoc = NULL;
              ASSERT_VALID(pFrame);
              if( pDoc != NULL ) //VS2012
                 if ( !pDoc->OnNewDocument() )
                    TRACE0("CDocument::OnNewDocument returned FALSE\n");
                    delete pDoc;       // explicit delete on error
                    pDoc = NULL;
                    pFrame->DestroyWindow();
                     pFrame = NULL;
           if (pFrame)
               InitialUpdateFrame(pFrame, pDoc);
               ShowWindow( pFrame->GetSafeHwnd(), SW_MAXIMIZE ); //when opening node for the 1st time, maximize it
    }<o:p></o:p>

    Hi MuruganK,
    Have you checked how much memory your application used? You could check it by Task Manager. Maybe your application reach Memory Limits for Windows.
    https://msdn.microsoft.com/en-us/library/windows/desktop/aa366778%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396
    Is it possible that there are some memory leaks in your application? It would better if you have made a simple sample to reproduce and narrow down this issue.
    Best regards,
    Shu
    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.

  • After load the pdf in this program, what commands must follow to make the correction (edit),

    if you use
    http://www.doc2pdf.net/
    you can convert doc >> pdf.
    I did try with some samples of files but, in some pages where a subheading is in eg page45, in pdf moved to page44, well to modify the pdf so is exact alignment like doc I must use ACROBAT? Well, conversions from this site must done non-restrict modify the pdf? well since I have Acrobat Pro 9, after load the pdf in this program, what commands must follow to make the correction (edit), and save the file?

    Unfortunately, for your endeavor, PDF is not a file format that supports edit-layout-format activities such as are in word processors.
    Not an "issue" - rather, it reflects what PDF was/is designed to be.
    While minor editing ("touchups") are possible extensive editing of PDF content is not.
    What you appear to have encounterd with the process used to convert something to PDF is something that happens rather too often.
    That is, many non-Adobe PDF creation processes to not provide "proper" PDF.
    Which is to say PDF built to the Adobe PDF References or, now, the ISO Standard for PDF (32000-1:2008).
    As you have Acrobat Pro perhaps using it to convert the document's authoring file to PDF via print to Distiller or via Adobe PDFMaker is something to consider. These convert to PDF per the PDF References/ISO Standard.
    Be well...

  • All my content appears on page load - is this Spry related?

    I remember having this issue when using Spry in the past. I changed the padding settings I think, and all the Accordions were open on page load - for only a second - and then closed.
    I'm working with a new site, and the template seemed fine but when I populate, all tabbed-content and a scroller content appear on page load. Then snap shut. Is it related? or a similar issue... I'm pretty desperate to be posting here but I it looks like the same sort of problem I had with Spry... maybe the template has been built with some of the same technology (?)
    http://bit.ly/ptaBVN
    Please help!

    Try this:
    1. Set a class that sets visibiliity to hidden:
    .hideGroup{visibility:hidden;}
    2. Add this class to your content group:
    <div class="SlidingPanelsContentGroup hideGroup">
    3. Add a line to sp_unobtrusive.js to remove this new class
    after the widget made.
    Spry.$$(".SlidingPanelsContentGroup").removeClassName("hideGroup");
    Add that right under the addEventListener lines.
    That should do it.
    Don

  • Changes In Business Content and Extractors after r/3 upgrade

    Hi All,
    We are in the process of upgrading from R/3 4.0b to ECC 6.0.
    with the BW system bein upgraded to BI 7.0
    Question.
    What changes would occur for the business content and extractors after the R/3 upgrade.
    Thanks in advace.
    Regards,
    Nikhil.S

    Hi Nikhil
    The datasources remain same, U can migrate them in BI side from 3.5 to 7.0 using RSDS -tcode.
    All extractors remains same, Well it again depends on the service packs u r using.
    Now the latest for BI is service pack 17 and for Business content patch is Patch 10.
    U can find new datasources like 0FI_GL_14 and 0FI_GL_40 and many other queries.
    In BI side
    1.If you have update rules you will have to create transformations and there is no shortcut here ..if there are routines you will have to write them as well and change the syntax as some of the old syntax of 3.x is no more valid in BI 7.
    2.Data loading concept changes as you can bypass the Infosource(but in few places you will need it actually like when you are directly loading from datasource to target and you want to read master data).
    3.DTPs will be required..changes in the Process chains for the same.
    4.Datasources need migration(first emulate them and test whether the Bi 7 loaidng is working or not otherwise if you migrate you will loose your transfer rule.
    Reward if helped
    thanks

  • Not able to access KM Content in EP after successfull installation

    Hi all,
    I had installed CO & CM (EP 6.0 SP2). I was able to access KM Content under Content Management immediately after that. But when i restarted my dispacther and logged into the portal, i was getting this exception in KM content area:
    Exception class: class com.sapportals.wdf.WdfException
    Exception Message : The URI "null" you tried to navigate to does not exist. It has either been deleted or you have no access rights.
    Any idea why this is happening? I had already done the insatllation twice because of this error (after restoring the Backup, ofcourse). Any pointers would eb of great help.
    Thanks,
    Ramya.

    Hi,
    Which Patch r u in. We got this error while installing EP6SP2Patch5. did u install correct database patch. Look at SAP Note 523026 -->Exceptions if DB Patch does not correspond to CM coding. Let me know if u need anything else. some more useful CM notes are 742763
    Thanks,
    Praveen
    PS.Dont forget to reward points if useful/solved

  • Content Selector is not loading during deployment

    Hi Alll,
    I am using weblogic portal 10.2 and MySQL 5.0.
    I have created content selector during developement using workshop.
    and deployed the same EAR in Staging server.
    But content selector is not loaded after deployment.
    I got confirmation after checking adminconsole ->> Content Selectors(Which will be displayed in home page of admin console after login)
    And i can see that , other changes ,,JSP Changes...are reflected as part of deployment.
    Please let me know what might be the poblem,for not loading content selector??
    Is there any number of restrictions on number of content selectors for an environment??
    Srinivas

    hi
    production mode does have the behavior you see, and there are good reasons why this must be so.
    You mean to say, we need to propagate Content selectors from STAGING to PRODUCTION??Yes you need to propagate from an environment which has all the data you want correctly to your production environment. You can scope the propagation to only Content Selectors (if you want, the documentation has data how you can do this) and you can run this via GUI or via ANT.
    regards
    deepak

  • How to correctly resize a component after loading using SWFLoader

    In an app, I load SWFs into an AIR app, which manages them.
    The AIR app loads the SWF, then creates a 'master' component, which
    manages the loaded SWF. 'manages' means resize, move or provide
    persisted preference values.
    My own test Flex SWFs work OK, while another SWF does not.
    Here's a screenhot:
    http://www.flexolero.com/demos/Portal/shot.png
    Note, that only some part of the loaded Clock resized
    correctly.
    The actual resize is done like this:
    quote:
    public function resize( newW:int, newH:int ):void {
    var loadedSM:SystemManager = SystemManager( ( _inner as
    SWFLoader ).content );
    if ( ( null != _inner )
    && ( null != loadedSM )
    && ( null != loadedSM.application )
    // BindingUtils.bindProperty( lblFromRemote, "text",
    loadedSM.application, '_outChannel' );
    // loadedSM.application[ 'inChannel' ] = 'New';
    loadedSM.application[ 'width' ] = newW-20;
    loadedSM.application[ 'height' ] = newH-20;
    this.width = newW;
    this.height = newH;
    _inner.invalidateSize();
    drawHandles();
    If the Air app finishes loading the SWF, the master component
    attaches a method to the managed SWF:
    (_inner as UIComponent).addEventListener( Event.RENDER,
    fixSizes );
    Actually, Clock sample does not resize as expected at the
    first time it appears.
    Once the Clock is on stage, and I resize it using the mouse,
    it resized as expected.
    Could someone provide a hint?

    maybe you need to calculate scaleX, scaleY instead?
    "justria" <[email protected]> wrote in
    message
    news:g8fbml$e7c$[email protected]..
    > In an app, I load SWFs into an AIR app, which manages
    them. The AIR app
    > loads
    > the SWF, then creates a 'master' component, which
    manages the loaded SWF.
    > 'manages' means resize, move or provide persisted
    preference values.
    >
    > My own test Flex SWFs work OK, while another SWF does
    not. Here's a
    > screenhot:
    >
    >
    http://www.flexolero.com/demos/Portal/shot.png
    >
    > Note, that only some part of the loaded Clock resized
    correctly.
    >
    > The actual resize is done like this:
    >
    >
    quote:
    public function resize( newW:int, newH:int ):void {
    >
    > var loadedSM:SystemManager = SystemManager( ( _inner as
    SWFLoader
    > ).content );
    >
    > if ( ( null != _inner )
    > && ( null != loadedSM )
    > && ( null != loadedSM.application )
    > ) {
    > // BindingUtils.bindProperty( lblFromRemote, "text",
    > loadedSM.application, '_outChannel' );
    > // loadedSM.application[ 'inChannel' ] = 'New';
    > loadedSM.application[ 'width' ] = newW-20;
    > loadedSM.application[ 'height' ] = newH-20;
    > this.width = newW;
    > this.height = newH;
    > _inner.invalidateSize();
    >
    > drawHandles();
    > }
    >
    > }
    >
    >
    > If the Air app finishes loading the SWF, the master
    component attaches a
    > method to the managed SWF:
    >
    > (_inner as UIComponent).addEventListener( Event.RENDER,
    fixSizes );
    >
    > Actually, Clock sample does not resize as expected at
    the first time it
    > appears.
    >
    > Once the Clock is on stage, and I resize it using the
    mouse, it resized as
    > expected.
    >
    > Could someone provide a hint?
    >
    >
    >
    >
    >
    >
    >

Maybe you are looking for