How to load content just once???

OK I so I have two swfs loading into a content area from the
click of one button. But everytime the user clicks on that button
the addChild keeps happening. Any ideas as to why that is and how I
can stop it? Thanks guys

quote:
Originally posted by:
kglad
when you prefix a variable name with var, you're making that
name local to the function (or timeline) that contains that
declaration.
therefore, if you want to use that name outside the function
or upon function re-entry, do NOT prefix with var.
I am sorry for my ignorance on the actionscript subject but,
anytime I remove the var prefix I get errors all over the board

Similar Messages

  • How to load content of my text file into a Vector?

    Hi!
    Two questions.
    Let say I have used BufferedReader(new FileReader(c:/java/MyText.txt)) to read from MyText.txt file. I want to know how to load content of this file (every line describe each photo in my photo-set) into a Vector? And how to associate lines of MyText.txt as an elements of the Vector?
    I am trying to do something, but no results.
    try{
    BufferedReader reader = new BufferedReader(new FileReader("c:/java/Applications/MyText.txt"));
    String str=reader.readLine();
    JList myList = new JList();
    StringTokenizer st = new StringTokenizer(str,"\n");
    Vector vr = new Vector(25);
    while(st.hasMoreTokens()){
    String nextToken = st.nextToken();
    vr.addElement(nextToken);
    myList.setListData(vr);
    TA1.setText(TA1.getText()+
    (String)myList.getSelectedValue());
    }catch(IOException evt) {};

    BufferedReader reader = new BufferedReader(new FileReader("c:/java/Applications/MyText.txt"));
    Vector photos = new Vector(0,0);
    while(reader.ready())
       photos.addElement(reader.readLine());
    }good luck,
    Felipe

  • How to load content from the application directory?

    I'm currently working on an AIR desktop application that will be distributed on OSX and Windows. The main applicaiton SWF will load a child swf that has been packaged. When I've attempted to load the child SWF via loader.load() with a URI of "app:\\TheChildContentSWF.swf", the load has failed with an IOError. If I force a copy of the the SWF (in OSX) to the MacOS directory where the executable resides, the child SWF would load. I was a little stumped by this so I decided to check what the nativePath of the application directory was via File.applicationDirectory.nativePath (it turned out to point at the Resources directory). Does the "app://" URI point to different paths when using Loader vs File?
    If so, is there a way to package content so that it is installed in a directory that Loader can recognize without hitting security sandbox issues?
    Visual of the OSX app directory structure (simplified)
    MyApp.app\
         Contents\
              Frameworks\
              MacOS\
                   executable
              Resources\
                   TheAppSWF.swf
                   TheChildContentSWF.swf
                    ... // other content
    Thanks for any help!
    Josh

    When loading application, move the swf to the applicationStorage folder if it doesn't exist already.
    Something like ...
    private var swfDistribute:File = File.applicationDirectory.resolvePath('ResourcesChildContentSWF.swf');
    private var swfLocal:File      = File.applicationStorageDirectory.resolvePath('TheChildContentSWF.swf');
    private function onCreationComplete():void
       if (!swfLocal.exists) {
          if (swfDistribute.exists) {
             swfDistribute.copyTo(swfLocal);
    Then you should be able to call your loader.load() URI with the variable (swfLocal)

  • How to load content in div without re-loading page

    Im looking for a way to keep all my static content loaded but
    only load new content in my center div when a user clicks on a
    link. Is there a way to do this that is friendly on all browsers?
    Please help I value any help!!

    I would suggest that you remove the mp3s from playing but if
    you must have
    it....
    ...I've written some script in Flash that uses sharedObjects
    (kind of like
    cookies) to read and see if the object exists. If it does, it
    goes to a
    different frame. If not, then it goes to another.
    The script(actionscript 2) is as follows. Put it on frame 1
    of your
    timeline:
    stop();
    var my_so:SharedObject = SharedObject.getLocal("seenThis");
    if (my_so.data.name == "seen it") {
    //been here before.
    //here is where you go if you have already seen it,
    //make sure there is no music playing on frame 25
    gotoAndStop(25); } else {
    //first visit
    gotoAndPlay(26);
    my_so.data.name = "seen it";
    my_so.flush(1000);
    Now, there are some considerations in using shared objects
    ...Sometimes your
    SWF files may not be allowed to write local shared objects,
    and sometimes
    the data stored in local shared objects can be deleted
    without your
    knowledge. Flash Player users can manage the disk space that
    is available to
    individual domains or to all domains. When users lower the
    amount of disk
    space available, some local shared objects may be deleted.
    Flash Player
    users also have privacy controls that can prevent third-party
    domains
    (domains other than the domain in the current browser address
    bar) from
    reading or writing local shared objects. But, in something
    like this seen it
    example.no real harm if the object gets deleted.
    Dan Smith > adobe community expert
    Flash Helps >
    http://www.smithmediafusion.com/blog/?cat=11
    http://www.dsmith.tv

  • How to load Class only once...

    hi all,
    i am using the Class.forName() to load the class.
    the code looks like as follows :
    for loop.....{
    Class.forName("classA");
    inside the for loop , is there any possiblity of knowing that the class is already loaded or not. i can load the class the outside the for loop . but i am curious to know how we can check whether the classA is already loaded or not for the next iteration of the loop.
    tia,
    dhanasekaran.

    Class.forName() will only load a class that has not been previously loaded. Whether or not a class is already loaded is totally transparent to a Java application. It will be loaded as soon as it is referred to for the first time, be it instantiation or access to static members or a call to Class.forName().

  • How to load a movie once?

    I'm building a site where each "page" is a stopped frame.
    Frame 1 is the preloader which when loaded, goes to and Stops
    frame 3 which is "home" of my movie.
    On the Home frame I have the action script and loader to
    stream an flv movie and it loads a movie using the NetStream. The
    movie is basically a "welcome and this is what my site is all
    about" kind of thing.
    How do I get that movie to only play if the user is coming
    from Frame 1 (the preloader) and not if they're returning to the
    home frame from elsewhere?

    The first time the flv is played set a variable to true, such
    as:
    var moviePlayed:Boolean = true;
    and on each visit to frame 3, check the value of the variable
    to see if the flv should be played or not.

  • How to Open Application just once !

    I created a simple application but I dont want that my application be opened twice !
    How to verify if my application is already running ???
    If it is running is there any way to communicate with it ?
    Tnx !

    Hi,
    There are several possibilities for this situation.
    1 - first session gains a lock on a certain file (with a predefined or hard-coded name and location)
    second session will be unable to gain a lock on the same file and will thus know that the
    application is already up and running.
    2 - first session opens a port (with a predefined or hard-coded number).
    first session writes some opening message to this port.
    first session starts a thread which will listen to this port each ... minutes/seconds.
    second session opens port, writes some opening message to this port
    first session receives the message through the port and will reply some notification
    and request for closing session 2.
    session 2 will close.
    Several solutions are possible for running a limited number of occurences of the same application,
    for running all applications within the same JVM, and more specific control over the startup-process.
    Different kinds of information for controlling this setup-step can be transferred via (known) files and ports.
    Also take a look at sockets and java RMI.
    kind regards,
    Koen

  • How to Load Progressive-Download Video just when I press Play?

    I have set the Progressive-Download video instead of Streaming-Video (because my webserver provider "aruba.it" doesn't offer
    streaming videos), in Flash CS4 Professional, and exported to Dreamweaver CS4.
    I have also inserted the HTML code in Dreamweaver CS4 to enable FullScreen Playback of Flash .flv Videos.
    Now I have a problem:
    - When the webpage loads into Internet Explorer 7, it take much time to load all the videos at same time!
    Thus I want this:
    - I want that the videos start to load just when I press the Play button, individually, not at same time.
    - I don't not want that start the load immediately when the webpage opens in IE7.
    - I want that the videos start to load content in the same manner of YouTube videos, just when I press play.
    How can I do?
    What is the HTML code that I should insert into DreamweaverCS4?
    I have seen this help page:
    http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/fl/video/FLVPlayback.html#lo ad()
    At Chapter "Public Methods" I have seen this "load" function:
    "Begins loading the FLV file and provides a shortcut for setting the autoPlay property to false and setting the source, totalTime, and isLive properties, if given..."
    Can be useful this function?
    Horsepower0171.

    Excuse me, I am a beginner user of FlashCS4.
    OK!
    StepByStep:
    My site is http://www.cavallodario.it. Please see the third top section called "Sezione 3D">Maya>the last bottom video on the page is published as Streming video (I think)...
    There, are all the videos.
    I have understood that YouTube video is http streaming.
    Instead, in FlashProCS4, I have seen a second Option after ImportVideo Menu (is Flash Media Server streaming?):
    1) "Sul Computer" (on the Desktop, local); NOT CHECKED
    2) "Già distribuito su un server Web, Flash Video Streaming Service o Flash Media Server"; CHECKED and selected the URL: http://www.cavallodario.it/filmati_Maya/flv/Wagon_01_PAL_Letterbox.flv
    > Next > SkinBar with Fullscreen Button (called "SkinUnderPlayStopSeekFullVol.swf") > Next > End.
    But I have a doubt if this is a streaming function:
    -After published the webpage via FTP with Dreamweaver, in IE7 browser the loading progress bar appears immediately, and loads the video when the webpage appears, not when I press Play Button!
    Why this?
    How I can do to load the video just when I press the Play button?
    - I have seen the "NetConnection / NetStream" classes in the FlashCS4 Help, but I am a confused beginner user and I don't want write an ActionScript code to build a custom navigation bar.
    Please response me!
    Thanks!
    Horsepower.

  • Load all content at once

    Is there a code to load all content at once? I know you can
    do it because when you go to websites all in flash they have a
    loading screen to start off with. I need one, but don't know how to
    get/use one. I have a lot of big images that take a while to load.
    Thanks.

    Visit gotoandlearn.com and you can find a preloader tutorial
    there.

  • How do i change my sound settings from complete this action from always to just once

    I accidently selected always instead of just once on how I wanted to complete an action concerning my ringtones

    You can go to settings-app manager-menu-reset app defaults, or you can go to the one app you accidentally set as default for sound and clear it as a default by going to your app manager and scrolling to that app, tap it, clear default.

  • How do I copy artwork to iPod just once for an album, not for every track?

    I don't download music. All my music is ripped from CDs that I own.
    After I rip a CD, choosing "Get Album Artwork" from the Advanced menu normally works, and if not, I find the highest quality image I can from the web, and copy & paste that into the large box at the bottom left of iTunes.
    It appears that iTunes stores the artwork image once for each track, not once for an album, so for example if an album has 10 tracks, the image is stored 10 times somewhere on my hard drive. This is inefficient, but not problematic.
    However, when I (manually) select & drag-copy the resulting 10 tracks to my iPod, the artwork doesn't transfer along with the tracks. I then have to copy the artwork & having selected all the tracks on the iPod, paste it in. I have the "Manually manage music and videos" option selected, as I simply don't trust the automatic system. I want to supervise what is copied, when, and in what way. I don't necessarily want everything in my iTunes library on my iPod.
    What concerns me is that for each album, the artwork image is stored repeatedly for each track on the iPod, like on my hard drive, not once for an album. As space will be at a premium on the iPod once I start copying more & more of my CDs across (I have only done 9 so far) the point will come where a large number of MB of space will be wasted on the iPod with duplicate artwork, which will mean that I'll be able to fit far fewer CDs on the iPod than would otherwise have been the case. The fact that I have chosen 192 kbps and the AAC Encoder for all my CD ripping also means that the iPod will fill up faster than if I'd used the standard 128 kbps and MP3 settings. I'm not prepared to go below 192 kbps though. My soon to be purchased Sennheiser CX500 earphones deserve that much!
    Is there any way to force iTunes and the iPod to store the artwork only once for each album, and if there is, can this method be retrofitted to the CDs I've already copied to my iPod, or do I have to start again from scratch? I've already filled 670 MB with the 9 CDs, many of which are only 40 or 45 minutes long, so I'm already getting worried!
    Alternatively, am I simply mistaken about all this? Does it only *look like* the artwork is duplicated, whereas it's actually only being stored only once?
    Many thanks.

    In reply to PT:
    Why don't you paste the artwork to the track in iTunes first (fast) THEN send them over to your iPod?
    I already do that. Every track has the correct artwork in place before I copy it to the iPod.
    I ripped about another 10 albums yesterday. Most of the albums got their artwork automatically from the iTunes store. For a few I had to get artwork from the internet.
    When I rip a CD, one of 3 different things happens:
    1. The album get its artwork automatically from the iTunes store, and then when I shift-click all the tracks and drag them to the iPod icon, all the artwork transfers along with the tracks.
    2. As per 1, except the artwork doesn't transfer when I copy the tracks to the iPod. I then copy the artwork from one of the tracks on the Mac, then shift-click all the equivalent tracks on the iPod, and right-click in the large box at the bottom left of the screen, and click on paste.
    3. The iTunes store has no artwork for the album, so I copy the artwork from an image on the internet, shift-click all the tracks on the Mac, and right-click in the large box at the bottom left of the screen, and click on paste. I then shift-click all the tracks and drag them to the iPod icon. They all copy across, but the artwork never does, so I then shift-click all the tracks on the iPod and right-click in the large box at the bottom left of the screen, and click on paste.
    Pasting the artwork to the tracks, in either scenario 2 or 3 above, takes ages (often longer than copying the tracks themselves) and a progress bar appears, listing each track in order as the artwork is added to the track, accompanied by the spinning beach ball. The slowness is mostly down to using USB 1.1, but for a 20 track album, it appears that the iPod is storing the artwork 20 times, once for each track, not just once in total (for the album).
    It appears that in scenario 1 though, the iPod is only storing the artwork once.
    In reply to Landon Dial:
    well first you go to one track, right click and press get info. you go to where it says artwork, right click the image and press copy, then you exiit out of that. then you can press ctrl and select each song you want to have that artwork. if there highlighted then its working. then right click again and press get info. then go to artwork and press paste and it should have copied the image to all of your tracks
    Thanks for your input, but you've completely misunderstood my question. I know how to add artwork to tracks. What I'm trying to figure out is how to force iTunes/the iPod to only store artwork once for each album, not once for each track, even if the artwork comes manually from me finding it on the internet, not automatically via the iTunes store.
    In reply to Chris CA:
    When iTunes gets the artwork, there is only one copy on your computer.
    That single artwork is linked with iTunes to each song on the same album.
    When you add artwork yourself, it is copied directly into the ID3 artwork tag for each song. If you have a 200kB artwork file, each song will be 200kB larger.
    From what you say it sounds like there's no way to force the issue then. If you have to paste in artwork yourself, then it's one copy per track, not one per album. A serious flaw which I hope Apple will address!
    Using playlists is very easy to manage what goes onto your iPod.
    That's true, but I don't really have any need for playlists. I want 95% of what's in my iTunes library copied across (complete albums, with artwork). It's the remaining 5% (the odd individual track, amusing audio files, and other odds & sods) that I don't want copied. Copying things manually suits me fine, and I wouldn't consider another method unless it solved the problem that this topic is about!

  • How to open firefox just this once without prior sessions restarting?

    Last session I stumbled on a site infected with malware. Now, each time I reopen Firefox, the old sessions restart, as usual (and as I want them to, except for now), going immediately into the malware problem again.
    Firewalls and anti-virus are handling the problem ok so far, but obviously I can't keep opening Firefox and banging against the malware.
    How to open without restoring previous sessions? I'm not talking about changing the default setting, not talking about having it never restore sessions. Just this time, how to get around the automatic restore of sessions?
    Thank you.
    == This happened ==
    Just once or twice
    == I stumbled on an infected site ==
    == User Agent ==
    Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; AskTB5.2)

    Set the pref [http://kb.mozillazine.org/browser.sessionstore.max_resumed_crashes browser.sessionstore.max_resumed_crashes] to '''0''' on the '''about:config''' page to get the about:sessionrestore page immediately with the first restart after a crash has occurred or the Task Manager was used to close Firefox.
    See https://wiki.mozilla.org/Session_Restore#Preferences
    http://kb.mozillazine.org/Browser.sessionstore.max_resumed_crashes
    See also http://kb.mozillazine.org/Session_Restore#Firefox_keeps_crashing_after_restoring_a_session

  • How do i load content from an existing ipod to a new computer and installation of itunes?

    how do i load content from an existing ipod to a new computer and installation of itunes?

    Recover media from iPod
    See this post from forum regular Zevoneer for options on moving your iPod data back to your computer.
    tt2

  • I just installed an update on my iPhone and since then the choice to repeat music, or not, has disappeared and it automatically plays songs and albums on a loop. Anyone know how to make it play an album or song just once?

    I just installed an update on my iPhone and since then the choice to repeat music, or not, has disappeared and it automatically plays songs and albums on a loop. Anyone know how to make it play an album or song just once?

    Basics from the manual are restrt, reset, restore.
    Have you tried each of these?

  • How do you get audio files to loop instead of playing just once.

    how do you get audio file to loop instead of playing just once.
    Thanks

    This forum is specifically meant  for Edge Inspect issues. Could you please let us know the product your query is related to. We will redirect you to the correct forum.

Maybe you are looking for

  • Hover pesudo class behaving funny

    I have used a widget with the following code /* Menu items that have mouse over or focus have a blue background and white text */ ul.MenuBarVertical a:hover, ul.MenuBarVertical a:focus background-color: #000; color: #fff; /* Menu items that are open

  • How to handle palm keyboard with midp?

    Hello, I'm developing a custom made textbox component with the midp low level apis. It's targeted for a palm os application. When I run tests with the emulator I cannot make the little keyboard appear ( it beeps ). Is there some way to handle this ke

  • Change SATA to ACHI in BIOS

    Hiya guys! I want to change SATA to ACHI via BIOS  but i can't find it anywhere....please help me! I have HP Pavilion DV7-3197eo

  • Detect iOs and Android in Adobe Muse

    Hi all, I have a website for downloading iPad and Android tablet Enterprise app. Now i have 2 buttons in it to download Android and Ios app and i need to change it to single button. Is there any way to do it using Adobe Muse.

  • Monitoring load distribution across multiple cores?

    In SLS is it possible to peek at the load distribution across the cores of a multicore CPU? Thanks?