Alternate .swf

Don't laugh !
Something so simple I can't set it up...
I load a .swf into a movie clip.
How can I write my code in order to load an alternate .swf in
case the one first called doesn't exist?

quote:
Originally posted by:
Jan-Paul K.
If you used the MovieClipLoader class you can easily add a
listener the listens on the onLoadError event, and in case it is
fired loads the other swf
I didn't reach it...
Here is the code I use (_root.holder_mc is the targeted movie
clip in which draw3.swf must load and draw.swf the alternate .swf)

Similar Messages

  • Detection Kit needs Testing Help

    http://www.wonderfulmachine.com/
    I have the detection kit on this page.
    Detect for 7 and above.
    The flash file is 7.
    It seems to be working on a Mac just fine.
    Not sure about the PC.
    Can you test it on the PC?
    Can you tell me what Flash you have?
    Can you look at the code and make sure it is right?
    - Steven

    Hey I'm a PC XP SP2 user
    Your site worked just fine with flash player 9 in both IE 6
    and Fire fox.
    To try and stump it, I uninstalled my player and reinstalled
    flash player 6r21 to see if it would cause problems... In internet
    explorer, it actually still worked just fine which suprised me.
    With player 6r21 in firefox, it said that I needed to install
    flash so I did and it updated me to 9 but it redirected me (which
    is the only way with player 6r65 and lower.
    So I uninstalled again and tried verstion 6r65 and again it
    worked with ie, but with firefox I had to be redirected to install
    flash 9.
    the flash detection kit offers an alternate .swf installer
    that can update players 6r65 and up so if you want into look at
    that and then more info about it, you can look here
    http://www.adobe.com/devnet/flash/articles/fp8_detection.html
    Also, IE has added some really really annoying security
    features in very recent history. One of those features makes you
    have to click on flash (and other rich content) to activate it
    before you can interact with it... very very annoying for
    devolopers and users. This link:
    http://www.amarasoftware.com/flash-problem.htm
    explains the problem really well and offers a very simple solution
    that I advise you apply to all of your flash pages. Their simple
    way has worked for me, but there is also the macromedia endorsed
    way that the article talks about, but I didn't bother with it for
    its overcomplexity. This is very very recommended as many of your
    targets with probably be using IE.
    i hope I helped

  • Swfobject 2.2 in FireFox displays swf twice when using alternate content

    I have built a Flash site and also set it up with alternate content so it can be viewed on iPhone and iPad as well as other mobile devices.  It works great everywhere but in FireFox the site's swf loads on the page twice.
    Has anyone else experienced this issue and if so, what have you done to work around this FireFox bug?
    You can view the url that I'm using to test at http://www.turntwomedia.com/index-altContent.html

    Check out this post -
    http://support.mozilla.com/en-US/questions/669348

  • FireFox shows swf twice in browser when swfobject is used to display alternate content. Is there a fix for this?

    I'm using swfobject to display alternate html content on a Flash site. In FireFox only it loads the site's swf twice. It does not happen with any other browser. You can view the site I'm testing at http://www.turntwomedia.com/index-altContent.html
    == This happened ==
    Not sure how often
    == I was testing the site in all browsers.

    You have both an EMBED and an OBJECT without a classid that is displayed by Firefox in addition the the OBJECT with a classid for IE.
    You need to remove one of them.
    Either use the EMBED or the object with the conditional code () that hides it from IE.
    <code>&lt;object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="955" height="775" id="myFlashContent"&gt;
    &lt;param name="allowScriptAccess" value="sameDomain" /&gt;
    &lt;param name="allowFullScreen" value="false" /&gt;
    &lt;param name="movie" value="TurnTwoMedia_web.swf" /&gt;&lt;param name="menu" value="false" /&gt;&lt;param name="quality" value="high" /&gt;&lt;param name="bgcolor" value="#ffffff" /&gt;
    &lt;embed src="TurnTwoMedia_web.swf" menu="false" quality="high" bgcolor="#ffffff" width="955" height="775" name="TurnTwoMedia_web" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" /&gt;
    &lt;!--[if !IE]&gt;--&gt;
    &lt;object type="application/x-shockwave-flash" data="TurnTwoMedia_web.swf" width="955" height="775"&gt;
    </code>

  • Help with SWFObject2, problem with display of alternate image

    I'm trying to use SWFObject2 dynamic publishing version to test the visitors browser for flash pluggin and the version.
    I want to only show my flash image if the browser finds the flash plug in and it supports the correct version of flash for my banner, otherwise I want to display a jpeg image in its place.
    When flash support is available in my browser the flash image is displayed, no problems. But when Javascript or flash plugin support is not available and my alternate image jpeg is displayed something wierd happens and i would appreciate any help on this:
    The image is displayed but is pushed to the right of the screen and it seems to have a box behind the image, the edge of the box is only visable and changes colour on rollove like it wants to be clicked, obviously i cannot see what the box is because the image covers it. There is nothing wrong with my image, i put that in place first and tested it loaded ok before i added the SWFObject code and file.
    My code is below:
    <script type="text/javascript" src="Scripts/swfobject.js"></script>
    <script type="text/javascript">
    swfobject.embedSWF("advertise_banner.swf", "altContent", "468", "60", "6.0.0", "expressinstall.swf");
    </script>
    </head>
    <body>
    <div id="wrapAltContent">
    <div id="altContent">
    <a href="advertise_banner.php?ad=y">
    <img src="Images/advertise_banner.jpg" alt="Image linking to information on  advertising a banner ad on Choose Almeria" />
    </a>
    </div>
    </div>
    Looking forward to replies.

    Hi,
    Is this your question still relevant? If yes, did you study already this for example?
    http://code.google.com/p/swfobject/wiki/documentation
    Hans-G.

  • Can I create more than one URL link in a single Flash (SWF) file?

    I created a simple SWF slideshow in Flash with 5 slides. I was able to link one URL to the whole file by adding an alpha button.
    What I can't figure out is how to add a URL link to each slide. The SWF file i sused on a website and I would like to be able to click on a particular slide as it is playing to go the a site or page that applies to that slide.
    Is there a way or code I can use to do this??
    This is the code I am currently using for the button now.
    ja_btn.addEventListener(MouseEvent.CLICK,mouseClick);
    function mouseClick(event:MouseEvent):void
                   var request = new URLRequest("http://www.jakeandamos.com/");
                    navigateToURL (request,"_blank");
    I am just learning this stuff so I can use your help, Thanks!

    You cannot duplicate instance names or function names, so you'll need to create unique names for each one that behaves differently.  So you can only have one function named "mouseClick"... if you want to have another function to link somewhere else you need to create a new name for that function ("mouseClick2" would work)
    There are alternate approaches, but for now this will be the easiest for you to deal with.

  • Accessing a non TTF/OTF font embedded in Flash CS5 SWF via Flex

    Hello,
    I'm trying to embed an older Mac font in a Flash Builder application. I need it to be loaded dymanically for size reasons. I am able to do this with TTF and OTF fonts, but I'm having trouble with other formats.
    I embedded the font in a CS5 FLA, but I can't seem to locate the font when I load the SWF into Flash Builder.
    My function is below. I have it enumerating through the variables in the loaded SWF, but the font I need is not coming up as one of them. I tried, in the FLA, to cast the embedded font to a Class in AS because, but when try to access that variable ("font") after it's loaded, I get null. I also tried setting the embedded font to a Font variable in AS, but I still get null on the other side. Does anyone have any suggestions? Alternate solutions are welcome also.. Thanks!!
            private function loadFonts():void{
                var lc:LoaderContext = new LoaderContext();
                lc.securityDomain = SecurityDomain.currentDomain;
                lc.applicationDomain = ApplicationDomain.currentDomain;
                var ldr:Loader = new Loader();
                ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
                ldr.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
                ldr.load(new URLRequest('compatil_bold.swf'),lc);
                function completeHandler(e:Event):void{
                    fontLibrary = e.target.applicationDomain.getDefinition('Compatil') as Class;
                    var varList:XMLList = flash.utils.describeType(fontLibrary)..variable;
                    for (var i:int = 0; i < varList.length(); i++){
                        trace(varList[i].@name+': '+fontLibrary[varList[i].@name]);   
                    Font.registerFont(fontLibrary.font);
                    //Font.registerFont(fontLibrary.CompatilFactBold);
                    trace('font loaded');
                    fontsLoaded = true;
                function ioErrorHandler(e:ErrorEvent):void{
                    trace(e.text);
    in FLA
    var font:Class = new CompatilFactBold() as Class;

    I got it!
    Here is the embedded font in a CS5 FLA:
    That's all you have to do in Flash.
    Here's the function I have in my Flash Builder AS application:
    private function loadFonts():void{
    var lc:LoaderContext = new LoaderContext();
    lc.securityDomain = SecurityDomain.currentDomain;
    lc.applicationDomain = ApplicationDomain.currentDomain;
    var ldr:Loader = new Loader();
    ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
    ldr.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
    ldr.load(new URLRequest('http://some.other.domain/compatil_bold.swf'),lc);
    function completeHandler(e:Event):void{
    fontLibrary = e.target.applicationDomain.getDefinition('CompatilFactBold') as Class;
    Font.registerFont(fontLibrary);
    trace('font loaded');
    fontsLoaded = true;
    function ioErrorHandler(e:ErrorEvent):void{
    trace(e.text);
    Then you reference the font by its name when you want to use it. In this case: 'CompatilFact LT Bold.'
    update: question is answered.

  • How to Code SWFObject with Alternate Content

    I've read umpteen tutorials and articles on embedding Flash
    with alternate content, and they're all too different, confusing,
    and unsuccessful. All I want to do is insert a JPEG to replace my
    Flash movie on non-Flash browsers but have no idea how or where to
    code it. I don't want to get into xml or div IDs (if I don't have
    to)... just a simple-as-possible, idiot-proof solution for a
    beginner like myself.
    Here is my Flash object...
    <td width="400" height="240">
    <object
    classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="
    http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
    height="240" width="400">
    <param name="movie" value="images/flashintro.swf" />
    <param name="quality" value="best" />
    <param name="play" value="true" />
    <embed height="240" pluginspage="
    http://www.macromedia.com/go/getflashplayer"
    src="images/flashintro.swf" type="application/x-shockwave-flash"
    width="400" quality="best" play="true"></embed>
    </object>
    </td>
    Thanks.

    docmentation:
    http://code.google.com/p/swfobject/
    AIR app that generates it for you:
    http://code.google.com/p/swfobject/downloads/list
    The body code will look like something like this:
    <div id="flashContent">
    <center><p>Please update to the latest version
    of <a href="
    http://www.adobe.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"
    target="_blank" title="Flash Player">FLASH</a>, and enable
    <a href="
    http://gsaauctions.gov/brow_details/IE6instr.htm"
    title="Enable Javascript"
    target="_blank">JAVASCRIPT</a><br /> or view site as
    <a
    href="index2.php">HTML</a></p></center></div>
    <script type="text/javascript">
    // <![CDATA[var so = new SWFObject("flash.swf", "mymovie",
    "950", "600", "8", "#FFFFFF");
    so.write("flashContent");
    </script>

  • Loading external swf in array using wildcard in as3?

    Hi
    I can use the following code to load in a specific swf:
    var clips:Array = ["001/001.swf"];
    but how do I tell Flash to load whatever file is in the 001 folder without stipulating a specific filename?
    Thanks
    Shaun

    Not possible in Flash Player. Though this is possible in AS3 the API is only supported for AIR runtime and not for FP.
    The alternate way is to achieve this using PHP script which you can use in combination with AS3.

  • SWF placing in web pages?

    Hi guys,
    this is one for those familiar with web building.
    I have a page here: (note this page does not contain the alternate content described below as the page is 'live' and it dosent display swf's properly as explained below. this is to show the layout I have)
    note, content of site is a little explicit (language)
    http://http://www.wayouttshirts.co.uk/T_Shirt_Gallery.html
    on which there are many images in rows and columns. Each image is an swf file, which also needs to contain alternative content written into the <div> which it replaces (this is embedded with swfObject as you will see from the code)
    Im using webstudio to position the swf files on the page currently by placing the code below into a html 'object' on the webstudio page.
    However when i view the page (with and without flash installed) the alternative content seems to display well as depicted by the code, but the swf's have a mind of their own and seem to be lining up vertically.
    Heres the code for three of the instances when the alternate content is used:
    <script type="text/javascript" src="swfobject.js"></script>
    <div id="fairly">
    <div style="position:absolute; top:50px; left:50px;">
    <a href="http://www.wayouttshirts.co.uk/Fairly_wasted_1.html"><img src="http://www.wayouttshirts.co.uk/fairly.png"></a>
    </div>
    <div id="eyes">
    <div style="position:absolute; top:50px; left:170px;">
    <a href="http://www.wayouttshirts.co.uk/Eyes.html"><img src="http://www.wayouttshirts.co.uk/eyes.png"></a>
    </div>
    <div id="penny">
    <div style="position:absolute; top:50px; left:300px;">
    <a href="http://www.wayouttshirts.co.uk/See_a_penny_1.html"><img src="http://www.wayouttshirts.co.uk/see a penny.png"></a>
    </div>
    <script type="text/javascript">
       var so = new SWFObject("fairly.swf", "fairly", "300", "300", "8", "#336699");
       so.addParam("wmode", "transparent");
       so.write("fairly");
    </script>
    <script type="text/javascript">
       var so = new SWFObject("eyes.swf", "eyes", "290", "290", "8", "#336699");
       so.addParam("wmode", "transparent");
       so.write("eyes");
    </script>
    <script type="text/javascript">
       var so = new SWFObject("penny.swf", "penny", "315", "315", "8", "#336699");
       so.addParam("wmode", "transparent");
       so.write("penny");
    </script>
    So how do you control the position of the swf file within the page?
    Any help appreciated!
    Dave
    P.S if anyone can help with the annoying problem of the magnifying glass sticking on the sides of the images on rollout that would also be ace!! (dont ask for much do i
    Thank you v much!

    It is due to Microsoft Implementing ActiveX security features
    in IE.
    here is the fix that everyone is using:
    http://blog.deconcept.com/swfobject/
    Shane

  • Combine files to make a 1 swf file

    Hello all! New to flash. I have a couple files that i would
    like to have "alternating" on my site. So, if you are on the home
    page, i would like to have these files change or alternate between
    the images. How would i do this using flash?

    No.I am using Loader since I dont need to pass one URL for fetching swf content.I need to get the displayobject from ByteArray which should be free from all the security issues.I heard that we cannot set 'securityDomain' property of loaderContext (using in Loader) in AIR.So please give a solution for getting bytes.

  • .swf object/embed problem (only on Win XP IE)

    I have a swf move on domain
    http://www.foo.com. I am trying to
    embed this swf movie on a webpage hosted on
    http://www.bar.com.
    Mac OS X (all browsers) and on Windows Netscape (7.2 and
    8.0/8.1 using the Firefox display option) and Firefox work fine!
    Just IE 6 on Win XP... does not work. Will not display Flash
    content, will not display alternate content, will not display
    error... simply displays.... nothing!
    (sample URL:
    http://www.lerchdesign.com/header.html)
    Please advise. Thank you.

    What version of Firefox are you using, and do you use the FF plugin_container?
    I don't know if this is actually a Flash Player problem; perhaps you should also ask in the Flash or Flex forum.

  • Lagging swf

    what's up guys,
    i've been away for a vacation and just returned. hope
    everyone is well.
    i also have a question:
    i have a swf that works beautifully in my flash player, but
    when published into an html file it seems to lag. i don't have any
    onEnterFrame's or setIntervals that are not properly terminated.
    anyone have any thoughts? one last thing, does anyone know if
    publishing a swf to detect a user's flash version should include
    some flash generated javascript? if not, what is a good way to
    approach detecting a user's flash version (mac and pc) and linking
    to an alternate html file?
    thanks,
    _name

    For the lagging part... I can't say for sure. The browser
    players are supposedly a little slower than the standalone player
    so that could be part of it, and may have greater impact on fps etc
    if there is a lot of code running in onEnterFrames or intervals if
    its sluggish overall. If its just slow to start in comparison then
    that could just be the download rate, especially if you have a lot
    of code or symbols set to export on frame 1.
    In terms of detecting flash version, I tend to use the
    utility with swfobject (javascript) which I also use for embedding.
    There are examples for what you want to do I think on the site,
    plus the expressInstall option if you want to do that instead.
    http://blog.deconcept.com/swfobject/

  • Preload swf in web pages

    Hi,
      I am trying to load a flash object in html using javascript. I have a requirement that i want to load the swf prior to loading html content. because in the html code i have a meta tag to refresh the page and redirect to other url. what i am doing In swf is some calculations and return the value to a javascript function. My problem is swf (500bytes, 1 * 1 size) is loading slowly and the control is redirecting to other resource.
    how can i preload flash (swf)

    Well, most people approach this from the angle of preloading INSIDE the swf content.  Google 'flash preloader'.  We have technotes on the topic too (it's a very common topic).
    If you -must- do it from the HTML side, then you're probably going to need to use some type of hidden div that you load first, provide some kind of alternate html content until that's loaded, and then that DIV either moves into your main display area.

  • Camtasia SWF and Robohelp x5 - Please help!

    I think the summary says it all. I produce a swf file using
    Camtasia (a well known and popular video producer) and when I
    include all the video files in the project, nothing shows up after
    it's compiled (there are 4 files: an swf video, controller htm
    file, config xml file, and html display wrapper file. The strange
    thing is that it works fine when I'm in my Robohelp project and
    click on the view icon. I see everything there. But when it's
    compiled, no video and no controller bar. I have found a hack fix
    for it here:
    http://forums.techsmith.com/archive/index.php/t-1358.html,
    but can't even get this code to work. I'm hoping that one of you
    might have encountered this problem, or have a solution for me.
    Otherwise, I can include just the swf file as a video and include
    it as multimedia in the project through the "Robohelp" way, but I
    don't get any controller bar. I'm amazed that robohelp x5 is
    lacking simple controller bar functionality for multimedia files
    (and flash more specifically). That's beyond baffling. In any
    event, it would really be nice to find a simple fix for
    this.

    Thanks for the welcome to the community.
    Adding the files into the baggage folder does nothing. The
    problem seems to lie in the xml file not being readable by the
    compiled CHM file. I have no doubt that the swf file can be played
    and viewed. But for some reason the compiled version does not find
    the xml file (even though I confirmed it IS being included in the
    CHM compilation). It's a really bizarre situation and makes
    absolutely no sense to me, unless the compilation is changing file
    names or has some scripts internally that disrupt the path
    locations of these files.
    I've verified all the files are in a single location under a
    folder in my help project, so there's no reason why they shouldn't
    work correctly. I even verified that this setup works before
    compiling by clicking the "View" icon at the top of the help
    project window and testing the video / controller. All works like a
    charm.
    If I were a better programmer, I could probably fix this. But
    my programming skills are novice at best.
    I also would prefer not keeping any of the files outside the
    chm, as that can open up more hassles than it's worth. Especially
    when you distribute help files on all kinds of different computer
    configurations. I don't have to use the swf format either. I just
    need a simple way to include a control bar with the multimedia
    included in the Robohelp project. I would think Robohelp would come
    with pause, stop, play, rewind, ffwd options. But apparently we're
    still in the early 1990's or something?
    So is there any alternate solution / video format that will
    give me a control bar in a compiled CHM file? Or is that asking for
    a miracle?
    PS: I don't have adobe captivate, and my company is not going
    to purchase it at this time. As much as I'm trying to push them in
    that direction.
    Thanks in advance for all your help. It is greatly
    appreciated.

Maybe you are looking for

  • Keyword searches

    I have some photos with keywords that when searched for shows up with other photos that doesn't have the keyword assigned to them, and a couple of photos tag along that does not have any keywords assigned to them. What's wrong with iPhoto and keyword

  • Iphone refuses to complete sync/install apps

    Hello everybody, a week ago I recieved an Iphone (3G) that seemed broken, it didn't even start. Well after some tries I managed to get it working (updated it to 3.0 now). The problem now is that it won't sync properly... after a song or 6 it freezes.

  • Memory allocation model on Windows

    We have an application server with 16 GB of RAM and 54 GB of SWAP. The application server run on a Windows 2003 IA64 SP2. We are using 6.40_ex2 kernel. When we run intensive memory program (program that use a lot of memory in internal table) we see t

  • Stop connection timeouts from happening - want the page to wait

    I run multiple tab that monitor various tools. These pages refresh themselves. The pages have to wait for each other to finish before they can start. In version 28 this was fine. The page would just wait indefinitely and kick in when a previous page

  • Menu Button

    I have recently updated the firmware on my N73 ME and one thing is puzzling me. When the phone is starting and the standby screen is shown. Pressing & holding the Menu Button shows all applications running. I am suprised to find the music player icon