Can Javascript trigger an action in a swf file?

Earlier I was able to create flash buttons in a swf object in a widget on a Jive page, and have each of them trigger a separate Javascript function.
That worked well.I used this in Flash:
import flash.external.ExternalInterface;
Now I would like to be able to do the opposite.
I would like a Javascript function to trigger a swf to go to a particular frame in the movie.
Is that possible, and if so, How do I do it?
There are several widgets with each their own Flash object on the page. The Widgets can be adressed separtely by their H3 title.
The reason for wanting to do this is to stop flash playback without unloading the swf with another movie in a different widget is started.

Hi Nabren
Let me explain a bit more in detail what I am doing:
The page includes several HTML widgets, let us say they are called:
widget_1  importing flash_file_1.swf
widget_2  importing flash_file_1.swf
widget_3  importing flash_file_1.swf
widget_4  importing flash_file_1.swf
My navigation is a widget with a separate swf file where the buttons trigger a Javascript function that hides or reveals the widgets I want to show below.
All the widgets are loading on page load but only some of them are visible.
The swfs are essentially flash files that have sub navigation buttons.
lets say:
button_1
button_2
button_3
This is my  way to get multiple pages to be accessible in one widget.
Clicking a button takes you to a different frame with a different page layout.
Some of the pages contain Flash video which auto starts. (they are located each in their own movie clip)
My objective is to be able to stop any video that might be running when clicking another button for another widget.
Currently each swf is delivered in an iFrame that calls up a HTML page with the Flash object in it.
This allows me to send the content of each iFrame to about:blank when clicking another button (essentially unloading the iframe content) and load it again on demand.
This however causes the iFrame content to disappear for a moment and reload, which is not a very elegant user experience.
It kills the benefit of the content  preloading.
Therefor I would much rather be able to control the timeline in each individual swf from a add callback function in Javascript.
The Flash object could be located directly in the HTML widget  if that would work better.
That way I could say something like this:
function f1(){
onclick:
widget_1  importing flash_file_1.swf :  go to and play frame 1
widget_2  importing flash_file_2.swf :  go to and stop on frame 15.
widget_3  importing flash_file_3.swf :  go to and stop on frame 10.
widget_4  importing flash_file_4.swf :  go  to and stop on frame 20.
function f2(){
onclick:
widget_1  importing flash_file_1.swf :  go to and stop on frame 10.
widget_2  importing flash_file_2.swf :  to and play frame 1
widget_3  importing flash_file_3.swf :  to and stop on frame 10.
widget_4  importing flash_file_4.swf :  to and stop on frame 20.
-and so on…
This would be beautiful!  I would be able to keep the swfs loaded at all time and be ready to play as soon as the next button is clicked.
Question 1:  Would I have to add any code to the flash files?
Question 2:  Would you be able to help with the correct code/ syntax to make the javascript work?
Thank you for your time!
ggaarde

Similar Messages

  • How can I control a button from one swf file to another swf file?

    Hi,
    I have a main.swf file. From that file I am accessing the external.swf file which is an external file.
    Now, how can I write code on my main.swf file for the button which is on my external.swf file?
    Activities.MainPanel.close_btn.addEventListener(MouseEvent.CLICK, btnClickClose);
    Activities.MainPanel.close_btn (This buttons is actually on external.swf file, but I want to write code on main.swf file to execute it on external.swf) how can I control one swf button on other swf file?
    Thanks.

    Here's some example code that you should be able to adapt to your needs.
    // create a new loader object instance...
    var loader:Loader = new Loader();
    // make the download request...
    var request:URLRequest = new URLRequest("external.swf");
    // add a complete event listener to the loader
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
    // start the actual loading process...
    loader.load(request);
    // create a new empty movieClip instance, you will put the loaded movie into this movieClip once its loaded
    var externalMovie:MovieClip;
    // this function is called when the download has finished and the file is ready to use...
    function completeHandler(event:Event):void {
       // set the contents of the loaded movie to the new empty movieClip...
               externalMovie = MovieClip(event.target.content);
       // add this new movie to the display list...
       addChild(externalMovie);
    Now you can refer to the loaded movie with the instance name "externalMovie". So if, for instance, you want to address a button in the loaded movie, you could write something like this on the main timeline:
    externalMovie.addEventListener(MouseEvent.CLICK, btnClickClose);
    function btnClickClose(event:MouseEvent):void {

  • Trying to properly code a menu with buttons that can go back and forth between external swf files

    I have a project I've been working on that, when properly coded, has a "main menu" with 4 "doors" (buttons). When the corresponding buttons to these "doors" are clicked, it should go to and play an external .swf file. If that doesn't make sense, think of a DVD menu. You click play movie, it plays the movie. When the movie is over, there's two buttons on that swf file to either play the movie over or go back the main menu, which is an external .swf file (Remember, we go to the movie from the menu, which is a seperate file). So far, the buttons work. The menu works. However, from the movie, at the conclusion, when I click the button to go back to the main menu, it displays the movie clip and the buttons, but none of the buttons work. I'm starting to think it has to do with the fact the main menu was written in AS3 and the movie was made in AS2. If anyone can assist me in being to able to keep both files and still navigate between the two, being able to bring up the menu from the movie and be able to play the movie again, and so on and so on, that'd be GREAT. I'm somewhat of a noob to Flash, but I learn quickly and I'm open to any suggestions. Here's the code for main menu, which I guess acts as the parent file, and the movie. If I get this to work, I essentially would duplicate the same actions for the other 4 doors, once I complete the environments for them. Thanks
    Main.Fla/Swf (written in AS3)
    (This is the action on the first frame, that has all the buttons. For this question, I'm just trying to properly code for 'Door4', which is the "door" to the movie.)
    import flash.display.Loader;
    stop();
    var myLoader1:Loader=new Loader ();
    Door4.addEventListener(MouseEvent.CLICK, jayzSwf);
    function jayzSwf(myevent1:MouseEvent):void
              var myURL1:URLRequest = new URLRequest("jayzspeaks.swf");
              myLoader1.load(myURL1);
              addChild(myLoader1);
              myLoader1.x = 0;
              myLoader1.y = 0;
    Movie.Fla/Swf (written in AS2)
    (This is action on the button that returns to the menu)
    on (release) {
              this.createEmptyMovieClip("container",this.getNextHighestDepth());
              container.loadMovie("main.swf");

    At least you're going in the correct (mis)direction. You have AS3 loading AS2. So that's not a huge hurdle.
    I believe all you really need to do is send your Main.swf a signal that the content it loaded (e.g. jayzspeaks.swf) is done and you want to get rid of it.
    The code I pointed you to asks you to (upon download and import then) instantiate it in both AS2 and AS3. They give a very simple easy to understand line of code.
    // as2, load this in jayzspeaks.swf
    var myBridge:SWFBridgeAS2 = new SWFBridgeAS2("connectionID", clientObj);
    // as3, load this in main.swf
    var myBridge:SWFBridgeAS3 = new SWFBridgeAS3("connectionID", clientObj);
    Make sure the connectionID matches between them. Set it to whatever you want.
    When you're done with your as2 loaded content you'd send a signal (over localconnection) back to the AS3 Main like they say:
    myBridge.send("someFunctionToUnloadContent");
    myBridge.close();
    You'd need to make the as3 function "someFunctionToUnloadContent()" (example purposes only name) and it should unload the jayzspeaks.swf that was loaded in the loader.
    Make sure you get that close in there so you don't drill up a bunch of localconnection objects just like the simple source code says.

  • How can I make a transparent square box swf file in flash cs4?

    Hi,
    I have one picture imported into flash cs4 and would like to make a rectangle box which should be transparent. Finally I will save it as .swf file for later use. But the box should be transparent (without any background). How can I do that? Please do help.
    Thanks.

    Hi just a shot in the dark..
    Have you fiddled with movieclips and the alpha property?
    Best regards
    Peter

  • How can i detect if the picture or swf file is produced from legal flash?

    I have recently bought images and swf files from a student for my website.
    I've just realized that the images and swf might be from pirated flash product because i found out that
    the original flash is really and i mean really pricey! I don't believe he bought an original product.
    How do i detect if it is from a legal product? I'm worried as i'm going to put it in my website.
    I can't get the guy who did this for me as he is in another country already.
    If it is possible to detect this and it is indeed from pirated product, how can i make it legal again?
    Please help.

    Hey Rob,
    Its the same question, just that i want to know if it is possible to trace the source if the file is an image.
    If it is not possible to trace the source be it a swf or an image file, then i will just upload it to my website.
    I wouldn't bother to check if it came from a pirated flash product.
    The image is created from flash 8 just for me. It is not downloaded from another source.
    Thanks.

  • Can you convert a Captivate HTM or SWF file and use it in a website?

    One of my clients wants to know if it's possible to use in a website content you've created in Captivate and save as an HTM or SWF file?

    You cannot access your iWork documents in the cloud through a folder structure as you can on your computer.
    You might want to approach your use of these documents in the cloud in a slightly different way. I tend to use iCloud for my documents "in progress", but once complete I then move them to my regular folder structure on my computer and out of the cloud. This means I have a minimum but relevant number of documents available to me when I open the appropriate app on my mobile device.

  • How can I stop timeline sounds in external swf files from playing during loading?

    I am having a problem with timeline sounds in external swf files playing during loading in a main swf. Can anyone help me?
    Here is some of the code from the main swf. I hope I have included enough.
    Thanks.
    import flash.events.MouseEvent;
    import flash.display.MovieClip;
    import flash.display.Loader;
    import flash.events.ProgressEvent;
    import flash.events.Event;
    import flash.net.URLRequest;
    import fl.events.SliderEvent;
    import flash.media.SoundTransform;
    preloader_mc.fill_mc.scaleX = 0;
    var swfA:Array = ["part1.swf","part2.swf"];
    var frameA:Array = [];
    var currentLoader:Loader;
    var swfTotalFrames:int;
    var tl:MovieClip = this;
    var st:SoundTransform = new SoundTransform()
    var index:int = 0;
    loadNextF();
    play_slider.enabled = false;
    function loadNextF():void{
                    tl["loader_"+index] = new Loader();
                    tl["loader_"+index].name = index.toString();
                    tl["loader_"+index].contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,progressF);
                    tl["loader_"+index].contentLoaderInfo.addEventListener(Event.COMPLETE,completeF);
                    tl["loader_"+index].load(new URLRequest(swfA[index]));
    function progressF(e:ProgressEvent):void{
                    var fractionLoaded:Number = index/swfA.length+e.bytesLoaded/(e.bytesTotal*swfA.length);
                    preloader_mc.fill_mc.scaleX = fractionLoaded;
                    preloader_mc.tf.text = (100*fractionLoaded)+"% Loaded";
    function completeF(e:Event):void{
                    tl["loader_"+index].contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS,progress F);
                    tl["loader_"+index].contentLoaderInfo.removeEventListener(Event.COMPLETE,completeF);
                    SoundMixer.stopAll();
                    var mc:MovieClip = MovieClip(tl["loader_"+index].content);
                    mc.gotoAndStop(1);
                    frameA.push(mc.totalFrames);
                    index++;
                    if(index<swfA.length){
                                    loadNextF();
                    } else {
                                    // all loads complete.  start play.
                                    restart_mc.buttonMode = true;
                                    restart_mc.alpha = 1;
                                    tl.addEventListener(Event.ENTER_FRAME,playUpdateF);
                                    tl.removeChild(preloader_mc);
                                    preloader_mc = null;
                                    play_slider.enabled = true;
                                    playpause_mc.alpha = 1;
                                    currentLoader = tl["loader_0"];
                                    tl.addChild(currentLoader);
                                    MovieClip(currentLoader.content).play();
                                    sliderParamsF();

    import flash.events.MouseEvent;
    import flash.display.MovieClip;
    import flash.display.Loader;
    import flash.events.ProgressEvent;
    import flash.events.Event;
    import flash.net.URLRequest;
    import fl.events.SliderEvent;
    import flash.media.SoundTransform;
    preloader_mc.fill_mc.scaleX = 0;
    var swfA:Array = ["part1.swf","part2.swf"];
    var frameA:Array = [];
    var currentLoader:Loader;
    var swfTotalFrames:int;
    var tl:MovieClip = this;
    var st:SoundTransform = new SoundTransform()
    var index:int = 0;
    loadNextF();
    play_slider.enabled = false;
    function loadNextF():void{
        tl["loader_"+index] = new Loader();
        tl["loader_"+index].name = index.toString();
        tl["loader_"+index].contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,progressF);
        tl["loader_"+index].contentLoaderInfo.addEventListener(Event.COMPLETE,completeF);
        tl["loader_"+index].load(new URLRequest(swfA[index]));
    function progressF(e:ProgressEvent):void{
        var fractionLoaded:Number = index/swfA.length+e.bytesLoaded/(e.bytesTotal*swfA.length);
        preloader_mc.fill_mc.scaleX = fractionLoaded;
        preloader_mc.tf.text = (100*fractionLoaded)+"% Loaded";
    function completeF(e:Event):void{
        tl["loader_"+index].contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS,progress F);
        tl["loader_"+index].contentLoaderInfo.removeEventListener(Event.COMPLETE,completeF);
        SoundMixer.stopAll();
        var mc:MovieClip = MovieClip(tl["loader_"+index].content);
        mc.gotoAndStop(1);
        frameA.push(mc.totalFrames);
        index++;
        if(index<swfA.length){
            loadNextF();
        } else {
            // all loads complete.  start play.
            restart_mc.buttonMode = true;
            restart_mc.alpha = 1;
            tl.addEventListener(Event.ENTER_FRAME,playUpdateF);
            tl.removeChild(preloader_mc);
            preloader_mc = null;
            play_slider.enabled = true;
            playpause_mc.alpha = 1;
            currentLoader = tl["loader_0"];
            tl.addChild(currentLoader);
            MovieClip(currentLoader.content).play();
            sliderParamsF();
    ///////////////// start sliders /////////////////////////////////
    sound_slider.addEventListener(SliderEvent.CHANGE,soundSliderF);
    function soundSliderF(e:SliderEvent):void{
        st.volume = e.value/100;
        tl.soundTransform = st;
    play_slider.addEventListener(SliderEvent.CHANGE,playSliderF);
    play_slider.addEventListener(MouseEvent.MOUSE_DOWN,playSliderDownF);
    //play_slider.addEventListener(MouseEvent.MOUSE_UP,playSliderUpF);
    function playSliderDownF(e:MouseEvent):void{
        tl.removeEventListener(Event.ENTER_FRAME,playUpdateF);
        stage.addEventListener(MouseEvent.MOUSE_UP,playSliderUpF);
    function playSliderUpF(e:MouseEvent):void{
        tl.addEventListener(Event.ENTER_FRAME,playUpdateF);
    function playSliderF(e:SliderEvent):void{
        SoundMixer.stopAll();
        var frameNum:int = Math.ceil(swfTotalFrames*e.value/100);
        var partialTotalFrames:int = 0;
        for(var i:int=0;i<frameA.length;i++){
            partialTotalFrames += frameA[i];
            if(partialTotalFrames>=frameNum){
                break;
        partialTotalFrames -= frameA[i];
        //trace(i,frameNum,frameNum-partialTotalFrames);
        if(currentLoader!=tl["loader_"+(i)]){
            tl.removeChild(currentLoader);
            MovieClip(currentLoader.content).stop();
            currentLoader = tl["loader_"+(i)];
            tl.addChild(currentLoader);
        if(playpause_mc.currentFrame==1){
            MovieClip(currentLoader.content).gotoAndPlay(frameNum-partialTotalFrames);
        } else {
            MovieClip(currentLoader.content).gotoAndStop(frameNum-partialTotalFrames);
    function sliderUpdateF(e:Event):void{
        var playedFrames:int = 0;
        for(var i:int=0;i<Number(currentLoader.name);i++){
            playedFrames += frameA[i];
        playedFrames += MovieClip(currentLoader.content).currentFrame;
        play_slider.value = Math.round(100*playedFrames/swfTotalFrames);
    function sliderParamsF():void{
        swfTotalFrames = 0;
        for(var i:int=0;i<swfA.length;i++){
            swfTotalFrames += MovieClip(tl["loader_"+i].content).totalFrames;
    ///////////////// end  sliders //////////////////////////////////
    ///////////////// start playpause restart ///////////////////////
    playpause_mc.addEventListener(MouseEvent.CLICK,playpauseF);
    playpause_mc.alpha = .2;
    restart_mc.addEventListener(MouseEvent.CLICK,restartF);
    restart_mc.buttonMode = false;
    restart_mc.alpha = .2;
    function playpauseF(e:MouseEvent):void{
        if(!e.currentTarget.toggle){
            MovieClip(currentLoader.content).stop();
            tl.removeEventListener(Event.ENTER_FRAME,playUpdateF);
            e.currentTarget.gotoAndStop(2);
        } else {
            MovieClip(currentLoader.content).play();
            tl.addEventListener(Event.ENTER_FRAME,playUpdateF);
            e.currentTarget.gotoAndStop(1);
        e.currentTarget.toggle = !e.currentTarget.toggle;
    ///////////////// end playpause //////////////////////////////
    function playUpdateF(e:Event):void{
        sliderUpdateF(e);
        var playingFrame:int = MovieClip(currentLoader.content).currentFrame;
        if(playingFrame==frameA[Number(currentLoader.name)]){
            // next loader
            MovieClip(currentLoader.content).stop();
            SoundMixer.stopAll();
            MovieClip(currentLoader.content).mute();
            var nextIndex:int = Number(currentLoader.name)+1;
            if(nextIndex<swfA.length){
                tl.removeChild(currentLoader);
                currentLoader = tl["loader_"+nextIndex];
                tl.addChild(currentLoader);
                MovieClip(currentLoader.content).gotoAndPlay(1);
            } else {
                tl.removeEventListener(Event.ENTER_FRAME,playUpdateF);
                playpause_mc.gotoAndStop(2);
                playpause_mc.toggle = !playpause_mc.toggle;
                //playpause_mc.alpha = .2;
                // all swfs have completed play
    function restartF(e:MouseEvent):void{
        MovieClip(currentLoader.content).stop();
        tl.removeChild(currentLoader);
        SoundMixer.stopAll();
        MovieClip(currentLoader.content).mute();
        currentLoader = tl["loader_"+0];
        tl.addChild(currentLoader);
        if(playpause_mc.currentFrame==1){
            MovieClip(currentLoader.content).gotoAndPlay(1);
        } else {
            MovieClip(currentLoader.content).gotoAndStop(1);

  • How can I tell if and how a SWF  file is streaming?

    My department is new to Flash, but we've now been creating
    basic Flash Videos for websites for a few months. We've always
    encoded our videos to FLVs (Flash 8), and then used the Video
    Import Wizard in Flash 8 to import those FLVs into our FLA
    document. We now need to be able to error-check all of our files
    (each video comprised of four files: an HTML file, an FLV file, and
    two SWF files including the player skin) to make sure that
    progressive videos are indeed progressive and streaming videos are
    streaming.
    My process thus far:
    In Flash 8, I brought up the SWF file and opened the Output
    window; from the Debug menu I then selected variables. I was able
    to find the variable "isRTMP:false", which according to the
    documentation seems to mean that the video is progressive, not
    streaming. However, when I authored this FLA file, I know I chose
    the streaming option (FVSS not FCS) in the Video Import Wizard. Am
    I looking in the wrong place? Am I confused about the meaning of
    this variable?
    Bottom line, how do I determine after authoring whether an
    SWF is streaming or progressive, and moreover whether it's been
    authored to use FVSS or FCS?

    I'm sorry, perhaps I was a little unclear. The files are all
    still stored herelocally, since they have not yet been deployed.
    I'm looking for some property of the SWF file (maybe visible
    through Component Inspector?) that will tell me how it has been
    authored. Is there any place in the SWF file itself that contains
    this information (since the files are not yet deployed)?

  • How can i call a function of a swf-file which is embedded as a Resource in 3D-Annotation?

    Hi.
    I use a Flash-menu as an embedded *.swf in a 3D-Annotation. Now i want to trigger one of the ActionScript-Function out of the 3D-Annotation.
    How can i get access to that function?
    Cause of it is embedded, the callAS() Methods still not possible. But how else can i do that?
    Can u give me a simple example? How is the usability of Flashvariable in the Ressource-Tab of 3d-Annotation?
    Kind regards
    Florian

    It depends to some extent on how your SWF has been bound to the 3D scene. If you have bound it using a script, then you have a FlashMovie object that has a .call() method - but if you've attached it to something using the binding option on the Resources panel you will need to collect a reference first. If you know you are going to talk to the SWF it's best to bind it using JavaScript.
    Let us assume you have a SWF in the resources collection but it's not bound to anything. In the 3D scene there is an object called 'cube' on which the SWF must appear as a material, and the SWF has declared a function to the ExternalInterface engine that is called "myFunction", which expects a string as a variable. Here's what you would put in the script attached to the 3D scene:
    var fm = new FlashMovie("demo.swf");
    var matl = scene.meshes.getByName("cube").material;
    matl.useFlashMovie(fm);
    fm.call("myFunction","hello");
    The call() method is strictly typed - for example if your AS function expects a boolean and you sent it a string, it will not execute. There is also a limit on the possible returned variables - e.g. you cannot send back an Object.
    Note that commands sent in the other direction using ActionScript's ExternalInterface.call() method are targeted at  document-level by default, not at the 3D API - so if your AS is trying to call something it must exist as a document-level JavaScript function. It is possible to divert this traffic into the 3D API using the FlashEventHandler object, but it gets complicated as your code must implement XML encoding of the traffic - this is done automatically by the document-level script but not by the 3D API.
    To answer your second question, in the resources dialog you can define the FlashVars string which is passed to the SWF when it loads - this is the same URL-encoded set of variables that you would send to a SWF when embedding it in an HTML page. It's a static string; you cannot read or edit it with JavaScript but this means it will still work if the user disables the JavaScript engine.

  • Can javascript pass values to applet inside jar file?

    I have an applet that receives the computer name selected via javascript and then resolves the name with the name server and returns any available ip addresses (via a browser). When running this applet unsigned, I can only resolve my own local machine and I get security exception errors(access denied) for any other computer selections (this would be expected).
    I have created a jar file encompassing the class file and java file for this applet signing it with the designated signature. When using the jar file, the applet will start, but no names can be resolved (including the local machine) and there are no errors on the java console...(???)
    HTML code is as follows:
    <html>
    <body>
    <form>
    <fieldset style="width:100%"><legend>  ?</legend>
    <select name="CNList"
    onChange="var f = document.forms[0]
    if (f.CNList.options[f.CNList.selectedIndex].text=="") {
    alert("Please choose a computer name for this test.");
    f.CNList.focus();
    return false;
    }else{
    var cnv = f.CNList.options[f.CNList.selectedIndex].text;
    document.myApplet.newText(cnv);
    return false;"
    >
    <option value="-SELECT COMPUTER NAME-" selected>-SELECT COMPUTER NAME-
    <option value="BELKNAP">BELKNAP
    <option value="DOWNS">DOWNS
    <option value="GSIMS">GSIMS
    <option value="SPOTSYLVANIA">SPOTSYLVANIA
    <option value="CEDAR">CEDAR
    <option value="BELLMEAD">BELLMEAD
    <option value="ASHLAND">ASHLAND
    <option value="COMFORT">COMFORT
    <option value="ROSS">ROSS
    <option value="PUTNAM">PUTNAM
    <option value="CHARITY">CHARITY
    <option value="FRODO">FRODO
    <option value="PLUTO">PLUTO
    <option value="DENTON">DENTON
    <option value="HOOD">HOOD
    <option value="KODIAK">KODIAK
    <option value="SUNDOWN">SUNDOWN
    <option value="FROST">FROST
    <option value="TRINITY">TRINITY
    <option value="LOUDOUN">LOUDOUN
    <option value="MPAPE">MPAPE
    <option value="QUENTIN">QUENTIN
    <option value="DUNDEE">DUNDEE
    <option value="SIGMA">SIGMA
    <option value="PSI">PSI
    <option value="CUBE">CUBE
    <option value="ALOHA">ALOHA
    <option value="OBION">OBION
    </select>
    <br />
    <applet code=NSQuery2.class
            archive="NSQuery2.jar"
            width=400 height=250
         name="myApplet"
         id="myApplet"
         >
         <p>Sorry, you need a Java enabled browser to see the applet's info.</p>
    </applet>
    </form>
    </body>
    </html>JAVA Applet code is as follows:
    /* Gets ComputerName selected, returns IP Address(es)*/
    // Instead of importing just 1 or 2 parts of java.awt and java.applet classes,
    // we have chosen to import everything at once.
    // To do this we use the wildcard operator (*).
    import java.awt.*;
    import java.applet.*;
    import java.io.*;
    import java.lang.String;
    import java.net.InetAddress;
    public class NSQuery2 extends Applet {
    // This declares a string variable named computerName for future use.
    String computerName;
      public void init() {
      // Set background color of our applet to white.
      setBackground(Color.white);
      public void paint(Graphics g) {
        super.paint(g);
        try {
          g.drawString("Computer Name: " + this.computerName, 23, 43);
          String[] ips = new queryhost().getIPAddressArray(this.computerName);
            for (int j=0; j<ips.length; j++) {
          g.drawString("IP Address   : " + ips[j], 23, (12*j)+((j+10)+91));
        } catch (Exception e) {
                g.drawString("Can't detect selected host name.  Check Network settings.", 23, 60);
       public static void main(String[] args) { new NSQuery2(); }
       public static String[] getIPAddressArray(String computerName) {
       //create int which is (sRemoteHost.length() + 1)
       int sRemoteHostchars = computerName.length();
         sRemoteHostchars++;
        //below returns a array of type InetAddress which holds entries such as: hostname1/IPAddress1 etc
       InetAddress[] remoteHostName = null;
       try {
          remoteHostName = InetAddress.getAllByName(computerName); // get IP Address(es)
       catch (Exception e) {
          e.printStackTrace();
        // below creates an array of type string which holds entries such as : IPAddress1 etc
        String[] remoteIP = new String[ remoteHostName.length ] ;
        for (int i=0; i<remoteHostName.length; i++) {
           String iponly = remoteHostName.toString();
    iponly = iponly.substring(sRemoteHostchars);
    remoteIP[i] = iponly;
    return remoteIP;
    public void newText(String s){
    this.computerName = s;
    repaint();
    Anyone have any ideas as to why this can't be performed?
    Thanks in advance,
    Geoff-

    Hey thanks for the response (seems that most responses
    are gender specific around here :) )!No, they are not. Ask a good question (not "do my homework for me") and ask it specifically, and you will get good help whatever your gender. I am a girl; I make no attempt to hide this. I have always gotten good, solid advice from this forum without any reference to my gender, without any ascerbic remarks, without scorn from the respondant.
    You are probably referring to the "girl needs som help" thread or other recent threads from girls (well maybe girls, who knows).
    The content of these posts were:
    1) asking to help with blatant cheating on homework
    2) extremely vague
    3) used the OPs gender as an excuse for 1) and/or 2)
    Using your gender as an excuse for being unable to put code together and requesting help with cheating:
    -implies girls are too stupid to do math, programming, engineering
    -implies that girls who are in these fields are freaks/mutants/other
    -implies that gender is an exucse for laziness
    -implies that girls cannot think logically
    -implies that girls do not have to follow rules of integrity, or that girls have no integrity
    Such posts understandibly raise the ire of women software engineers who have worked hard to get where they are. (And also of male software engineers who can see through the request as a play on a stereotype)
    It is akin to a girl coming to my office hours and saying "I have my mechanics final exam tomorrow, but I didn't study all semester because I'm a girl and math is too haaaaard"
    Honestly, I would try to help the girl as much as I could, not because she's a girl, but because it is part of my duty, my responsibility, to help students.
    But before I could do it, I would have to count to ten a few times to get my temper under control.
    jen

  • Can I run an action on all open files?

    I'm converting some of my images to grayscale with an action. The images are spread across hundreds of folders and only some of the images need to be converted. I want to be able to look at the image to make sure it should be converted (or not, as the case may be). So I end up with, for a particular folder, maybe 20 open images.
    Then I run the action manually on each image that is still open.
    QUES: Is there a way to select "run action on all open images".
    I know I could do it in Batch by moving all the files to a new folder, but every time I try to re-learn how to batch (I only resort to batch every year or two), an hour later I'm still reading the Help manual and nothing has been accomplished. So, an action it has to be, or manually.

    Might be quicker to set the action to a hot key, open all files in the folder and then inspect them and if they need the action, hit the key, otherwise ctrl-w to close unchanged.

  • How can I call in swf file to movie clip?

    Hi all ...
    This is my first post for advise, although fairly conversant
    with flash and as2.
    I am developing a new full screen background style website
    and have menu buttons contained within a movie clip (nav_c1) ...
    this re-aligns to the top centre of a page when user scales the
    browser window.
    I then have the content area (centre_content) movie clip ...
    this realigns to the centre of the page when a user scales the
    browser window.
    I have scripted the menu buttons to goto a labelled frame in
    the main timeline but I need, when at the labelled frame, to be
    able to call/load in an external swf file to play 'inside' the
    centre_content movie clip?
    for example:
    If I click my news button the flash file moves to the frame
    label news on the main timeline. This then shows a duplicate of the
    moive clip 'centre_content' which is called 'centre_news'. I need
    to be able to call/load an external news.swf, containing all the
    animated news info, to sit and play 'within' the movie clip
    'centre_news' ... so that it is effectively contained 'within' the
    movie clip file but loaded in place from an external swf file.
    Can anyone help please?
    I can post a rough working example online if need be.
    Many thanks
    A puzzled Adrian
    ps: I don't think I am needing to load the swf to a level 1
    area as I have tried this and instead of the swf file being loaded
    and contained within my movie clip file/area it instead seems to
    sit fixed on the main timeline (ie: not contained within the movie
    clip area).

    Thanks Sketchsta for you code. This looks like we're on the
    right lines as I see what the code is trying to do.
    Unfortunately though I can't seem to get this to work?
    I created a new file to get rid of other scripting that was
    going on and have placed a movie clip called centre_content onto
    the main timeline in frame 1 ... then I have applied your script to
    an actions frame above the movie clip also on frame 1. I change the
    path_to_file line with my swf name (callin.swf) which is a 1 frame
    flash file with some text on it ...
    ... but it doesn't bring in the callin.swf file ... it just
    shows the centre_content clip.
    Am i doing anything wrong?
    I also tried putting the script onto the first frame inside
    the centre_content movie clip but this doesn't appear to work
    either.
    Regarding the pre-loader ... can I simply build this into the
    swf file that is being called in to the movie clip?
    Thanks in advance for your support, it is much appreciated.
    Adrian

  • Actions not working to imported swf files in Flash Catalyst

    Hi,
    I have a problem with manipulating my imported swf files (created in Flash professional) in Flash Catalyst CS5. Whenever I add any of the swf control actions to a swf file in the timeline such as 'stop', the animation ignores it and keeps replaying. I tried to add action sequence when a certain button is pressed, and also tried to create 'On application Start' and added 'stop' so that the animation stops immediately when the application opens. No matter what I do, the animation refuses to perform the actions and simply replays. The animation is a simple shape tween between 2 states with no action script attached to it. I published the animation as an swf and exported it to Flash Catalyst. Is there any suggestions whatsoever on why this is happening? Is it something to do with setting up my flash file prior to import? The only way I figured out to stop the animation from playing is adding action script to the flash file in Flash Professional however this is not what I want because I would like the animation to be controlled by components in my flash Catalyst document.
    Thanks

    You can make you swf a custom component with 2 states.
    The first state will be empty and rename it "OFF" the second state will have your swf file and name it ON.
    Then go back to your artboard/project, add your 2 buttons ON & OFF.
    For the ON button add interaction "play transition to custom component ON"
    For the OFF button add interaction "play transition to custom component OFF"
    Here is an example swf_control

  • Can sdk3.0 application swfloader swf file builder with sdk4.6

    I have an application builder with sdk3.0. Can I use swfloader to load a swf file builder with sdk4.6?

    That configuration is not supported.  The 3.0 SWF will set the API version to some lower number and any FP10 or FP11 APIs will break.

  • Compile flex project to multi swf files !

    Hi all !
       I have a flex project include one mxml main application, some mxml component and action script files. Can I compile flex project to multi swf files. My goal is: swf file very large, so I divide it into multi small swf files ! How can I do this? plz, give me some guide or links about it !
       Thanks very much.

    Hi there,
    Use modules to do that.
    regards aktell2007

Maybe you are looking for

  • How to convert from Grayscale to single color channel

    I hope that someone here might be able to help. I am writing an application which loads in color channels separately, to be merged by the application The images are multi-page TIFF files. The trouble that I am running into is that the application loa

  • How to sort albums by date when in the store?

    When in iTunes store looking at albums how do you sort them by release date? Show view options doesn't work in the store only in Library. Thank You

  • JavaDocs for PJC's

    Just been on an Oracle developer day (forms 10g) given by Grant Ronald, he mentioned that the JavaDocs for PJC's existed and might be made available sometime soon. Any idea where/how i can get my hands on them ? Thanks Richard.

  • Ugh, the flashing question mark...

    Earlier tonight my three year old nephew got hold of my laptop and his little magic fingers did something to cause the screen to go blank and then, the flashing question mark showed up. So, I reinstalled the OS X dvd, when it asked do I want to keep

  • Is it possible to add a dozen or more host files to completly block Yahoo or MS Bing and keep it off the search engine.

    I do not want Bing in my computer. I get angry and uninstall the new firefox because i can not keep bing at bay. Every time I go back and install Firefox because I do not like Opera I have Microsoft's Bing invading my system as yahoo search or bing.