Can't access instances and functions in MC

In this example, the code works fine on properties of a
dynamically generated MC (alpha, name, etc...). However, it fails
to access anything inside of the same MC (textFields, functions
etc).
Why?

You are not adding the content to the stage at 0,0, you are adding it to panel2 at 0,0.  THen you take panel2 and assign it to be something that likely doesn't exist by the time you assign it.  You need to wait until the loader completes loading before you attempt to do anything with its content, otherwise it has no content (null).  Similarly, you cannot control anything in the loaded swf until it has finished loading.  So assign an event listener to the contentLoaderInfo property of the Loader to determine when loading is complete, and have the event handler function deal with starting the interaction with it.
var myLoader:Loader = new Loader();
var url:URLRequest = new URLRequest("SWCS_S3_500x250_exp_panel_2.swf");
myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, processLoadedSWF);
myLoader.load(url);
function processLoadedSWF(evt:Event):void {
    // deal with the loaded swf here
    // but you don't want to be assigning it to the panel2 object that contains the loader
As far as controlling anything inside the swf you load, is it an AS1/2 or an AS3 swf?

Similar Messages

  • Can't Access MovieClips and Functions in Loaded SWF

    Hi everybody,
    I'm trying to simply access anything inside this loaded SWF and all I get is 'null'.
    I have code in the parent SWF that needs to tell the child SWF movieclip what to do but nothing works. This was a piee of cake in AS2 and I can't seem to get anything to crossover in AS3.
    Here's my code:
    import com.greensock.TweenMax;
    import flash.display.MovieClip;
    var myLoader:Loader = new Loader();
    var url:URLRequest = new URLRequest("SWCS_S3_500x250_exp_panel_2.swf"); // in this case both SWFs are in the same folder
    myLoader.load(url);  // load the SWF file
    panel2.addChild(myLoader);   // add that instance to the display list, adding it to the Stage at 0,0
    panel2 = myLoader.content as MovieClip;
    photo_about.alpha = 0;
    photo_downloads.alpha = 0;
    //panel2.content_about.alpha = 0;
    //panel2.content_downloads.alpha = 0;
    function closeSection():void
              panel2.controlsMC.forcePause();
              TweenMax.to(photo_about, .5, {alpha:0});
              TweenMax.to(photo_downloads, .5, {alpha:0});
              TweenMax.to(photo_home, .5, {alpha:0});
              TweenMax.to(panel2.content_about, .5, {alpha:0});
              TweenMax.to(panel2.content_downloads, .5, {alpha:0});
              TweenMax.to(panel2.controlsMC, .5, {autoAlpha:0});
              TweenMax.to(panel2.content_home, .5, {alpha:0});
    panel2 traces null and all the clips loaded within pull up undefined property errors.
    Can somebody please tell me what I'm doing wrong? I'd be stoked to know what I'm missing and feel like this should be a piece of cake.
    Thanks for any help!

    You are not adding the content to the stage at 0,0, you are adding it to panel2 at 0,0.  THen you take panel2 and assign it to be something that likely doesn't exist by the time you assign it.  You need to wait until the loader completes loading before you attempt to do anything with its content, otherwise it has no content (null).  Similarly, you cannot control anything in the loaded swf until it has finished loading.  So assign an event listener to the contentLoaderInfo property of the Loader to determine when loading is complete, and have the event handler function deal with starting the interaction with it.
    var myLoader:Loader = new Loader();
    var url:URLRequest = new URLRequest("SWCS_S3_500x250_exp_panel_2.swf");
    myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, processLoadedSWF);
    myLoader.load(url);
    function processLoadedSWF(evt:Event):void {
        // deal with the loaded swf here
        // but you don't want to be assigning it to the panel2 object that contains the loader
    As far as controlling anything inside the swf you load, is it an AS1/2 or an AS3 swf?

  • I have an iMac OS 10.9.5 - Every time I turn on my system I get the message that it can not access icloud and to fix it using iCloud preferences. I do not want to access or use iCloud, how do I get the message to discontinue?

    I have an iMac OS 10.9.5 - Every time I turn on my system I get the message that it can not access icloud and to fix it using iCloud preferences. I do not want to access or use iCloud, how do I get the message to discontinue?

    Hello mrmacjohn,
    Verifying that any iCloud account that may be signed in is signed out should resolve this error.
    On your Mac, open iCloud preferences, then click Sign Out.
    iCloud: Change iCloud feature settings
    http://support.apple.com/kb/PH2613
    Cheers,
    Allen

  • Getting quite frustrated with my iPhone 4S.  Can't access WIFI and/or Bluetooth nor will my computer allow it to be a "hotspot" unless physically tethered to computer.  It started acting up after download....it also has messed up some app

    I've only had this phone since Sept. and have already had to have the speaker replaced.  NOW I can't access wifi and/or bluetooth (both are grey).  I can't use the Personal Hotspot either (and the passcode no longer shows up).  I can only access internet via the phone through the USB.  This started over the past few days (and after I updated to IOS).
    Some of my apps no longer work either...over 100+ hours of audiobooks on Audible can't be accessed as the Audible app just shuts off.
    Any recommendations on how to recify?   I'm pretty rural so downloaded anything takes going to the next town over to get a signal from the library...  and all of my searching is eating into my 5gb limit through ATT....so it is a bit irritating

    called Apple Care this a.m....new upgrade on 12/31/12 is supposed to fix the "bug"

  • How can I access photos and videos saved to the iCloud?

    How can I access photos and videos saved to the iCloud? I backed up my iphone to the Cloud but now the files are nowhere to be found.
    I had to reset all content and settings in order to troubleshoot an issue. Before I did this, I backed up the iphone to icloud. When I reprogrammed the phone, I had to set it up as a new device and individually sync apps and other items from itunes. But by doing this, I somehow lost some videos and can't seem to find where they would have been saved/backed up. Can anyone offer any guidance?

    You can't view photos and videos on icloud (except for shared photo stream pics).  iCloud merely sync photos between devices using the stream.  If you don't have photo stream turned on, then the only place photos in the camera roll are located are in a backup.  You would have to restore from the backup.  But be warned that many users have ended up losing their photos when performing a restore, for whatever reason. 
    What you should do in the future is always sync photos/videos to a computer for storage, don't leave them on a device or trust icloud to somehow store them.

  • I would like to have a storage solution that is accessed wirelessly, can be accessed remotely and is viewable in the finder side bar (mavericks)

    I would like to have a storage solution that is accessed wirelessly, can be accessed remotely and is viewable in the finder side bar (mavericks)
    Is this possible? if so, how? Thanks in advance
    Ini

    You have to pay for online storage, someone has to pay to keep the lights on. As far a getting it on the Finder sidebar, you did something wrong. That is where mine resides, see below.

  • How can I access instances from Interface Builder?

    Hello!
    How can I access instances build from the Interface Builder? For example, i know how to access Controller classes = just setting the class in the view identity. But I am missing some "connection" to my navigation controller. IB uses one, but in my code, i dont have one.
    All my xibs file owners have as their identity class a View or TableView Controller. But shouldnt they have a navigation controller as identy if the View or TableView is using a navigation Controller?
    thank you..

    thank you, .. i know.. the problem is, that i have different xib files, but i am not sure how i can connect them with their navigation controller / tabbarcontroller.
    it seems, that
    NSLog(@"pushing next view..");
    [[self navigationController] pushViewController:nextViewController animated:YES];
    is not enough. On the console, i can read pushing next view.. but it doesnt come up to the screen.

  • Accessing variables and functions between loaded external swfs?

    Using AS 3.0: Say I have a menu.swf that loads a content.swf
    below it using the following
    var newContent:Loader = new Loader();
    newContent.load(new URLRequest("fowContent.swf"));
    addChildAt(newContent,0);
    Now say I have a frame label in newContent that is an
    animation ending the display of that swf. Upon clicking of another
    menu button in menu.swf, can I access the content's ending sequence
    by:
    newContent.gotoAndPlay(newContent.endingSequence);
    Also can you use while loops in AS 3.0? I would like to have
    a boolean variable "ended" in the newContent that becomes true
    after the ending animation has played.
    while ( newContent.ended != true)
    //wait
    then have it run the function to load and display the new
    content.swf

    quote:
    Originally posted by:
    kglad
    p.s. you can't use a for-loop and you can't use a while-loop
    to effect any time delays. they both execute from beginning to end
    before anything is updated on-stage and no other code can execute
    outside of those loops (unless called from within the loop).
    Thank you very much for the help.
    Would I need to declare a MovieClip variable before using
    that statement or does that automatically cast newContent as a
    movieclip and go to the frame?
    So in order to achieve the flow I'm looking for.
    I'll have this in the menu.swf looking for clicks. It will
    run a function in the content.swf that runs the ending sequence and
    receives a string variable which is a concatenation of the
    buttonclicked (which is also the filename of next content) and
    .swf. (can I cast the event.target.name into a string the same way
    you casted the other into a movieclip?)
    function buttonClick(event:MouseEvent):void //in the menu.swf
    var nextFile:string = string(event.target.name) + ".swf";
    MovieClip(newContent.contentLoaderInfo.content).endSequence(nextFile)
    fowContent.addEventListener(MouseEvent.CLICK, buttonClick);
    In the content.swf I will have a public variable nextContent
    and the function that the menu.swf calls, which begins the ending
    sequence.
    public var nextContent:string;
    function endSequence(nextFile:string)
    nextContent = nextFile;
    gotoAndPlay(endingSequence);
    Then at the end of the movie sequence I could call this
    function that passes back the variable that was modified by the
    previous function and runs the loader.
    parent.loadNext(nextContent) //in the content.swf
    function loadNext(nextContent:string) //function in menu.swf
    newContent.load(new URLRequest(nextContent));
    addChildAt(newContent,0);
    I'm sure theres a better way to do this, and I don't even
    know if this will work. But I'd like to make sure it makes sense
    before I try to implement it.

  • Can't access EWS and front printer panel options all locked

    The web services icon and Network icons are disabled. All the options on the front panel to connect to the network are locked so I can't do anything from the printer panel.
    I printed the Network configuration and obtained the ip address but the EWS does not come up. It says it can't connect.
    I tried the ip address that i previously used to connect with and that won't come up either.
    How do i get the printer connected to the Network again? HELP!

    Thanks for the response.
    I tried unplugging the plug but that did not reset the printer.
    I found another post that explained how to access a hidden Suppot menu.
    I was able to find the option that performs a partial reset and that restored all the functionality
    to connect to the network.
    The printer is on the network and I can now access the EWS. I also modified the admin settings
    to not lock the printer panel again!

  • DW CC Template- can not access hide div function

    Hi,
    I created saved my page as a template and created a new page from the template. In the areas marked editable I can no longer access the button to "hide" a fluid grid div. I can pull up the "hide" function in the footer that is NOT in an editable region. This doesn't make any sense. Am I doing something wrong?
    Thanks
    Andrea

    Suggestion would be the same as in thread http://forums.adobe.com/message/5517243#5517243

  • After installing Yosemite upgrade, can't access documents and files

    I installed the Yosemite upgrade without making a proper backup first, not realizing what a major upgrade this is. During the install, I was prompted to create a new user account. Now that the upgrade is complete, when signed in as the new user, I can see my files and documents listed in a Device called “Guest’s MacBook Pro,” but when I try to access them, I’m told I don’t have permission to see the folders' contents.
    I should add that I bought this machine used, and I have always used it under the name “Guest.”
    Please help me access my stuff! Thanks in advance.
    EtreCheck version: 2.2 (132)
    Report generated 5/2/15, 11:47 AM
    Download EtreCheck from http://etresoft.com/etrecheck
    Click the [Click for support] links for help with non-Apple products.
    Click the [Click for details] links for more information about that line.
    Hardware Information: ℹ️
        MacBook Pro (13-inch, Mid 2012) (Technical Specifications)
        MacBook Pro - model: MacBookPro9,2
        1 2.5 GHz Intel Core i5 CPU: 2-core
        4 GB RAM Upgradeable
            BANK 0/DIMM0
                2 GB DDR3 1600 MHz ok
            BANK 1/DIMM0
                2 GB DDR3 1600 MHz ok
        Bluetooth: Good - Handoff/Airdrop2 supported
        Wireless:  en1: 802.11 a/b/g/n
        Battery: Health = Normal - Cycle count = 140 - SN = 9G2150ZCUD3MB
    Video Information: ℹ️
        Intel HD Graphics 4000
            Color LCD 1280 x 800
    System Software: ℹ️
        OS X 10.10.3 (14D136) - Time since boot: one day 0:3:24
    Disk Information: ℹ️
        APPLE HDD HTS547550A9E384 disk0 : (500.11 GB)
            EFI (disk0s1) <not mounted> : 210 MB
            Recovery HD (disk0s3) <not mounted>  [Recovery]: 650 MB
            Macintosh HD (disk1) / : 498.88 GB (429.05 GB free)
                Encrypted AES-XTS Unlocked
                Core Storage: disk0s2 499.25 GB Online
        HL-DT-ST DVDRW  GS31N 
    USB Information: ℹ️
        Apple Inc. FaceTime HD Camera (Built-in)
        Apple Inc. iPhone
        Apple Inc. BRCM20702 Hub
            Apple Inc. Bluetooth USB Host Controller
        Apple Inc. Apple Internal Keyboard / Trackpad
        Apple Computer, Inc. IR Receiver
    Thunderbolt Information: ℹ️
        Apple Inc. thunderbolt_bus
    Gatekeeper: ℹ️
        Mac App Store and identified developers
    Kernel Extensions: ℹ️
            /Library/Application Support/MacKeeper/AntiVirus.app
        [not loaded]    net.kromtech.kext.AVKauth (2.3.7 - SDK 10.9) [Click for support]
        [not loaded]    net.kromtech.kext.Firewall (2.3.7 - SDK 10.9) [Click for support]
    Problem System Launch Agents: ℹ️
        [killed]    com.apple.CallHistoryPluginHelper.plist
        [killed]    com.apple.cmfsyncagent.plist
        [killed]    com.apple.coreservices.appleid.authentication.plist
        [killed]    com.apple.icloud.fmfd.plist
        [killed]    com.apple.SafariNotificationAgent.plist
        5 processes killed due to memory pressure
    Problem System Launch Daemons: ℹ️
        [killed]    com.apple.AssetCacheLocatorService.plist
        [killed]    com.apple.awdd.plist
        [killed]    com.apple.corestorage.corestoragehelperd.plist
        [killed]    com.apple.ctkd.plist
        [killed]    com.apple.findmymac.plist
        [killed]    com.apple.icloud.findmydeviced.plist
        [killed]    com.apple.installd.plist
        [failed]    com.apple.mtrecorder.plist
        [killed]    com.apple.nehelper.plist
        [killed]    com.apple.nsurlsessiond.plist
        [killed]    com.apple.softwareupdate_download_service.plist
        [killed]    com.apple.wdhelper.plist
        11 processes killed due to memory pressure
    Launch Daemons: ℹ️
        [loaded]    com.adobe.fpsaud.plist [Click for support]
        [failed]    com.apple.spirecorder.plist
        [running]    com.mackeeper.AntiVirus.plist [Click for support]
        [loaded]    com.microsoft.office.licensing.helper.plist [Click for support]
        [running]    com.zeobit.MacKeeper.plugin.AntiTheft.daemon.plist [Click for support]
    User Launch Agents: ℹ️
        [loaded]    com.google.keystone.agent.plist [Click for support]
    User Login Items: ℹ️
        Google Chrome    Application Hidden (/Applications/Google Chrome.app)
    Internet Plug-ins: ℹ️
        FlashPlayer-10.6: Version: 17.0.0.169 - SDK 10.6 [Click for support]
        QuickTime Plugin: Version: 7.7.3
        Flash Player: Version: 17.0.0.169 - SDK 10.6 [Click for support]
        Default Browser: Version: 600 - SDK 10.10
        SharePointBrowserPlugin: Version: 14.4.9 - SDK 10.6 [Click for support]
        Silverlight: Version: 5.1.30514.0 - SDK 10.6 [Click for support]
        JavaAppletPlugin: Version: 15.0.0 - SDK 10.10 Check version
    3rd Party Preference Panes: ℹ️
        Flash Player  [Click for support]
    Time Machine: ℹ️
        Time Machine not configured!
    Top Processes by CPU: ℹ️
             5%    hidd
             5%    WindowServer
             3%    ClanLord
             1%    Google Chrome Helper(12)
             1%    fontd
    Top Processes by Memory: ℹ️
        1.20 GB    Google Chrome Helper(12)
        488 MB    kernel_task
        164 MB    Google Chrome
        147 MB    ClanLord
        78 MB    mdworker(7)
    Virtual Memory Information: ℹ️
        47 MB    Free RAM
        3.95 GB    Used RAM
        140 MB    Swap Used
    Diagnostics Information: ℹ️
        May 1, 2015, 11:43:03 AM    Self test - passed

    MacKeeper – Do Not Install
    MacKeeper – Do Not Install (2)        See  SDW2001’s post
    MacKeeper Removal
    MacKeeper Removal

  • Why can I access Internet, and get my email through yahoo, but can't access email when I use the mail icon on the front of my tablet. It just started doing this today.

    Why can I access the Internet, even get my email by going through yahoo, but as of this morning I can not access my email from the mail icon on my tablet screen. It just started doing this today. When I try to get my email by going through the icon, I am asked to enter yahoo password. I do this, then the box just pops up again, and again and again never letting me get signed in. Don't know what I am doing wrong. Need help!

    iOS: Unable to send or receive email
    http://support.apple.com/kb/TS3899
    Can’t Send Emails on iPad – Troubleshooting Steps
    http://ipadhelp.com/ipad-help/ipad-cant-send-emails-troubleshooting-steps/
    Setting up and troubleshooting Mail
    http://www.apple.com/support/ipad/assistant/mail/
    iPad Mail
    http://www.apple.com/support/ipad/mail/
    Try this first - Reset the iPad by holding down on the Sleep and Home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons. (This is equivalent to rebooting your computer.)
    Or this - Delete the account in Mail and then set it up again. Settings->Mail, Contacts, Calendars -> Accounts   Tap on the Account, then on the red button that says Remove Account.
     Cheers, Tom

  • My wife has a separate User Login. How can she access photos and documents on my User Account?

    What do I need to do under my wife's user login so she can have access to photos and documents on my user account?

    Move the data you want to share to the hard drive level Users/Shared folder and she will be able to access them. You may have to do a Get Info (command - I) on the folder and add her with read/write permissions, then select the gear at the bottom and Apply to enclosed items.

  • Can't access CMC and infoview on BO edge series 3.1

    Hello gurus,
            I have just installed BO edge series 3.1, immediate moment after installation, I can open CMC console, but after I 've done other operation on the computor, CMC can't open now, also I can't open infoview, error shows " can't establish connection to server", but other features work well. how can I resolve this issue?
    Many thanks,

    Hi,
      I will clarify following facts:
    (1) I used "typical installation " for Edge3.1
    (2)  all are installed on windows XP
    (3) I have restarted computor several time, CMC and infoview can't be launched either.
    (4) other features work very well.
    (5) after I installed Edge 3.1, CMC and infoview were reached for one time, after that, I installed crystal report 2008, this report designer can't be started, so unstalled it. then try to access CMC and infovew, it failed.
    Many thanks,

  • Can't access loops and samples

    Hi,
    I have posted this on the regular SoundTrack discussion list and have not received an answer.I am not really sure which list this belongs on since it is SoundTrack Academic. Here's the issue: My computer is shared. I am the administrator and can access SoundTrack and all its features. Other users who are not administrators can not access the loops and samples. I did create another admin account and that account also can not access the loops and samples. How can I make the loops and samples available to who ever uses this computer? Thanks.

    Logged in on one of the other accounts, open STP and under the Search tab, click the Setup... button at the top right. See if you can browse to the folder where the files are located (probably something like: /Library/Audio/Apple Loops/Apple Loops for Soundtrack Pro, and /Library/Audio/Apple Loops/Apple/Apple Loops for GarageBand). If so, just add that/those folder(s) to the Folders Indexed list.
    Try that, then report back.
    tim

Maybe you are looking for

  • Error while starting the Prestentaion services in obiee 11g

    while i am trying to access the presentation services htrough these link http://infva04624:9704/analytics/saw.dll?Answers i am getting error as Error 500--Internal Server Error From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1: 10.5.1 500 Interna

  • 16 items could not be synced. See Itunes for more information

    I restored my iPhone 3GS from a iCloud backup. Now when my iPhone gets restored, i'm unable to get my most recent purchared songs back on my iPhone i get the message: "16 items could not be synced. See iTunes for more information". When I look to the

  • Error ora-00600 and error-472

    my database suddenly become unavilabe, I check the log file and i found error code ora-00600 and when i check the trace log file i found error error472. any suggest

  • Corrupt blocks in the LOB segment 11.2.0.2

    Hello, at a dbexport we found corrupted blocks in a LOB-Segment. Then we start rman and do a backup validate check logical database, nothing, rman didn't found any corruption. meanwhile we have repaired the LOB-Segment with restore, now all is ok. Bu

  • New MBP battery won't charge unless closed

    I've had my 17' MBP for 3 months and I'm having more issues with it than my last 2 macbooks combined. My problem now is that the battery won't charge unless the laptop is closed, and yes, I use only Apple authentic chargers. I first thought it was a