HELP! How to load multiple swfs using the following code?

In actions for Frame 1:
var myrequest:URLRequest=new URLRequest("A.swf");     
var myloader:Loader=new Loader();
myloader.load(myrequest);
img1.addEventListener(MouseEvent.CLICK, clickButton);
function clickButton(event:MouseEvent):void{               
    stage.addChild(myloader);
img1.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_5);
function fl_ClickToGoToAndStopAtFrame_5(event:MouseEvent):void
     gotoAndStop(13);
In action for Frame 13:   (img2 is another button)
img2.addEventListener(MouseEvent.CLICK, unloadFunction);
function unloadFunction(event:Event):void{
     stage.removeChild(myloader);

do you want to load another swf (eg, B.swf) when you're in frame 13 and img2 is clicked?  if yes, and you don't want A.swf to continue to play, use:
//In action for Frame 13:   (img2 is another button)
img2.addEventListener(MouseEvent.CLICK, loadF2);
function loadF2(event:Event):void{
    myloader.load(new URLRequest("B.swf"));

Similar Messages

  • How to load multiple swfs to my main flash file??

    I am using the following code
    In actions for Frame 1:
    var myrequest:URLRequest=new URLRequest("A.swf");     
    var myloader:Loader=new Loader();
    myloader.load(myrequest);
    img1.addEventListener(MouseEvent.CLICK, clickButton);
    function clickButton(event:MouseEvent):void{               
        stage.addChild(myloader);
    img1.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_5);
    function fl_ClickToGoToAndStopAtFrame_5(event:MouseEvent):void
         gotoAndStop(13);
    In action for Frame 13:   (img2 is another button)
    img2.addEventListener(MouseEvent.CLICK, unloadFunction);
    function unloadFunction(event:Event):void{
         stage.removeChild(myloader);
    This code works perfectly fine. My only problem is, How do I get multiple swf loaded. When I tried to copy and paste the same code for the other swf, but the following errors appear. I'm pretty sure theres a way to have multiple swfs (btw the multiple swfs will be linked from different frames).
    Scene 1, Layer 'PAGES!', Frame 2, Line 7 1021: Duplicate function definition.
    Scene 1, Layer 'PAGES!', Frame 2, Line 2 1151: A conflict exists with definition myloader in namespace internal.
    Scene 1, Layer 'PAGES!', Frame 2, Line 1 1151: A conflict exists with definition myrequest in namespace internal.
    Can someone please help me with this. Thanks

    You define the same variable or function names more than once in a file.  But you can reuse them in other frames.  Try something more like the following in frame 2....
    myrequest=new URLRequest("A.swf");     
    myloader.load(myrequest);
    leave all of the rest out for starters... the same function from frame 1 can be re-used without rewriting them.  I don't know what the deal is with img1, but if you need to change what it does, then add that back in.

  • Loading multiple swfs using air 3.6 for ios

    Adobe, can you please provide us with the code to load multiple swf files for ios. Please provide examples. The code below loads multiple swfs, but the swfs stall, so this does not seem to be a solution.
    Code description: A flash file made up of 4 frames with forward and back buttons that navigate from frame to frame. The code loads three different swf files in frames 2, 3 and 4.
    Frame 1:
    var myLoader:Loader;
    var loaderContext:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, null);
    if(myLoader == null){myLoader = new Loader(); addChild(myLoader); }
    else {myLoader.unload();}
    Frame 2:
    myLoader.unload();
    myLoader.load(new URLRequest("file1.swf"),loaderContext);
    Frame 3:
    myLoader.unload();
    myLoader.load(new URLRequest("file2.swf"),loaderContext);
    Frame 4:
    myLoader.unload();
    myLoader.load(new URLRequest("file3.swf"),loaderContext);

    I've just tried loading, unloading and then loading again same SWF with 2 library objects linked for AS3 export. It worked both on simulator and on device in debug mode. When I look inside swf it does contain AS3 code.
    So is my swf a pure asset SWF? Or Intellij Idea 12 that I'm using does stripping automatically?
    And then I've read your comment at http://forums.adobe.com/message/5217325#5217325 and run 'swfdump' utility on my .swf file. Looks like there's no ABC2 code, that's why app was able to load, unload and load again the same swf.
    public dynamic class net.games.bg extends flash.display.MovieClip
      native public function bg():*;
      native public var one:flash.display.MovieClip;
      native public var three:flash.display.MovieClip;
      native public var two:flash.display.MovieClip;
    public dynamic class net.games.z1 extends flash.display.MovieClip
      native public function z1():*;
    I can access objects as instances through root  or as objects through getDefinition.
    private var aLoader : Loader;
    private function init():void
                load1();
            private function load1():void
                aLoader   = new Loader();
                var url:URLRequest = new URLRequest("levels/expirementlevel1.swf");
                var loaderContext:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, null);
                aLoader.load(url, loaderContext); // load the SWF file
                aLoader.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, handleSWFLoadComplete1, false, 0, true);
            private function handleSWFLoadComplete1(e:flash.events.Event):void {
                var levelObjectsMC:flash.display.MovieClip = e.target.loader.content;
                for (var i:uint = 0; i < levelObjectsMC.numChildren; i++){
                    trace ('\t|\t ' +i+'.\t name:' + levelObjectsMC.getChildAt(i).name + '\t type:' + typeof (levelObjectsMC.getChildAt(i))+ '\t' + levelObjectsMC.getChildAt(i).x);
                var LibraryClass:Class = e.target.applicationDomain.getDefinition("net.games.z1") as Class;
                var myLibraryObject:flash.display.MovieClip = new LibraryClass as flash.display.MovieClip;
                trace(' load 1 ' + myLibraryObject);
                aLoader.unload();
                load2();
                //addChild(levelObjectsMC);
            private function load2():void
                aLoader   = new Loader();
                var url:URLRequest = new URLRequest("levels/expirementlevel1.swf");
                var loaderContext:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, null);
                aLoader.load(url, loaderContext); // load the SWF file
                aLoader.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, handleSWFLoadComplete2, false, 0, true);
            private function handleSWFLoadComplete2(e:flash.events.Event):void {
                var levelObjectsMC:flash.display.MovieClip = e.target.loader.content;
                for (var i:uint = 0; i < levelObjectsMC.numChildren; i++){
                    trace ('\t|\t ' +i+'.\t name:' + levelObjectsMC.getChildAt(i).name + '\t type:' + typeof (levelObjectsMC.getChildAt(i))+ '\t' + levelObjectsMC.getChildAt(i).x);
                var LibraryClass:Class = e.target.applicationDomain.getDefinition("net.games.z1") as Class;
                var myLibraryObject:flash.display.MovieClip = new LibraryClass as flash.display.MovieClip;
                trace('load 2 x ' + myLibraryObject.x);
                aLoader.unload();

  • Load multiple files using the same data load location

    has anybody tried loading multiple files using the same load locations. I need to do this as the data in these multiple files will need to be exported from FDM as a single export file. the problem i am facing is more user related. since these files will be received at different points of time, users will need a way to tell them what has been loaded and what is yet to be loaded.
    is it possible to throw a window on the web broser with OK and Cancel buttons from an event script?
    any pointers to possible solutions will be helpful

    was able to resolve this. the implementation method is as follows
    take a back up of previously imported data in the befcleardata event script. then in the beffileimport event append the data to the import file. there are many other intricacies but this is the broad implementation logic. it allowed my users to load multiple files without worrying about append or replace import type choices

  • How to Load an SWF into the Parent SWF

    Hi all,
    I have 3 SWFs.
    X.SWF - Parent application. Contains an empty movie clip for
    loading external swfs using loadClip() method.
    B.SWF - Has some text and pics. Gets loaded into the empty
    movieclip on X.SWF. Also has a button saying 'Load A.SWF'.
    A.SWF - Similar to B.SWF with a button saying 'Load B.SWF'.
    When I start the main application (X.SWF) and load B.SWF into
    it all is fine.
    But would like to click on the 'Load A.SWF' button on B.SWF
    and load A.SWF into X.SWF. And visa-vesa.
    The problem is I'm not able to refer to the parent container
    (X) from these child (A and B) SWFs.
    Is there any way to do this?
    Thanks

    First if you use
    Button.onPress=function(){
    this._parent.loadMovie();
    the movie try to load swf into B.swf because "this" mean the
    button.Try with more ._parent or just if you X.swf is into the one
    MovieClip in 1st stage _level0.SWF.loadMovie();.Also if you want to
    load the A,B.swf into the stage simultaneously just create two
    movieclips into the X.swf mcA and mcB and the path has gone to
    _level0.SWF.mcA.loadMovie("A.swf"); :)

  • Pls help me in write a join for the following code.

    can any one give me optimized code for the posted query..
    DATA :BEGIN OF BAPITABLE OCCURS 1,
           EDITELEM LIKE TOJTB-EDITELEM,
           FUNCTION LIKE SBAPIS-FUNCTION,
           SHORTTEXT    LIKE TFTIT-STEXT,
           END OF BAPITABLE.
              SELECT     EDITELEM  INTO (BAPITABLE-EDITELEM)
                                   FROM TOJTB
                                   WHERE APPLIC = APPLICATIONCODE
                                   AND MODELONLY = 'R'
                                   and ACTIVE = 'X'.
              SELECT FUNCTION INTO (BAPITABLE-FUNCTION)
                              FROM  SBAPIS
                              WHERE OBJECT = JEDITELEM.
             SELECT STEXT INTO (BAPITABLE-SHORTTEXT)
                          FROM TFTIT
                          WHERE SPRAS = 'EN' AND FUNCNAME = BAPITABLE-FUNCTION.
                         APPEND BAPITABLE.
                             ENDSELECT.
                   ENDSELECT.
           ENDSELECT.
    waiting for ur replies....
    RESHALI

    Hi
    i'm giving you a sample code please change according to your requiirement.
    I've taken required fields from 3 different tables and put them in one internal table.
    please see the following code.
    types : begin of ty_kna1,
             kunnr type kna1-kunnr,
             name1 type kna1-name1,
             vbeln type vbap-vbeln,
             erdat type vbak-erdat,
           end of ty_kna1.
    data : it_kna1 type table of ty_kna1,
           wa_kna1 type ty_kna1.
    data : it_fieldcat type slis_t_fieldcat_alv,
           wa_fieldcat type slis_fieldcat_alv.
    start-of-selection.
      select kkunnr kname1 v1erdat v2vbeln
      into corresponding fields of table it_kna1
      from ( ( kna1 as k
        inner join vbak as v1 on kkunnr = v1kunnr )
        inner join vbap as v2 on v1vbeln = v2vbeln )
        up to 100 rows.
    Reward if helpful
    Regards
    Lakshman

  • How to send multiple Recipients using the mail.jar and activation.jar

    hi!
    could somebody help me. how do i send multiple Recipient using mail.jar. when i would input 2email address in to Recipient
    (example: [email protected], [email protected])
    i get a DEBUG: setDebug: JavaMail version 1.3.2
    but if i send a single email it just works properly.
    heres my code
    import java.io.*;
    import java.util.*;
    import javax.mail.*;
    import javax.mail.event.*;
    import javax.mail.internet.*;
    public class SendMail
              public SendMail(String to, String from, String subject, String body)
              //public SendMail(String to)
                   String message_recip = to;
                   String message_subject = subject;
                   String message_cc = "";
                   String message_body = body;
                   //The JavaMail session object
                   Session session;
                   //The JavaMail message object
                   Message mesg;
                   // Pass info to the mail server as a Properties, since JavaMail (wisely) allows room for LOTS of properties...
                   Properties props = new Properties( );
                   // LAN must define the local SMTP server as "mailhost" to be able to send mail...
                   //props.put("mail.smtp.host","true");
                   props.put("mail.smtp.host", "mailhost");
                   // Create the Session object
                   session = Session.getDefaultInstance(props, null);
                   session.setDebug(true);
                   try
                        // create a message
                        mesg = new MimeMessage(session);
                        // From Address - this should come from a Properties...
                        mesg.setFrom(new InternetAddress(from));
                        // TO Address
                        InternetAddress toAddress = new InternetAddress(message_recip);
                        mesg.addRecipient(Message.RecipientType.TO, toAddress);
                        // CC Address
                        InternetAddress ccAddress = new InternetAddress(message_cc);
                        mesg.addRecipient(Message.RecipientType.CC, ccAddress);
                        // The Subject
                        mesg.setSubject(message_subject);
                        // Now the message body.
                        mesg.setText(message_body);
                        // XXX I18N: use setText(msgText.getText( ), charset)
                        // Finally, send the message!
                        Transport.send(mesg);
                   }//end of try
                   catch (MessagingException ex)
                        while ((ex = (MessagingException)ex.getNextException( )) != null)
                             ex.printStackTrace( );
                        }//end of while
              }//end of catch
         }//end of SendMail
    public static void main(String[] args)
              //String t = "[email protected], [email protected]"; - this I think causes error
    String t = "[email protected]";
              String f = "[email protected]";
              String s = "Hello World";
              String b = "the quick brown fox jumps over the lazy dog";
              SendMail sm = new SendMail(t,f,s,b);     
         }//end of main
    }//end of class
    could someone please help me im stuck-up with this. thanx!

    i need it ASAP
    i am a beginner in java and jsp
    Need to knw how can I parse the addresss field
    Below
    is the code
    <code>
    package
    public class EMailBean {
    private String smtp,username,password,from,bcc,subject,body,attachments,cc;
         /*setter*/
         public void setSmtp(String str){this.smtp=str;}
         public void setUsername(String str){this.username=str;}
         public void setPassword(String str){this.password=str;}
         public void setFrom(String str){this.from=str;}
         public void setTo(String str){this.to=str;}
         public void setCc(String str){this.cc=str;}
         public void setBcc(String str){this.bcc=str;}
         public void setSubject(String str){this.subject=str;}
         public void setBody(String str){this.body=str;}
         public void setAttachments(String str){this.attachments=str;}
                                  /*getter*/
         public String getSmtp( ){return this.smtp;}
         public String getUsername( ){return this.username;}
         public String getPassword( ){return this.password;}
         public String getFrom( ){return this.from;}
         public String getTo( ){return this.to;}
         public String getCc( ){return this.cc;}     
         public String getBcc( ){return this.bcc;}
         public String getSubject( ){return this.subject;}
         public String getBody( ){return this.body;}
    public String getAttachments( ){return this.attachments;}
    </code>
    Session session = Session.getDefaultInstance(props, null);
    session.setDebug(true);
    try {
    MimeMessage msg = new MimeMessage(session);
    msg.setFrom(new InternetAddress(mail.getFrom()));
                                  msg.addRecipients(Message.RecipientType.TO, InternetAddress.parse(to, false));
                                  msg.addRecipient(Message.RecipientType.TO,new InternetAddress(mail.getTo()));
                             msg.addRecipient(Message.RecipientType.CC, new InternetAddress(mail.getCc()));
                                  msg.addRecipient(Message.RecipientType.CC, new InternetAddress("[email protected]"));
    msg.setSubject(mail.getSubject());
    // Create the message part
    BodyPart messageBodyPart = new MimeBodyPart();
    // Fill the message
    messageBodyPart.setText(mail.getBody());
    Multipart multipart = new MimeMultipart();
    multipart.addBodyPart(messageBodyPart);
    // Part two is attachment
    messageBodyPart = new MimeBodyPart();
    DataSource source = new FileDataSource(mail.getAttachments());
    messageBodyPart.setDataHandler(new DataHandler(source));
    messageBodyPart.setFileName(source.getName());
    multipart.addBodyPart(messageBodyPart);
    msg.setContent(multipart);
    msg.setSentDate(new Date());
    Transport t = session.getTransport("smtp");
    try {
    t.connect(mail.getUsername(), mail.getPassword());
    t.sendMessage(msg, msg.getAllRecipients());
    } finally {
    t.close();
    result = result + "<FONT SIZE='4' COLOR='blue'><B>Success!</B>"+"<FONT SIZE='4' COLOR='black'> "+"<HR><FONT color='green'><B>Mail was successfully sent to </B></FONT>: "+mail.getTo()+"<BR>";
    if (!("".equals(mail.getCc())))
    result = result +"<FONT color='green'><B>CCed To </B></FONT>: "+mail.getCc()+"<BR>";
    if (!("".equals(mail.getBcc())))
    result = result +"<FONT color='green'><B>BCCed To </B></FONT>: "+mail.getBcc() ;
    result = result+"<BR><HR>";
    } catch (MessagingException mex) {
    result = result + "<FONT SIZE='4' COLOR='blue'> <B>Error : </B><BR><HR> "+"<FONT SIZE='3' COLOR='black'>"+mex.toString()+"<BR><HR>";
    } catch (Exception e) {
    result = result + "<FONT SIZE='4' COLOR='blue'> <B>Error : </B><BR><HR> "+"<FONT SIZE='3' COLOR='black'>"+e.toString()+"<BR><HR>";
    e.printStackTrace();
    finally {
    return result;
    }

  • How to load external SWF used sharing library.

    Hi~~~
    Before ask the question, plz understand my bad English..
    Recently I try to load the Swf file that is maded by Flash CS 6.0.
    Especially it used shared library..
    When I try to load this SWF, I used FileStream instead URLRequest.
    This is because the target SWF File located same device with the Swf Application.. So when I use the URLRequest
    it give me the warning - Sandbox security violation.
    But by using FileStream, the warning did not occur.
    This is the sample code below..
      var myFile = new File(path);
      var myStream = new FileStream();
      myStream.open(myFile, FileMode.READ;
      var myBytes:ByteArray = new ByteArray();
      myStream.readBytes( myBytes );
       mSwfLoader.loadBytes( fileStream, context );
       mSwfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadedComplete);
    As you can see, I made a event listener to get the content of the Loader, after receving Complete Event(I guess.. after decording?).
    But I can't receive any event call, so I removed symbol used sharing library in the SWF.
    And this gave me the result as I respected... So I guess the problem caused by using sharing Library..!
    (In parenthease, I can see the valid result in running debug time on the Flash CS6..)
    What should I do? I respect that using sharing libary give saving memory.  So I want to using it as possible.
    Thanks for your reading...!

    Here is one way:
    http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7f9c.html
    HTH,

  • Loading multiple SWFs and storing them (code not working under Firefox 23 and Chrome)

    Hey guys,
    Anyone has any idea why this code suddenly don't work anymore? (It works under internet explorer but not firefox and chrome
    The code under is placed on my main swf to preload all my external swfs and store them for not having to wait too long to access them.
    Thx guys.
    I took the code from here btw: http://www.beautifycode.com/the-finer-art-of-loading-2-handling-multiple-swfs#snippet
    I'm running flash player 11.8.800.94... It used to work under Firefox and Chrome
    var _swfLoader:Loader;
    var _swfRequest:URLRequest;
    var _swfPathArr:Array = new Array("00.swf", "01.swf", "02.swf");
    var _swfClipsArr:Array = new Array();
    var _swfTempClip:MovieClip;
    var _loadedSWFs:int;
    startLoading(_swfPathArr);
    function startLoading(pathArr:Array):void {
    _swfLoader = new Loader();
    _swfRequest = new URLRequest();
    loadSWF(pathArr[1]);
    function loadSWF(path:String):void {
    setupListeners(_swfLoader.contentLoaderInfo);
    _swfRequest.url = path;
    _swfLoader.load(_swfRequest);
    function setupListeners(dispatcher:IEventDispatcher):void {
    dispatcher.addEventListener(Event.COMPLETE, onSwfComplete);
    function onSwfComplete(event:Event):void {
    event.target.removeEventListener(Event.COMPLETE, onSwfComplete);
    _swfTempClip = event.target.content;
    _swfTempClip.customID = _loadedSWFs;
    _swfClipsArr.push(_swfTempClip);
    if(_loadedSWFs <_swfPathArr.length - 1) {
    _loadedSWFs++;
    loadSWF(_swfPathArr[_loadedSWFs]);
    } else {

    Hi kglad,
    The problem was coming from my server.
    I recently played with some settings  from a "cache control tool" offered by my hosting but i thought i had it back at default. Turns out i must've missed something. Now i have the .html caching on and everything works good on all browser.
    I have another question tho...
    I'd like to know if there's a way to cache an html file without having to ask my hoster to cache all of my htmls...
    I'm using this code now but maybe there's a way to add something that will cache this page specifically?
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>title</title>
    <script language="javascript">AC_FL_RunContent = 0;</script>
    <script src="fluid_site.js" language="javascript"></script>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
    <link href="style.css" rel="stylesheet" type="text/css" media="screen"/>
    </head>
    <!--url's used in the movie-->
    <!--text used in the movie-->
    <!-- saved from url=(0013)about:internet -->
    <script>
        if (AC_FL_RunContent == 0) {
            alert("This page requires fluid_site.js.");
        } else {
            AC_FL_RunContent(
                'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
                'width', '100%',
                'height', '100%',
                'src', 'index',
                'quality', 'medium',
                'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
                'align', 'middle',
                'play', 'true',
                'loop', 'true',
                'scale', 'showall',
                'devicefont', 'false',
                'wmode', 'window',
                'id', 'index',
                'name', 'index',
                'menu', 'false',
                'allowFullScreen', 'false',
                'allowScriptAccess','sameDomain',
                'movie', 'index',
                'salign', ''
                ); //end AC code
    </script>
    <body>
    <noscript>
        <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="100%" height="100%" id="index" align="middle">
        <param name="allowScriptAccess" value="sameDomain" />
        <param name="allowFullScreen" value="false" />
        <param name="MENU" value="false">
        <param name=wmode value=window>
        <param name="movie" value="index.swf" /><param name="quality" value="medium" /><embed src="index.swf" quality="medium" width="100%" height="100%" wmode="direct" name="fluid_site" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
        </object>
    </noscript>
    </body>
    </html>
    Thanks

  • How to handle multiple exceptions by the same code?

    Hi, all:
    In my situation I want AException and BException handled by the same code, while CException and DException handled by another code. How can I write my try-catch code in a simple way? Of course I can do the following:
    public void TheMainFunction() {
        try {
        } catch (AException e) {
            Handle_AB();
        } catch (BException e) {
            Handle_AB();
        } catch (CException e) {
            Handle_CD();
        } catch (DException e) {
            Handle_CD();
    private void Handle_AB() {
    private void Handle_CD() {
    }But is there a simpler way?
    Thanks in advance.

    If you have one or two places in your code that need multiple exceptions, just do it with multiple catch statements. Unless you are trying to write the most compact Programming 101 homework program, inventing tricks to remove two lines of code is not good use of your time.
    If you have multiple catches all over your code it could be a code smell. You may have too much stuff happening inside one try statement. It becomes hard to know what method call throws one of those exceptions, and you end up handling an exception from some else piece of code than what you intended. E.g. you mention NumberFormatException -- only process one user input inside that try/catch so it is easy to see what error message is given if that particular input is gunk. The next step of processing goes inside its own try/catch.
    In my case, the ArrayIndexOutOfBoundsException and
    NumberFormatException should be handled by the same way.Why?
    I don't think I have ever seen an ArrayIndexOutOfBoundsException that didn't indicate a bug in the code. Instead of an AIOOBE perhaps there should be an if statement somewhere that prevents it, or the algorithm logic should prevent it automatically.

  • How do I use the following code in such a way that it will display what is indicated by the word "echo"?

    if(exist chrome.exe $true) 
    echo internet is ready 
    else 
    echo get chrome!!
    I want to use the above script to cause the shell to display either "internet is ready" or "get chrome!!" depending on whether or not a user has Chrome but the shell keeps giving the following error message.
    Missing statement block after if ( condition ).
    At line:2 char:1
    What is a statement block, and how do I use it to display the text?

    This might work okay in .BAT but I don't think so much in Powershell. You are trying to do an IF ( ) statement, but you have no parameters after that.
    A pancake of how an IF statement works in Powershell:
    If (statement -like "True") { Script info if condition is true } else { script info if condition is false }
    In your case, you need to test the path of Chrome to see if it exsists. I don't have Chrome installed, but I do have IE. You just need to change the path to where the Chrome.exe is installed.
    ps - the Echo equiv in Powershell is Write-Host
    $TestBrowser = Test-Path "C:\Program Files (x86)\Internet Explorer\iexplore.exe"
        if ($TestBrowser -like "True")
            Write-Host the internets is ready!
        else
            Write-Host the internets is not ready
    Similiarly, you don't need to use $TestBrowser in your If ( ) statement, you can just use the operational param $?, which should return true or false depending on the last error message.

  • How to read cursor position in the following code?

    I am using reuse_alv_list_display
    FORM user_command USING r_ucomm LIKE sy-ucomm
    rs_selfield TYPE slis_selfield.
    DATA:gs_selfield TYPE slis_selfield,
    ok_code LIKE sy-pfkey.
    CASE r_ucomm.
    WHEN '&IC1'.
    gs_selfield = rs_selfield.
    IF gs_selfield-fieldname = 'EBELN'.
    MOVE 'EVRTN' TO rs_selfield-fieldname.
    SET PARAMETER ID 'VRT' FIELD rs_selfield-value.
    SET PARAMETER ID 'BES' FIELD rs_selfield-value.
    CALL TRANSACTION 'ME38' AND SKIP FIRST SCREEN.
    ELSE.
    IF gs_selfield-fieldname = 'MATNR'.
    SET PARAMETER ID 'MAT' FIELD rs_selfield-value.
    CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.
    ENDIF.
    ENDIF.
    ENDCASE.
    ok_code = sy-ucomm.
    READ TABLE it_rep_tab INTO wa_rep_tab INDEX l_selfield-value.
    SET PARAMETER ID 'MAT' FIELD wa_rep_tab-matnr.
    SET PARAMETER ID 'WRK' FIELD wa_rep_tab-werks.
    CASE ok_code.
    WHEN 'MD04'.
    CALL TRANSACTION 'MD04'." AND SKIP FIRST SCREEN.
    WHEN 'MMBE'.
    CALL TRANSACTION 'MMBE'." AND SKIP FIRST SCREEN.
    WHEN 'MD51'.
    CALL TRANSACTION 'MD51' ."AND SKIP FIRST SCREEN.
    WHEN 'EXIT'.
    LEAVE PROGRAM.
    WHEN 'BACK'.
    LEAVE TO SCREEN 0.
    ENDCASE.
    ENDFORM.
    Please help me............
    but here not getting values ib l_selfield-value when  I place in the toolbar.
    Please help me.

    you have to read your itab in a workarea yourself using the correct index using the returned rs_selfield-tabindex.
    so you have allways the correct values.

  • How to  creat an xsl for the following code ?

    Hi all !
    Could any one help me to creat an xsl (in the form of table) for the following xml data ?
    <?xml version="1.0" encoding="UTF-8"?>
    <scenarioReport>
    <node name="V2_DR">
    <netObjId >1 </netObjId>
    <result>undefined</result>
    <report>xyz</report>
    <action>no action</action>
    <netObjId > 2 </netObjId>
    <result>defined</result>
    <report> sdfherh</report>
    <action>action</action>
    </node>
    <node name="V3_DR">
    <netObjId >1 </netObjId>
    <result>undefined</result>
    <report>xyz</report>
    <action>no action</action>
    <netObjId > 2 </netObjId>
    <result>defined</result>
    <report>dfhdfj</report>
    <action>action</action>
    </node>
    </scenarioReport>
    could you please send me as soon as possible !!!!

    To do that you would have to know what output the XSL should produce, based on the input. You haven't said anything about that. All you have posted is a single XML file which could be either the input or the output of this mythical XSL. Do what Steve said and read the tutorial.

  • How to draw graph by using the following data?

    Hi,
    The attachment is an icon on Diagram file the and its data on the Panel file. However, I hope get a graph on the Panel and don't want to show the data like in my attached file. From the examples provided by Labview, I know it can be completed, but I don't know how to do it. Could any one can tell me how I can do that? Thanks.
    Attachments:
    question_graph.bmp ‏189 KB

    Hi,
    Put a graph on the Front Panel : Commands -> Graphs -> Graph.
    On the Diagram you can wire this graph to the waveform you want to see in your graph.
    Hope this helps !
    Julien

  • How to update many tables using the same code

    <%@ page language = "java" import = "java.sql.*" %>
    <%@ page import = "java.sql.*" %>
    <%@ page import = "java.text.*" %>
    <%
    String custname1=request.getParameter("custname");
    session.setAttribute("custname",custname1);
    String custtin1=request.getParameter("custtin");
    session.setAttribute("custtin",custtin1);
    %>
    <%
    try{
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection conn;
    conn=DriverManager.getConnection("jdbc:odbc:loginval");
    Statement stat=conn.createStatement();
    String stmt="insert into custdetails values('"+custname1+"','"+custtin1+"')";
    stat.executeUpdate(stmt);
    stat.close();
    conn.close();
    %>
    <jsp:forward page = "success.html"/>
    <%
    catch(Exception e)
    %>
    <jsp:forward page = "tinerror.jsp"/>
    <%
    %>---------------------------------------------------------------
    this is my code, now this code will be used by many users to update their corresponding tables. so my problem is based on the username i need to change the table name in the insert query, for example if the username is sai, then the table name has to be saicustdetails and if the user name is ram then the table name in the query has to be ramcustdetails. and so on.
    please help

    *<%@ page language = "java" import = "java.sql.*" %>
    <%@ page import = "java.sql.*" %>
    <%@ page import = "java.text.*" %>
    <%
    String tin1=request.getParameter("tin");
    session.setAttribute("tin",tin1);
    tin1=tin1+"custdetails";
    String custname1=request.getParameter("custname");
    session.setAttribute("custname",custname1);
    String custtin1=request.getParameter("custtin");
    session.setAttribute("custtin",custtin1);
    //String tin2;
    %>
    <%
    try{
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection conn;
    conn=DriverManager.getConnection("jdbc:odbc:loginval");
    Statement stat=conn.createStatement();
    String tin2;
    tin2=tin1;
    String stmt="insert into "+tin2+"values('"+custname1+"','"+custtin1+"')";
    stat.executeUpdate(stmt);
    stat.close();
    conn.close();
    %>
    <jsp:forward page = "success.html"/>
    <%
    catch(Exception e)
    %>
    <jsp:forward page = "tinerror.jsp"/>
    <%
    %>i tried what u have said but still it does not work, anyother way?????

Maybe you are looking for

  • Mixing with Buses

    Hi, I am currently mixing a large project (80 or so tracks) and I'm trying out various bus set ups to try and save on CPU. I want to be able to send groups of channels (i.e. drums or vocals) to a bus via a send (in the normal manner) but I also want

  • BO 4.1 SP3 WebI section space Issue - Work around

    System: SAP BO 4.1 SP3 Update Windows 2008 R2 Std x64 Edition SP1 Universe - Single Source UNX We upgraded from SP2 to SP3 recently and while working on the WebI report, I noticed that WebI reports with Section creates big spaces between sections and

  • User Table Key set up in User defined field management

    Dear  Expert, what is use of User Table Key set up in User defined field management in SAP B1. Thanks. Sridharan.R Edited by: Sridharan.R on Oct 4, 2011 8:26 AM

  • Delete [Gmail] folder in mail?

    I just set up a Gmail account on my iPhone 4 and I have a folder listed [Gmail] that I do not want.  Is there a way to get rid of it?  I figured out how to get rid of all the other folders that appeared such as "Spam" and "Important" but I can not ge

  • Change Mgmt in SAP

    Hi All, I have requirement to handle Engineering Change in SAP. For example whenever I create a material in Mat. Master and that material needs to be changed is there a case were their is a change number associated with every material when newly crea