Pass variable to swf  from html to load image

   var current_loader:Number = 1;
   var current_img:Number = 0;
   this.createEmptyMovieClip('img_01', 999);
   this.createEmptyMovieClip('img_02', 998);
   img_01._x = img_01._y = img_02._x = img_02._y = 20;
   var loader:MovieClipLoader = new MovieClipLoader();
   var listener:Object = new Object();
    listener.onLoadStart = function(target_mc:MovieClip) {
    listener.onLoadProgress = function(target_mc:MovieClip, numBytesLoaded:Number, numBytesTotal:Number) {
    listener.onLoadComplete = function(target_mc:MovieClip) {
         if(target_mc._name == 'img_01'){
            img_02._visible = false;
        } else {
            img_01._visible = false;
var interval:Number = setInterval(load_image, 1000);
function load_image() {
    loader.addListener(listener);
    loader.loadClip("http\\:google.com\flower.php", _root['img_0'+current_loader]);
    // set the next loader
    current_loader = current_loader == 1 ? 2 : 1;
    // set next image
    current_img = current_img == images.length - 1 ? 0 : current_img + 1;
// load the first image
load_image();

to comunicate between actionscript and a html page, you can use flashvars or the externalinterface class.

Similar Messages

  • How to passing value into Captivate from html?

    How to passing value into Captivate from html?
    Or
    How to communicate between objects in one slides?

    Hi czhao0378 and welcome to the forums!
    Captivate does not natively allow you to communicate your own
    data, either internally or externally. The only way to make this
    happen is to create your own functionality, either via custom-built
    Flash objects or JavaScript code executed in the browser or a
    combination of both.
    The only example I've seen of any "data passing" inside
    Captivate is a custom text input/output solution that was posted on
    the Captivate Developer Exchange:
    http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&loc=en_us&extid=1253 021
    This solution consists of an input box that takes information
    from the user on one slide and a second box that displays that
    information on another slide. The functionality was built in Flash
    and is embedded in Captivate as a Flash "animation". Unfortunately,
    since this is a custom functionality, the information is not
    included in the user completion results Captivate can pass to a
    Learning Management System.
    Since the solution mentioned above relies on a Flash
    Actionscript variable to hold the information that is displayed,
    you can also pass the information from HTML to Captivate using the
    "SetVariable" command in JavaScript. This would at least allow you
    to display your own HTML-based data inside Captivate.
    Beyond that, I'm not aware of any other way to gather and
    pass data in Captivate.

  • Viewing swf from HTML- user can view only once

    Hi,
    I have my swf files which are getting called in browser when user opens its corresponding page.
    To ensure my swf is not used by user for his other purposes, i had to strict it to view from HTML page which has a variable. Same variable is passed from swf to this HTML.
    if both variables does match then only swf starts preloading. this works fine for first time.
    But when user open the same page second time, he is only able to view preloader which does not progress further.
    When i delete my temp file then user is again able to view the swf only once.
    Can anyone tell me;
    1. what is reason the swf from temp file cannot access variable of its HTML
    2. am I doing it wrongly?
    3. do i need to clear cache everytime or their is another method to do it?
    Thanks.

    hello following is the code used;
    import flash.text.TextField;
    import flash.events.ProgressEvent;
    import flash.events.Event;
    import flash.display.MovieClip;
    //////////STAGE PROPERTIES//////////
    stage.showDefaultContextMenu = false;
    this.tabChildren = false;
    Mouse.cursor = "arrow";
    //////////CALL & SET VARIABLES//////////
    var Progress_txt:TextField = new TextField();
    var theFlashVar:String;
    var ver:String;
    var paramObj:Object = LoaderInfo(this.root.loaderInfo).parameters;
    for (ver in paramObj)
                    theFlashVar = String(paramObj[ver]);
    //////////START USER VERIFICATION//////////
    checkFlashvar();
    //////////HTML VERIFICATION//////////
    function checkFlashvar():void
                    //trace("CHECKING Flash VAR");
                    if (theFlashVar=="mystring01")
                                    InternalPreloader();
                                    //trace("pass var found");
                                    //InternalPreloader();
                    else
                                    //trace("VAR NOT FOUND");
                                    gotoLocalVar();
    //////////LOCAL VERIFICATION//////////
    function gotoLocalVar():void
    //////////LOAD LOCAL DATA////////// 
                    var keyLoader:URLLoader = new URLLoader();
                    keyLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
                    keyLoader.addEventListener(Event.COMPLETE, chkLocalVar);
    //////////CHECK ERRORS//////////
                    keyLoader.addEventListener(IOErrorEvent.IO_ERROR, onLoadError);
                    keyLoader.load(new URLRequest("C:/code.txt"));
    //////////CHECK LOCALLY LOADED DATA//////////
                    function chkLocalVar(event:Event):void
                                    if (keyLoader.data.passKey == "mycode")
                                                    //trace("pass key found");
                                                    play();
                                    else
                                                    //trace("Local VAR NOT FOUND");
                                                    stop();
                                                    parent.removeChild(root);
    //////////LOCAL FILE ERROR HANDELLING//////////
    function onLoadError(evt:IOErrorEvent):void
                    //trace("TXT FILE NOT FOUND");
                    stop();
                    parent.removeChild(root);
    //////////INITIATE PRELOADER STATUS//////////
    stop();
    function InternalPreloader():void
                    stop();
                    Progress_txt.x = 400;
                    Progress_txt.y = 300;
                    addChild(Progress_txt);
                    //trace("load progress event");
    //////////CHECK PRELOADER STATUS//////////
                    if (this.loaderInfo.bytesLoaded == this.loaderInfo.bytesTotal)
                                    //trace("checking if condition");
                                    finishedLoading();
                    else
                                    progressLoading();
    //////////PRELOADER PROGRESS EVENT LISTENERS//////////
    function progressLoading():void
                    //trace("progrss loading is running");
                    this.loaderInfo.addEventListener(ProgressEvent.PROGRESS,onProgress);
                    this.loaderInfo.addEventListener(Event.COMPLETE, onComplete);
    //////////PRELOADER PROGRESS STATUS UPDATE//////////
    function onProgress(p:ProgressEvent):void
                    Progress_txt.text = String(Math.floor((p.bytesLoaded/p.bytesTotal)*100))+ "%";
                    preloader_mc.bar_mc.scaleX = (p.bytesLoaded/p.bytesTotal);
                    //trace("checking progress");
    //////////PRELOADER STATUS COMPLETE-REMOVE LISTENERS//////////
    function onComplete(d:Event):void
                    //trace("Fully loaded, starting the movie.");
                    play();
                    //removing unnecessary listeners
                    removeChild(Progress_txt);
                    loaderInfo.removeEventListener(ProgressEvent.PROGRESS, onProgress);
                    loaderInfo.removeEventListener(Event.COMPLETE, onComplete);
    //////////PRELOADER STATUS 100% (LOCAL CONDITION)//////////
    function finishedLoading():void
                    //trace("loading completed");
                    removeChild(Progress_txt);
                    play();

  • Control .swf from html

    Is there a way to control or communicate with a swf from
    outside of that swf. On my page Im loading an .swf and a separate
    layer with html. Can I create a link to tell the swf to load a
    movie?

    Funks Da Burn wrote:
    > Is there a way to control or communicate with a swf from
    outside of that swf. On my page Im loading an .swf and a separate
    layer with html. Can I create a link to tell the swf to load a
    movie?
    you are looking for LocalConnection
    google for "LocalConnection samples" or check the help files
    for details.
    Tho with all honesty, checking out samples is way more
    understandable than
    the attached help files.
    Best Regards
    Urami
    "Never play Leap-Frog with a Unicorn."
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • Pass data to JSP from HTML?

    I can pass the data in a HTML form without problem if the form is in the same jsp file. I have no problem to pass data from one jsp file to another one. But when the jsp file has to take the data passed from calling HTML file and has to receive the data from the same jsp file, then the data from other HTML file will be null the first time runing the code, then second time will be passed right. If I shut down computer run the code again, same problem until the second time. Please tell me why if any of you know!

    yes. The first part is HTML file which use the form to pass v_progname, the second part is a jsp file, it suppose to get the data in v_prgname, but the first time to run this code always get null, then the second time get the right data?
    <html> <head> <title>CTI</title>
    <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> </head>
    <body bgcolor="#FFFFFF"> <form name="theForm" enctype="text/html" method="post"
    action="http://titan.ssd.loral.com:7778/ifs/jsp-bin/ifs-cts/jsps/uploadfilehome.jsp">
    <table border="1" cellspacing="0" cellpadding="4">
    <tr> <td bgcolor="#FFFFEE"><font face="Arial, Helvetica,sans-serif" size="2"> Communication racking Item </font></td> <td colspan="5"><font face="Arial, Helvetica, sans-serif"size="2">SATMEX-6-2 </td>
    <input type="hidden" name="v_sidname"value="/expctl/dev//comm_tracking.edit_document">
    <input type="hidden" name="v_schema"value="migra2">
    <input type="hidden" name="v_cti_number"value="SATMEX-6-2">
    <input type="hidden" name="v_progname"value="satmex-8">
    <input type="hidden" name="v_doc_id"value="5131"> </tr> </table><br>
    <input type="submit" value="Upload Document">     
    <input type="reset" value="Reset"></form></body></html>
    uploadfilehome.jsp as following:
    <html><head>
    <%
    String v_program=request.getParameter("v_progname");//this is the parameter passed from html file, //with a problem?
    WebUILogin login = WebUILogin.getWebUILogin( request );
    String step = WebUIUtils.getUTF8Parameter(request,"step");
    //String path=WebUIUtils.getUTF8Parameter(request,"path");
    String path="/home/scott/satmex-6";
    String windowID=WebUIUtils.getNewWindowID();
    %>
    <SCRIPT LANGUAGE="JavaScript1.2">
    var path="<%=path%>";
    var jsWindowID="<%=windowID%>";
    </script>
    <%
    if ( null == step )
    step = "get";
    %>
    <SCRIPT LANGUAGE="JavaScript">
    function AutoLogin() {
    document.loginform.userName.value == "scott";
    document.loginform.passWord.value == "tiger";
    document.loginform.submit();
    function PkeyPress(event)
    if (document.layers)
    if (event.which==13)
    document.loginform.submit();
    else {
    if (window.event.keyCode==13)
    document.loginform.submit();
    </SCRIPT>
    <%
    if ( step.equals("try") )
    login.processRequest(request);
    %>
    <SCRIPT LANGUAGE="JavaScript1.2">
    window.location='../jsps/uploadhome.jsp?path='+path+'&windowID='+jsWindowID;
    </script>
    <%
    // check to see if we have already logged in before...
    if ( null != login.getSession() )
    %>
    <SCRIPT LANGUAGE="JavaScript1.2">
    window.location='../jsps/uploadhome.jsp?path='+path+'&windowID='+jsWindowID;
    </script>
    <%
    else
    %>
    <title><%=login.getJspResourceString(JspResourcesID.LOGIN_TITLE)%></title>
    </head>
    <body bgcolor="#FFFFFF" onLoad="AutoLogin();" onResize="return false;">
    <form METHOD=POST NAME="loginform" ACTION="uploadfilehome.jsp">
    <INPUT TYPE="hidden" NAME="userName" VALUE="scott">
    <INPUT TYPE="hidden" NAME="passWord" VALUE="tiger" onKeyPress="PkeyPress(event);">
    <INPUT TYPE="hidden" NAME="step" VALUE="try">
    <INPUT TYPE="hidden" NAME="action" VALUE="Login">
    </form>
    </body>
    </html>
    <%
    %>

  • Passing variables into CVI from TestStand.

    Is there a different way to send variables into CVI from TestStand other than the input buffer? Parsing that string is annoying and bulky. Isn't there an easier way?

    Hi,
    Here is a short cut to another example which will use the StationGlobals -
    http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=313&HOID=506500000008000000301F0000&UCATEGORY_0=_8_&UCATEGORY_S=0
    There are loads of other examples either as part of the examples provided by TestStand installation or in the Resource Library under TestStand on the NI website
    Good Luck
    Ray Farmer
    Regards
    Ray Farmer

  • SWF file doesn't load images correctly and buttons do not always work properly.

    YO!
    I have a big problem - I decided to make a website using flash as I am good with photoshop and thought it would be fairly easy to construct in flash using tutorials. All went well except now the website is published, weird things happen. The homepage works fine but when you click on "portfolio" some of the buttons don't appear and when you try the buttons, some images don't appear. Occasionally some of the buttons take you to the wrong place also. When I test the movie in flash, everything works fine so I can't work it out. PLEASE HELP! Ps. I am a complete novice so advice will have to be spelt out in black and white.
    Thanks in advance. Website is here:
    www dot branadesign dot com

    This tends to happen when i press the portfolio button (note only half the buttons on the side appear):
    This sometimes happens when I press the services button (doesn't go to services page and shows buttons down side when it shouldn't):
    I have published the flash file as a SWF and assume all the images are embedded in the file. If you keep pressing buttons repeatedly, the website starts to work which makes me think they are all there but only work once the web browser has cached all the images. I have tried it in firefox and IE with similar effects.
    Pab

  • Send variable to Flash from HTML link

    Does anyone know if it's possible to include a variable in an
    html link <a> tag that can set a variable in Flash. I have
    used JavaScript to do this in the past but would prefer not to on
    this site. I also would prefer not have to use a server side script
    or xml, as all I want to do is set multiple links on one html page
    to open the same Flash movie on another html page, but make it go
    to a particular frame or load a particular external swf based on
    the link that was clicked. Thanks, JD

    You need to use them in the object and embed tags.
    Dan Mode
    --> Adobe Community Expert
    *Flash Helps*
    http://www.smithmediafusion.com/blog/?cat=11
    *THE online Radio*
    http://www.tornadostream.com
    *Must Read*
    http://www.smithmediafusion.com/blog
    "JDRives" <[email protected]> wrote in
    message
    news:efcb61$rkb$[email protected]..
    > Do I need to use Flash Vars in the object and embed code
    to load them in
    > or will they automatically be passed to the variable on
    the _root level of
    > the SWF file? Thanks for your quick reply, JD

  • Passing parameters to Flash from HTML or JavaScript

    Hi. How do I pass paramaters to a Flash movie without using
    the "../name.swf?param=value" syntax. I have a Flash menu that
    jumps to a certain keyframe depending on the value specified inline
    with the .swf address, which corresponds to the page being viewed.
    The only problem is that, when another page is loaded, the menu
    flickers and reloads because it's not cached: the browser thinks
    it's another file when in fact it's just a different address
    telling it where to go in the movie to update the menu for the
    current page.
    Any ideas how to do this with either HTML or JavaScript? Help
    and suggestions are truly appreciated!

    The other method for doing this is using the Flashvars param.
    You can read about it in the LiveDocs here:
    http://livedocs.macromedia.com/flash/8/main/00001206.html
    Don't know if it will solve your problem, but it is the other
    of the two main ways of passing in variables.
    Good luck!

  • Loading external swf, from a previously loaded external swf.

    I'm trying to figure out if its possible to have a page that
    loads an external swf (easy, know how to do that), but then, from
    clicking on a button thats inside that loaded swf, load a different
    external swf in its place. Any ideas?

    I've tried a few things... including what you suggested, but
    either I'm still not putting the code in the right spot... or the
    code isn't working like it should. I have a zipped folder of the
    project files on my server if you could download and take a look. I
    have a readme file in there too explaining exactly what I want
    accomplished.
    http://www.deltawavefilms.net/little_example.zip

  • Randomly load swf on html page load

    I am looking for a way to load random swf files on a page
    load.
    I will have 1.swf, 2.swf, 3.swf, and so on. I want my html to
    reference "randomnumber().swf" when it loads (or something like
    it). Any simple ways to do this? I'm a newb, so the more detail the
    better.
    Thanks in advance.

    I must be doing something wrong. First time I have ever
    messed with project.
    I created a new project and over in the project window I
    right-clicked and chose "Add File" and added my swf files. I went
    to INSERT | NEW SYMBOL and created a movie clip called mc0. I
    couldn't find where to change its position, so I tried CTRL-K on it
    and tried different alignments on the stage (I don't think that
    worked very well). I didn't know if you wanted the code on the
    first frame of the movie clip or the main timeline. Based on the
    code I thought the main timeline, but I put it in both just in
    case.
    Doesn't seem to work for me. Can someone fill in the gaps for
    me?

  • Pass Variables into Flash from URL

    I have a real simple request for some reason cannot pull it
    off. I have a url that looks like this:
    http://mywebserver/directory1/directory2/webpage.html?name=Mark
    I am trying to pull the variable "mark" into a swf. The URL
    will change depedning on the user and I plan on adding additional
    variables as well (lastname, state, age, etc).
    Easy answer to this? If so, please excuse my ignorance. I use
    actionscript 2 but would consider myelf a novice as I am more into
    design.

    Using FlashVars would work, as would SWFObject - which is
    what I'd use. Glad
    yout got it though.
    Dave -
    www.offroadfire.com
    Adobe Community Expert
    http://www.adobe.com/communities/experts/

  • Passing values to jsp from html..

    Hi all,
    I have a jsp containing a selection list and need to pass the value to the java segment of the jsp. When reserching this, I've found some info where an html page was created, an initial jsp was saving the info (or bean was used) and then a third jsp displayed the data (using buttons). This is too many steps and I'm needing a way for the same jsp to display containing the selected option (simulating a refresh with the post when the drop down list is used). Is redirecting while setting and getting attributes all at once feasible/possible or is there a better direction or work around for this?
    Thanks in advance,
    Geoff-

    I would think submitting the page to itself, and setting hidden fields to signal that it is a resubmission, may be the way to go. If the new information being displayed is minimal, JavaScript may also work, by setting up an empty <div> or <span> and setting the innerHTML or innerText properties. The advantage of the JavaScript solution is it would be quicker, having the client do all the processing, but it also browser dependant.

  • Focus to swf from html page

    Hi
    I'm trying to control my swf file using keypresses.
    I can test it perfectly in the flash environment however when
    I try to publish it to a webpage I can't get the focus to the swf
    to get it to action on the keypress.
    I presume I'm missing something basic - hopefully!

    to comunicate between actionscript and a html page, you can use flashvars or the externalinterface class.

  • Use SESSION variable in URL from HTML region

    Hello,
    I have what looks like a simple question but i've been struggling with it for three days now, and i need your help!
    I have a page, with an HTML region. I want to display some links to other pages within the application, so i thought i'd use this:
    a href="http://server.xxxx.com:7777/pls/htmldb/f?p=114:13:&SESSION"
    But the session ID is not interpreted, and the link doesn;t work. Any idea what's wrong here? or how i should create links with the session id in it?
    Thanks!!!! Matt
    Message was edited by:
    matt_amsterdam

    Matt,
    You've missed off the period (.) off the end, use &SESSION. instead

Maybe you are looking for

  • Rental DVDs won't play

    I just purchased a new MBP C2D 2.16 with a French keyboard layout. I noticed that the DVD drive model was not the Matshita UJ-857D that came with my roommate's MBP C2D 2.33. Instead, the model number on mine is a HL-DT-ST DVDRW GWA4080MA. I'm having

  • IPod Mini Delayed Write Error

    Hi, I have an iPod Mini 2G, and It has a delayed write error when I try to update it in Windows. I ran the Diagnostics and it said the Hard Drive failed. I stil have about two months left onb the service plan. Should I send it in?

  • Application is too large for target memory

    Hi, I'm working with the Luminary ARM Evaluation Board and Labview Embedded for ARM. Right now I'm having a very critical problem : the code cannot fit into the cpu memory. There are a few things I was wondering if you guys could help me with : 1. Is

  • Logged in somewhere else

    I've logged into spotify on someone else's PlayStation by mistake and now I can't link my account back to myown PlayStation. Is there a way of remotely unlinking the account as I'm not sure who's PSN account it's now linked too

  • Playbook hanging on "limited Warranty" Screen

    Hope somebody can help.... I have a BlackBerry playbook that is hanging at the limited warranty screen, no ability to access WIFI settings, no text on screen except the title - never got past the Blackberry ID screen, now cannot do anything on device