Selecting random .swf files

My code loads random movie clips from the same folder of the
files "17_1.swf", "17_2.swf" and so on to "17_50.swf". If I have
files that don't start with "17_" but I would like to load them
anyway without having to change all of these file names, is there a
better way for me to write this code?
In other words, how can I simply have it load all of the
movie clips in its folder rather than just the ones named
appropriately?
Thanks

The first problem u describe I suspect is alot more tricky
than when u know the file name structure. I'm guessing u will have
to store all the swf file names in a file that ur flash can access,
or if possible let the web server return a directory content list
which u could parse for *.swf files. Just see to it that u dont
load the swf that u are loading from, which could in worst case
lead to a loop.
For ur second problem, you will need to keep track of the
last loaded movie with a variable, like lastLoaded (which u update
just before loading a new swf with lastLoaded = currentlyLoaded),
or keep them in an array (if u want the possibility of multiple
back clicks).

Similar Messages

  • Random .swf file

    I am looking to produce a banner that displays a different
    .swf file every time. I can guess there are two ways to do that
    Upload each file to a directory and use html to do this
    Do it in Flash 8 and then upload a single swf
    Richard

    yes you could do this either way. although if your banner(s)
    will run on sites other than your own domain, you may want to make
    them within a single swf, and choose which to show via an array
    list, so that you don't run into cross domain security issues.
    The advantage of using a directory, is that you can place or
    remove files at anytime and the SWF using PHP generated directory
    list would update automatically on loading.

  • Select entities in a swf file and pass back to html page

    Hi,
    I am new to flash. I got a dwg file converted into swf file. Now I want this swf file to embed in html page. No issue with that.
    The tricky part for me is to let the user select the entites of the file such as line/circle as one might select in autocad. After entity selection the swf file (by any means) pass the  selected entity information back to the html page ( to the javascript function).
    Is this feasible?
    I have no clue Please give direction.

    Thanks Tim.
    I could solve the problem using javascript.
    I have used the following javascript.
    <script>
    function test(){
    var radioLength = document.wwv_flow.p_v01.length;
    var retVal = '';
    if(radioLength == undefined)
              if(document.wwv_flow.p_v01.checked)
                   retVal = document.wwv_flow.p_v01.value;
              else
                   return "";
         for(var i = 0; i < radioLength; i++) {
              if(document.wwv_flow.p_v01.checked) {
                   retVal = retVal + ';' +document.wwv_flow.p_v01[i].value;
    retVal = retVal.substring(1, retVal.length);
    opener.document.getElementById('P1_TEST').value = retVal;
    window.close();
    </script>
    Now the problem is solved!!
    Thanks,
    Archana

  • Swf files wrongly linked in Mac info 'Open With'

    Together with others I have had a serious problem opening swf files with Flash Player. I hope this will help some of you and challenge Adobe to get their act together since this ought not so to be.
    1. Background: As you may know, Flash Player 10 is not a stand along but only for web use (a plug in). One must keep or download the latest Flash Player 9 in order to play stand along swf docs. Had Adobe explained this clearly at the get-go it would have saved much frustration.
    2. Together with others, some very strange things have happened to what was an automatic double-click=open option. In my Mac Info (on file) dialogue box many of my older swf files appear as programs with which I can open any swf doc. In fact, *all* of my hundreds of stand alone swf files are now set to open with some other swf doc (!) meaning that that doc appears and not the doc I am opening. It looks like the swf file has been recognized as a program rather than a simple swf file.
    3. After much frustration, I tried to set Flash Player 9 in the Mac 'Info' dialogue box and then choose 'Change All,' but this is not allowed. It keeps wanting to open my swf with some other swf doc listed in the Info. I then changed each doc separately via the Mac Info dialogue box. This finally stuck ... but when I tried to Change All again with a doc set to open with Flash Player 9, everything returned set to open with some random swf file listed in the 'Open with' dialogue box (and these swf files should not be listed there as programs).
    4. This entire confusion makes me think that the Adobe/Apple conflict is somehow coming into play here. Who is to blame I do not know, but I wish Adobe would address this since we how have used Flash to create very complex and beautiful swf docs for the classroom now have to open each doc by dragging it to the Flash Player in the dock, and this means that we must explain this to any user.
    5. Summary: For whatever reason 'Open With' is confused, I should be able to correct the problem with choosing Flash Player 9 and then click 'Change All.' Can anyone tell me what is going on and how to solve this?
    PS: This is happening to others whose Macs are totally separate from mine. 

    Hi seaslug and welcome to our community
    I would think you could test the connectivity by playing them
    locally to ensure they work. If the files all work fine on your
    local PC, try copying them to a web server that isn't using SSL. If
    they work fine there, then try the SSL. Basically, you want to pare
    away the layers in order to see where things fall apart.
    You may also wish to double check to ensure that all the
    necessary files exist in the output folder. For example, maybe
    someone forgot to include the associated HTM files. Things like
    that.
    Hopefully something here was helpful... Rick

  • Playing Flash Movie .swf files in iWeb

    This is my second post. The first was about generally not being able to publish my website in iWeb in Argentina. Discovered it was due to the 12 kilobytes a second upload speed!
    This query is about trying to get a flash movie with .swf extension to play on my homepage in iWeb
    www.edgold.co.uk
    Ive made a flash movie on my girlfriends PC. Why? Because she has Flash installed.
    Ive transferred it to my Mac and it plays with a programme I downloaded called SWF & FLV Player - no problem there. For the love of trying I cant get it to play.
    Ive gone to 'Insert' in iWeb, clicked on Choose and selected the swf file. Ive put it in position on my homepage and published it. Then Ive opened the HTML page thats found in iDisk using TextEdit so that I can change the html to get the flash plug in to play it.
    I found all the details on website by 'Vertical Moon'
    http://www.verticalmoon.com/tutorials/general/iweb/iweb.htm
    Ive followed every step to the letter but where they seem to slip up is that the swf file isnt played by QuickTime. QuickTime on my Mac doesnt want to know! If it was played by QT then I'd have a chance to change the html from 'writeMovie1()' to writeflash1() but there is no sign of that code in the html file let alone having to change it in JavaScript.
    At the end of the day Ive got an swf file (Flash) that I want to stiuck on the front page of my website to play over and over. Ive spent over 18 hours on this non-stop and its time I called it a day.
    Please can someone tell me how to get iWeb to make friends with it!
    Ive looked at lost of other sites about free Video code generating but none of them work!
    Cheers
    Ed
    (Im in Patagonia - documentary photographer...sorting a good site helps me secure sponsorship and future exhibition venues. Your help is appreciated!

    Alancito
    Thanks for replying and the great info on getting a QuickTime to play automatically.
    Please can you continue to help as Im having no luck.
    I will write below briefly whats happening.
    I made a QuickTime in iPhoto as was suggested. I dropped it into iWebs 'Media' button under the 'Movies' tab, in a folder. I then dropped the QT file onto my web home page. It shows with a control bar at the bottom of its window for playing it.
    I published it OK. The live website shows the QuickTime movie BUT you have to click play to start it. So I then I opened the html file in iDisk in TextEdit.
    I tried and tried to find the html code for the QT Movie. I read and re-read the whole html file from top to bottom and found no sign of the QT Movie. Then I went to 'Edit' and 'Find' in TextEdit and typed Movie. It came up with a bit of code which says writeMovie1();
    I guess that this means it is talking about THE movie in question but there is no more code to
    do with 'true' or 'false'. If it said false Id change to true but writeMovie1(); just looks like this:
    <script type="text/javascript"><!--
    writeMovie1();
    --></script>
    stuck almost at the bottom of the html file page.
    Please help...remember Im using iWeb 06
    Thanks...I hope Im close to solving this now. All I want is to play the QT automatically.
    Ed

  • Why does Bridge CS6 destroy my SWF files after inputting Meta Data?

    I save a swf file to my hard drive.  Then I open Bridge, select the swf file, and type some Meta Data into the panel on the right.  As soon as the data saves and the preview window refreshes, the preview renders completely white (Bridge can no longer preview it).  If I open the file in Flash, some layers and text are now missing.
    It seems that the act of writing meta-data to the swf file actually destroys portions of the file, and I have to go back to the original and re-export.
    We have reproduced this problem on both Mac & PC, on swf files of varying compression & XMP settings.  It is fairly consistent.
    Has anyone run into this and if so does anyone have any suggestions?

    Not a expert on swf files, but this article says you can not use Bridge to add metadata to SWF files.  So maybe that is why you are running into problems.  http://forums.creativecow.net/thread/190/862442

  • Captivate 2.0 Very Buggy After Import of SWF File (Flash 8)??

    Where should I begin...
    Issue 1
    I just updated to Cap 2 and started using it. I have come
    across a few very weird issues. Everyting works fine until I import
    a swf file to the stage. After I import a swf file to the stage I
    realize I made a mistake in the swf file. So I updated the swf in
    Flash 8 and publish it. I then went into Cap 2 and tried to update
    the file (which I noticed that the update button has been removed.)
    When I go to import and import the updated file, it does not update
    it. I had to close the program and reboot before it would recognize
    the new file??? Sounds like a caching issue of some sorts, but very
    buggy in my eyes.
    Issue 2
    So now I have the new file in... great! But when I try to use
    one of the drop down menus from the top tool bar, the menu
    disappears immeditly after I have clicked on it??? The only way to
    get my menu's back is to close the program and reopen it.
    Issue 3
    I just recently found another problem... I was trying to work
    with Cap 2 in its crazy state, and I pulled one of the bars on the
    timeline torwards the end of the screen and the timeline
    disappeard??? So I went to view and clicked timeline... no change.
    Now I do not have a timeline??? I have tried running a reapir and I
    even tried several different new projects with different swf files
    to see if it was just that file and I have the same results.
    Sorry so lengthly on my issues but this just sucks and I need
    help!! Anybody got any ideas!??
    Thank you!!

    Hi SaSQuaCh69247,
    Issue 1 :- Select the SWF file in library, right click, and
    select update.
    Issue 2 :- Actually it could be valid for Issue 1 also. It
    seems like SWF file you are trying to import, does some action
    like, importing another swf or connecting to server on the first
    frame itself. Captivate will try to play the first frame of SWF
    when you import them. Try creating a keyframe with the stop action
    as the first frame in your SWF, and see if you still have the
    issue.
    Issue 3 :- The approach I am mentioning over here is
    generally the last approach which I will take in such scenerios,
    but since you have already experimented a little, so try this.
    Go to C:\Documents and Settings\<user name>\Application
    Data\Adobe\Adobe Captivate
    Rename captivate_v20.dat as captivate_v20_org.dat.
    Restart Captivate Application.
    thanks

  • .fla into swf files

    Okay here is the deal. I downloaded a template for oscommerce
    that has a flash header (this flash file is main.swf). I am able to
    make the adjustments that are needed in Flash 8 but once I try to
    save it as .swf it tells me that I am unable to save it as an older
    file. It says that I can try to save as "save as" but everytime I
    save as main.swf it tells me the same thing again.
    Also is there anything special that needs to be done in my
    FTP program to upload flash files correctly?
    Thank you for your time guys.
    Mike

    According to http://help.adobe.com/en_US/flash/cs/using/WSd60f23110762d6b883b18f10cb1fe1af6-7f12a.html# WSc78c5058ca073340dcda9110b1f693f21-7acf
    asset is reflected in Flash immediately. 
    Edit a SWF file from Dreamweaver in Flash
    If you have both Flash and Dreamweaver installed, you can select a SWF file in a Dreamweaver document and use Flash to edit it. Flash does not edit the SWF file directly; it edits the source document (FLA file) and re‑exports the SWF file.
    In Dreamweaver, open the Property inspector (Window > Properties).
    In the Dreamweaver document, do one of the following: 
      Click the SWF file placeholder to select it; then in the Property inspector click Edit.
      Right-click (Windows) or Control-click (Macintosh) the placeholder for the SWF file, and select Edit With Flash from the context menu. 
    Dreamweaver switches the focus to Flash, and Flash attempts to locate the Flash authoring file (FLA) for the selected SWF file. If Flash cannot locate the Flash authoring file, you are prompted to locate it."
    But I don't see "Edit with Flash" option.  Maybe because I have a trial version of Dreamweaver?

  • Unable to convert swf files into fla files

    Hi,
      I tried using Dreamweaver to convert a SWF file into a FLA file so I can edit it in CS 5.  But when I right clicked the placeholder for the file, it doesn't have an "Edit in Flash"  option. What am I doing wrong?
    Thanks very much,
    Rosemary    

    According to http://help.adobe.com/en_US/flash/cs/using/WSd60f23110762d6b883b18f10cb1fe1af6-7f12a.html# WSc78c5058ca073340dcda9110b1f693f21-7acf
    asset is reflected in Flash immediately. 
    Edit a SWF file from Dreamweaver in Flash
    If you have both Flash and Dreamweaver installed, you can select a SWF file in a Dreamweaver document and use Flash to edit it. Flash does not edit the SWF file directly; it edits the source document (FLA file) and re‑exports the SWF file.
    In Dreamweaver, open the Property inspector (Window > Properties).
    In the Dreamweaver document, do one of the following: 
      Click the SWF file placeholder to select it; then in the Property inspector click Edit.
      Right-click (Windows) or Control-click (Macintosh) the placeholder for the SWF file, and select Edit With Flash from the context menu. 
    Dreamweaver switches the focus to Flash, and Flash attempts to locate the Flash authoring file (FLA) for the selected SWF file. If Flash cannot locate the Flash authoring file, you are prompted to locate it."
    But I don't see "Edit with Flash" option.  Maybe because I have a trial version of Dreamweaver?

  • Loading random .swf's in html page

    Desired scenario: I have a site which I want random .swf
    files to load into index page each time a user refreshes or visits
    the site.
    Solution: I used a Javascript array solution in the .html
    page. Note: it works perfectly in Firefox and Safari.
    The javascript code for that is listed below.
    Problem: In IE, the page which is supposed to load the
    random .swfs in blank. I tried to solve the problem by using an IE
    conditional statement with a single .swf embedded (so at least
    visitor could have interactive experience).
    <!--[if IE]>
    <object
    classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="
    http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0"
    width="800" height="600">
    <param name="movie" value="drinks.swf" />
    <param name="quality" value="high" />
    <embed src="drinks.swf" quality="high" pluginspage="
    http://www.macromedia.com/go/getflashplayer"
    type="application/x-shockwave-flash" width="800"
    height="600"></embed>
    </object>
    <script type="text/javascript"
    src="fixit.js"></script>
    <![endif]-->
    Any help would be appreciated. The link to the site in
    question is:
    http://www.jayminnickinteractive.com

    Thank you for checking. Yes right now they are all working.
    But many times I visit the flv's don't load - i wonder if it is a
    flash thing or more connected to my web host.
    Gary

  • How load swf file (flash 8) with adobe captivate 3 without enter the HTML?

    How load swf file (flash 8) with adobe captivate 3 without enter the HTML?

    Hi SaSQuaCh69247,
    Issue 1 :- Select the SWF file in library, right click, and
    select update.
    Issue 2 :- Actually it could be valid for Issue 1 also. It
    seems like SWF file you are trying to import, does some action
    like, importing another swf or connecting to server on the first
    frame itself. Captivate will try to play the first frame of SWF
    when you import them. Try creating a keyframe with the stop action
    as the first frame in your SWF, and see if you still have the
    issue.
    Issue 3 :- The approach I am mentioning over here is
    generally the last approach which I will take in such scenerios,
    but since you have already experimented a little, so try this.
    Go to C:\Documents and Settings\<user name>\Application
    Data\Adobe\Adobe Captivate
    Rename captivate_v20.dat as captivate_v20_org.dat.
    Restart Captivate Application.
    thanks

  • HELP! SWF file is not allowing me to publish in presenter

    I am in need of some help with a problem that I can not figure out. Presenter will not allow me to publish any courses that I have SWF files incorporated into to. Here is what happens. The SWF file plays just fine, as it is inserted into 1 slide, and works properly on powerpoint. When I go to publish the course, it does all the steps like normal, and looks like it is publishing and zipping the file correctly. Problem is when I go into the file where I am publishing/zipping file to, it is not there. Very odd.... I know it definately has to do with the SWF file because one of my courses does not have the video in it and that published and zips just fine. Any ideas on what the problem might be?
    I am using Adobe Presenter 7.06, Windows XP, and PowerPoint 2007

    To find out if the swf is AS2 or AS3 you can try the following
    From Presenter, click on Insert SWF and in the window that opens up, select a swf file
    If the swf is an AS3 swf, you will see a warning message towards the bottom of this window
    And regarding the problem that you are facing, its really strange as we have not heard of any such issues till now
    Can you try publishing to some custom folder(say create a folder on Desktop and choose the same in the publish dialog instead of the default location)
    and verify if the published files are getting generated or not

  • Load random swf but not same

    someone here helped with the code to load random SWF files
    into a movie clip...however, i need to make sure it doesnt load the
    one that's already playing, that it goes on to a new one
    everytime..

    i dont think saying thank you really does it, but really,
    thank you.. you've helped me countless number of times, and it's
    only made me better at what I do, so I really am great full .
    Thanks again

  • Random Buttons Appearing in Preview and SWF file

    My love/hate relationship with Captivate continues, although it is trending quite a bit towards the latter.  Here's the issue:  I have created a presentation from a powerpoint and when I preview the project, about half of the "slides" have a random gray captivate button just sitting in the top left corner.  This button cannot be clicked.  Just appeared out of no where as no button was ever inserted.
    When I view the SWF file, the slides that had the button now have a light pink square in the top left of the screen.
    Can someone please explain these phantom buttons/images... and more importantly, how to remove them so I dont have to re-create a presentation that's well into 24hrs of creation.
    Thanks.

    Does this button appear randomly on half the slides in the project or only the latter half of the slides?
    If there is a particular slide where they seem to start appearing, check that slide and the one before it for any objects that might have been set to appear for Rest of Project but have been hidden on the timeline layers so that they are not visible in Edit mode.

  • The old Flash SWF files that don't update in pages created with templates problem

    I hate to even ask this question again because I know it's
    been posted many times. I've read all the answers I could find but
    I'm afraid I still need help. I'm using Dreamweaver CS3 on a Mac.
    I've gone in preferences and unchecked "insert using browser-safe
    scripts" and "Convert tags" and I've tried to make my paths to the
    SWF files relative to the site root but I just can't get it to
    work.
    There are about three articles on what the Site Root path can
    be used for and why it's good or bad. I've read all those and I
    guess I'm dense because I just can't figure it out. I select site
    root from the "relative to" drop down menu and it makes no
    difference whatsoever. I look at the code and it seems OK. This is
    what it looks like:
    <param name="movie"
    value="/public/Images/Regional_Strength/Americas/Americas map.swf"
    />
    <param name="quality" value="high" />
    <embed
    src="/public/Images/Regional_Strength/Americas/Americas map.swf"
    quality="high" pluginspage=
    There are no ... before the directories and that's what it's
    supposed to look like. The files still don't show. Part of me has
    to wonder how the heck the html file would know which /image
    directory the swf file is in because this particular site is one of
    many self-contained site directories that sit in my public folder,
    each site has it's own image directory. I thought maybe I'm
    supposed to put the SWF files in the "image" directory right in the
    first level of the public directory. I moved the files in there
    changed the code to:
    <param name="movie" value="/public/Images/Americas
    map.swf" />
    <param name="quality" value="high" />
    <embed src="/public/Images/Americas map.swf"
    quality="high" pluginspage=
    It doesn't work. Like I said, after reading the three or so
    articles about the site root on the Adobe Help pages, I still don't
    understand. I'd appreciate someone clarifying this for me.
    Thanks

    > <param name="movie" value="/public/Images/Americas
    map.swf" />
    As a random educated guess, Is your local site folder defined
    to the correct
    folder? If it isn't, then dw can't make correct site root
    relative paths.
    Jumping to this from seeing the /public/ folder in the above
    path.
    Define the local site folder to the folder that directly
    contains the site's
    homepage index file.
    Use the "host directory" line in the remote site info to
    correct for any
    required subfolder in the ftp setup. If public files need to
    be placed in a
    subfolder on the remote named public or public_html or htdocs
    or www or
    similar, put that folder name into the "host directory" line.
    Also- to avoid problems adopt a file and folder naming
    convention that
    doesn't cause you to tear your hair out.
    Americas map.swf
    There is NO such thing as a blank space in a url. So don't
    use blank spaces
    in file or folder names.
    A conservative naming convention would be to use only
    a-->z and 0-->9 and
    the _underscore. No blank spaces, no punctuation, no mixed
    case.
    Right-click on the file or folder in the dw Files Panel and
    pick rename.
    Alan
    Adobe Community Expert, dreamweaver
    http://www.adobe.com/communities/experts/

Maybe you are looking for