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.

Similar Messages

  • 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();

  • Read Text from HTML-Pages and want to solve "ChangedCharSetException"

    Hello,
    I have an app that connect via threads with pages and parse them an gives me only the Text-version of a HTML-page. Works fine, but if it found a page, where the text is within images, than the whole app stopps and gave me the message:
    javax.swing.text.ChangedCharSetException
            at javax.swing.text.html.parser.DocumentParser.handleEmptyTag(DocumentParser.java:169)
            at javax.swing.text.html.parser.Parser.startTag(Parser.java:372)
            at javax.swing.text.html.parser.Parser.parseTag(Parser.java:1846)
            at javax.swing.text.html.parser.Parser.parseContent(Parser.java:1881)
            at javax.swing.text.html.parser.Parser.parse(Parser.java:2047)
            at javax.swing.text.html.parser.DocumentParser.parse(DocumentParser.java:106)
            at javax.swing.text.html.parser.ParserDelegator.parse(ParserDelegator.java:78)
            at aufruf.main(aufruf.java:33)So I tried to catch them with "getCharSetSpec()" and "keyEqualsCharSet( )" from the class "javax.swing.text.ChangedCharSetException" and hoped that this solved the problem. But still doesen't work...
    Then I looked at the web and found, that I have to add the line:
    doc.putProperty("IgnoreCharsetDirective", new Boolean(true));"doc." is a new HTML Dokument, created with the HTMLEditorKit. I do not have much knowledge about that and so I hope, that someone can explain me, how I can solve that problem, within my code.
    Here we go:
    import javax.swing.text.*;
    import java.lang.*;
    import java.util.*;
    import java.net.*;
    import java.io.*;
    import javax.swing.text.html.*;
    import javax.swing.text.html.parser.*;
    public class myParser extends Thread
            private String name;
            public void run()
                    try
                            URL viele = new URL(name);                       // "name" ia a variable with a lot of links
                    URLConnection hs = viele.openConnection();
                    hs.connect();
                    if (hs.getContentType().startsWith("text/html"))
                            InputStream is = hs.getInputStream();
                            InputStreamReader isr = new InputStreamReader(is);
                            BufferedReader br = new BufferedReader(isr);
                            Lesen los = new Lesen();
                            ParserDelegator parser = new ParserDelegator();
                            parser.parse(br,los, false);
            catch (MalformedURLException e)
                    System.err.print("Doesn't work");
            catch (ChangedCharSetException e)
                    e.getCharSetSpec();
                    e.keyEqualsCharSet();
                    e.printStackTrace();
            catch (Exception o)
            public void vowi(String n)
                    name = n;
    }and for the case that it is important here is the class "Lesen"
    import java.net.*;
    import java.io.*;
    import javax.swing.text.*;
    import javax.swing.text.html.*;
    import javax.swing.text.html.parser.*;
    class Lesen extends HTMLEditorKit.ParserCallback
            public void handleStartTag(HTML.Tag t, MutableAttributeSet a, int pos)
                    try
                            if ((t==HTML.Tag.P) || (t==HTML.Tag.H1) || (t==HTML.Tag.H2) || (t==HTML.Tag.H3) || (t==HTML.Tag.H4) || (t==HTML.Tag.H5) || (t==HTML.Tag.H6))
                                    System.out.println();
                    catch (Exception q)
                            System.out.println(q.getMessage());
            public void handleSimpleTag(HTML.Tag t,MutableAttributeSet a, int pos)
                    try
                            if (t==HTML.Tag.BR)
                                    System.out.println(); // Neue Zeile
                                    System.out.println();
                    catch (Exception qw)
                            System.out.println(qw.getMessage());
            public void handleText(char[] data, int pos)
                    try
                            System.out.print(data);                                           // prints the text from HTML-pages
                    catch (Exception ab)
                            System.out.println(ab.getMessage());
    }Thanks a lot for helping...
    Stephan

    parser.parse(br,los, false);
    parser.parse(br,los, true);

  • Parsing the FRAME tag from HTML pages

    Hello to everybody,
    I am trying to parse the A tags & the Frame tags from HTML pages. I have developed the code below, which works for the A tags but it does not work for the Frame tags. Is there any idea about this?
    private void getLinks() throws Exception {
         System.out.println(diskName);
    links=new ArrayList();
    frames=new ArrayList();
    BufferedReader rd = new BufferedReader(new FileReader(diskName));
    // Parse the HTML
    EditorKit kit = new HTMLEditorKit();
    HTMLDocument doc = (HTMLDocument)kit.createDefaultDocument();
    doc.putProperty("IgnoreCharsetDirective", new Boolean(true));
    try {
         kit.read(rd, doc, 0);
    catch (RuntimeException e) {return;}
    // Find all the FRAME elements in the HTML document, It finds nothing
         HTMLDocument.Iterator it = doc.getIterator(HTML.Tag.FRAME);
    while(it.isValid()) {
    SimpleAttributeSet s = (SimpleAttributeSet)it.getAttributes();
    String frameSrc = (String)s.getAttribute(HTML.Attribute.SRC);
         frames.add(frameSrc);
    // Find all the A elements in the HTML document, it works ok
    it = doc.getIterator(HTML.Tag.A);
    while (it.isValid()) {
    SimpleAttributeSet s = (SimpleAttributeSet)it.getAttributes();
    String link = (String)s.getAttribute(HTML.Attribute.HREF);
    int endOfSet=it.getEndOffset(),
    startOfSet=it.getStartOffset();
    String text=doc.getText(startOfSet,endOfSet-startOfSet);
    if (link != null)
         links.add(new Link(link,text));
    it.next();
    }

    Hello to everybody,
    I am trying to parse the A tags & the Frame tags from HTML pages. I have developed the code below, which works for the A tags but it does not work for the Frame tags. Is there any idea about this?
    private void getLinks() throws Exception {
         System.out.println(diskName);
    links=new ArrayList();
    frames=new ArrayList();
    BufferedReader rd = new BufferedReader(new FileReader(diskName));
    // Parse the HTML
    EditorKit kit = new HTMLEditorKit();
    HTMLDocument doc = (HTMLDocument)kit.createDefaultDocument();
    doc.putProperty("IgnoreCharsetDirective", new Boolean(true));
    try {
         kit.read(rd, doc, 0);
    catch (RuntimeException e) {return;}
    // Find all the FRAME elements in the HTML document, It finds nothing
         HTMLDocument.Iterator it = doc.getIterator(HTML.Tag.FRAME);
    while(it.isValid()) {
    SimpleAttributeSet s = (SimpleAttributeSet)it.getAttributes();
    String frameSrc = (String)s.getAttribute(HTML.Attribute.SRC);
         frames.add(frameSrc);
    // Find all the A elements in the HTML document, it works ok
    it = doc.getIterator(HTML.Tag.A);
    while (it.isValid()) {
    SimpleAttributeSet s = (SimpleAttributeSet)it.getAttributes();
    String link = (String)s.getAttribute(HTML.Attribute.HREF);
    int endOfSet=it.getEndOffset(),
    startOfSet=it.getStartOffset();
    String text=doc.getText(startOfSet,endOfSet-startOfSet);
    if (link != null)
         links.add(new Link(link,text));
    it.next();
    }

  • XMII Login from Html page

    Hi,
    how can we login in xMII from Html page? for example, if i give username and password in HTML page. that need to directly login in xMII? how can it do?
    - senthil

    Jeremy,
    When I use the following URL to open a specific page, it works.
    http://server/Lighthammer/Login.jsp?IllumLoginName=accountname&IllumLoginPassword=accountpassword&session=true&target=/Test/report.irpt
    Question:
    1) This URL opens the html or irpt page itself directly without the associated xMII navigation/menu and navigation bar. Is it possible to open the page with the associated xMII menu/navigation thro an URL

  • XMII Login from Html page under xMII Version 12

    Hi,
    I found this thread
    xMII Login from Html page
    but I'm not sure this will also work under xMII  Version 12.
    I have now this question:
    Is it possible to use a url login with loginname and password under xMII V12 similar this example for Version 11.5:
    http://server/Lighthammer/Login.jsp?IllumLoginName=accountname&IllumLoginPassword=accountpassword&session=true&target=/Test/report.irpt
    Many thanks in advance

    Hi,
    Has anyone had any luck with this - displaying a v12 MII screen without requiring login?
    We need to be able to do this as well in order to display read-only screens on large screen monitors on the manufacturing floor without requiring login to MII.
    Under v11.5 it worked with no issues.  Under v12, we haven't figured out how to do it yet.
    I've waded through the NetWeaver UME documentation, have searched through the NetWeaver forums, etc. but to this point have had no luck in making it work.
    We've tried enabling the UME Guest account, assigning Guest to the anonymous group and guest role (and xMII Users role), creating a Navigation for the Guest user, but still the NetWeaver login screen is displayed.
    MII experts - if you are aware of how to do this can you please give detailed instructions instead of just referencing the NetWeaver / UME documentation?
    Thank you for your help!

  • ExtendedScript from html page

    Hello,
    can i make script in the extendedScript toolkit(this script place document to indesign application) and run this script from html page?
    or is there integration between extendedscript and html?
    thanks

    HTML pages are usually displayed in web browsers, whose security model is designed specifically against any access to local resources, especially such calls to local applications.
    Besides to browsers, on the Mac, the "Dashboard" allows you to write little applications "widgets" exactly the way you're suggesting. It uses WebKit to display HTML.
    http://www.apple.com/downloads/dashboard/
    In order to communicate with extendscript, you'd have to go through the operating system's command line.
    http://developer.apple.com/documentation/AppleApplications/Conceptual/Dashboard_ProgTopics /Articles/CommandLine.html
    From there you'd invoke the scripting system with "OSAScript"
    http://developer.apple.com/documentation/Darwin/Reference/Manpages/man1/osascript.1.html
    then pass on your extendscript and arguments into InDesign via doScript.
    Another alternative to the main HTML browser is AIR, which also has an instance of WebKit for HTML display.
    http://livedocs.adobe.com/labs/air/1/quickstartshtml/
    Apparently it is possible to invoke BridgeTalk - the Creative Suite's inter application communication used by extendscript - straight from AIR. I don't yet have references how to do that, found the link below just yesterday.
    http://www.inthemod.com/bps/?p=165
    Dirk

  • How to send information from HTML page to JSP without reloading HTML page?

    Hello,
    Is it possible to send information(row number selected by user) from HTML page to JSP without reloading HTML page?
    Thanks.
    Oleg.

    Yes, you can do this with framesets and a hidden frame.
    You need a bit of JavaScritp in the "visible" frame that
    sets the location of the hidden frame to the JSP.
    Add the user's choice as a parameter to the JSP URL.

  • Get parameters from html page from java application standalone ...

    Hi all,
    I work in one solution that i have values in Html Page and i want get the parameters values from html and cath they in java application standalone.
    The Html page is in same host than de java application.
    I want know if this is possible. I wnat know if without HttpServlet i can get the parameters from Html Page pure.
    Thanks in Advance for the ideas,
    Antonio.

    Hi Abdul,
    The problem is my client want one solution where i have one page simple page Html and one application java standalone. This application runs in one machine, but we don't have web server. So the question is: Is possible without web server i can get the parameters values that is inside the html page from java application. I remember you that the application java is one .jar that run's with one command line from crontab "java -jar teste.jar".

  • Linking .swf to html page using a href ......

    I have attempted to get an anwser to this on the Flash forum, but it is a jungle over there.... I have attempted to link a swf to a web page on my site using the a href property; the page opens in Safari and Firefox; however, in IE7 the page shows at the bottom of the browser, but nothing happens on mousedown. I fear it may have to do with the way IE handles the wmode=transparent property...  I have tried using an invisible button in Flash, but it covers up the animation every time...
    This is the code for the two button graphics (movie clips):
    <table style="width: 100%;" border="0">
    <tbody>
    <tr>
    <td align="left"><a href="/index.php/design-samples.html">
    <object width="220" height="120" data="/Flash/designs_ad.swf" type="application/x-shockwave-flash">
    <param name="quality" value="best" />
    <param name="wmode" value="transparent" />
    <param name="src" value="/Flash/designs_ad.swf" />
    </object>
    </a></td>
    <td align="right"><a href="/index.php/recent-work.html">
    <object style="width: 220px; height: 120px;" width="220" height="120" data="/Flash/recentwork_ad.swf" type="application/x-shockwave-flash">
    <param name="quality" value="best" />
    <param name="wmode" value="transparent" />
    <param name="src" value="/Flash/recentwork_ad.swf" />
    </object>
    </a></td>
    </tr>
    </tbody>
    </table>

    Hi
    The reason it will not work in IE is because IE uses a different form of code to play swf's/flv's, (application vs's plug-in).
    Firefox and Safari use - type="application/x-shockwave-flash", but IE uses - classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000".
    If you do a standard insert - media - swf from the main menu bar in dreamweaver this will insert the correct code for you.
    PZ

  • How link from html page to a specific frame in flash cs5 as3

    Hi!
    I'm kinda new around here. I am interested in knowing how to link from a specific html page to a specific frame in flash cs5 as3.
    I have a website that I originally began to design in flash but later started developing new pages for it in html. The flash part of it has several pages on different frames and I have created links from the flash part to the other html pages, but, I can only link the html pages back to the main flash home page, and not the other pages in the flash part of the website.
    I have read that in cs3 it was possible using the flashvars skip variable, but I don't know how to do it. I have not yet seen any working examples and I could not find any instructions / tutorials online for cs5.
    Can someone help here?

    add a query string, to the swf's embedding html, with variable/value indicating the frame you want to display in your swf.  add a javascript function to return the query string (or entire url), call the javascript function from flash using the externalinterface class.  and finally add code to your swf to parse the returned url or query string, parse it and then direct your timeline to the appropriate frame.

  • FLV. not working in SWF within HTML page

    I have created a SWF presentation which contains several videos as FLVs. The videos are uploaded to a folder on the clients server.
    The exported SWF and HTML files of the presentations worked perfectly when hosted on my local machine but when sent to the client, who uploaded to their own server, the SWFs ran but would not play the FLV files within. When they changed the HTML files to HTM they worked perfectly.
    However...when they embedded the pages into the content management system the use it required that the pages were reverted back to HTML, therefore the FLVs are not working again.
    The 'still' frame appears where the FLV should be, but the skin and the video itself does not load.
    Does anyone have any idea why this issue has occurred?
    Thanks in advance.

    @Ned
    Not sure about the folder structure of their site, to be honest they've been a nightmare client from day one so getting information like that out of them has been nigh on impossible.
    The flv files are all in a folder together and these are linked from the swf with this link structure: http://www.sitename.org.uk/folder/video.flv
    I'm not entirely sure how their CMS is structured. I was throwing this question out on the off chance that someone had seen a similar instance where HTML/HTM file types had affected functionality.

  • Loading Image from HTML page into Flash component

    Ok, after doing much research on the internet, I am pretty
    sure you have to be a Flash and Actionscripting Jedi in order to
    solve this issue. Here we go:
    I have created an HTML page using PHP and MySql that displays
    image thumbnails. When a user chooses and clicks on one of the
    thumbnails, I want the larger image to be loaded into my swf. It is
    a jigsaw puzzle component I picked up here: www.crifano.com. Here
    is the puzzle on my page with an image manually inserted using
    Flash 8 (Note: This is only working in Internet Explorer right now,
    for whatever reason):
    http://premieretans.com/puzzle/jigsaw.php.
    I want the image on this page to be chosen by the user from a
    number of images that are populated on a regular PHP/HTML page from
    a MySql database. What is the best way to go about this?
    Thanks so much for the help on this matter. I know I am not
    the only person who has run into this dilemma, so I hope your
    knowledge will save others with a similar problem the hours I have
    spent on this issue myself. Thank you!
    Cheers-
    Charles

    Hi,
    There's no direct support for this. But you could implement
    drag and drop the way you normally would in javascript. Except
    here, on mouseUp over a div encapsulating the object or embed tag
    (the flash object), you'll need to make a call into actionscript
    from javascript indicating that a drag and drop happened.
    For more info, see
    how
    to drag and drop using javascript and
    actionscript
    and javascript communication

  • Overlapping 2 swfs on HTML page

    I have two separate swfs overlapping, each in their own div
    on an HTML page. The one on top however is a horizontal drop-down
    menu, and it overlaps the swf/div underneath it. The menu links
    only take up a small strip at the top of the page, but drop-down
    portion is what covers the majority of the page. Hence, the div
    that the dropdown menu is contained in covers a large part of the
    page as well. The swf/div underneath is a clickable link, but
    because it's overlapped by the menu swf, you can't click on it.
    Both swfs are set to wmode=transparent, and I've played around with
    the z-index of both divs too with no luck.
    I don't even know if this is a flash problem, or CSS, or
    javascript problem. If anyone can just point me in the right
    direction to solve this, it'll be greatly appreciated. Thanks in
    advance for any insight on this.

    Yeah, I have considered cutting the list in half in the backing beans, which would allow me to accomplish what I am trying to do, but I'd rather pull the collection from a single method and find a way to do it with JSF if that is possible...
    appreciate the input...
    -Garrett

  • 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>

Maybe you are looking for

  • Short dump

    Hi forum, Pls help me out...I'm getting short dump if i execute this.. pls correct the code....... REPORT  ZPAY_REG NO STANDARD PAGE HEADING line-size 150 line-count 65(3). TYPE-POOLS: slis. TABLES:    payr,    t012,    t012k,    t51r5. Data : begin

  • What's New 2.1.A.0.1 update

    A new update of What's New application has started to roll out (2.1.A.0.1). What's been changed? You can now watch Playstation trailers in the app. Discover new music since the app is now integrated with Spotify. Find your new favorite TV show in the

  • Installing and upgrading Windows XP to Windows 8.1on Bootcamp 5.1

    I once bought Windows XP, later installed Windows 8.1 via Upgrade, on my old 2008 Macbook Pro. I wanted to go the same way too on my new MB Pro Retina 13" (Yosemite 10.10.1; i5 2,6 Ghz; 8GB Ram; 128GB SSD). Now that Bootcamp 5.1 seems not to support

  • How do get past the credit card payment when I review my account for the 1st time?

    K I've setup a account to use itunes, I even have 2 itunes gifts cards ready to go. I'm reviewing my account for the 1st time right now. what I want to know is: "How do continue without entering a valid credit card payment?"

  • Show ResultSet on the Browser

    Hiii I'm developing a servlet that get data from the database and i want to show the result of this data on the browser ... how could i do that if my data are saved in a ResultSet variable ??? thank you