Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    Regular Coder
    Join Date
    Aug 2010
    Location
    Now Southern Oregon. I was born and had lived my life in Los Angeles until relocating last year (2010)
    Posts
    215
    Thanks
    52
    Thanked 1 Time in 1 Post

    Easier way to debug IE?

    Hello;
    I have a Flash/Actionscript element embedded in a web page. The ActionScript
    code uses external interface (ie Javascript in this case) to know what to do.
    In this case it is an mp3 player that needs a play list rendered by javascript in
    winow.onload event handler.
    All this works like a charm on none I.E. browsers.
    I.E. v7 on Vista (as test client) won't run, or complete running the
    window.onload event handler
    Needless to say IE is always a headache to debug javascript. I have gotten
    used to interpreting the brain dead error messages.
    But this is the end;
    Line: 87 (what file?)
    Char: 11
    Error: bad argument (duh)
    Code:0
    SO.. Is there a suggestion for a debugger for IE that is a bit better to use
    than the built in error reporting?
    Or do I do what I hate doing: insert alert() in code from start up to the point
    of the failure?
    Thanks
    This program is available in my web site but I'm not sure providing the
    link here is appropriate.

  • #2
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,641
    Thanks
    0
    Thanked 649 Times in 639 Posts
    If the error console isn't giving enough info then use the built in debugger instead - press F12 and then select the script tag. You can then set breakpoints etc as needed to see what values are where in the code as you step through it statement by statement.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • Users who have thanked felgall for this post:

    anotherJEK (02-21-2013)

  • #3
    Regular Coder
    Join Date
    Aug 2010
    Location
    Now Southern Oregon. I was born and had lived my life in Los Angeles until relocating last year (2010)
    Posts
    215
    Thanks
    52
    Thanked 1 Time in 1 Post

    While waiting

    I traced it to the following:
    (the breakdown is at the last instruction)
    Code:
    //.....
     this.SWFObj = document.createElement('object');
              this.SWFObj.setAttribute('classid', 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000');
              this.SWFObj.setAttribute('codebase', 'http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0');
              this.SWFObj.setAttribute('id', this.OBJID);
              this.SWFObj.style.width = this.width+'px';
              this.SWFObj.style.height = this.height+'px';
              this.SWFObj.style.verticalAlign = 'middle';
              this.P1 = document.createElement('param');
              this.P1.setAttribute('name', 'allowScriptAccess');
              this.P1.setAttribute('value', 'sameDomain');
              this.SWFObj.appendChild(this.P1);
              this.P2 = document.createElement('param');
              this.P2.setAttribute('name', 'movie');
              this.P2.setAttribute('value', this.VERS);
              this.SWFObj.appendChild(this.P2);
              this.attr = '';
              if(this.flvrs != '')
                {
                 this.P3 = document.createElement('param');
                 this.P3.setAttribute('name', 'FlashVars');
                 this.P3.setAttribute('value', this.flvrs);
                 this.SWFObj.appendChild(this.P3);
                 this.attr = 'FlashVars="'+this.flvrs+'" ';
                }
              this.EMB = document.createElement('embed')
              this.EMB.setAttribute('src', this.VERS);
              this.EMB.setAttribute('quality', 'high');
              this.EMB.setAttribute('width', this.width+'px');
              this.EMB.setAttribute('height', this.height+'px');
              this.EMB.setAttribute('bgcolor', this.BGC);
              this.EMB.setAttribute('name', this.OBJID);
              this.EMB.setAttribute('id', this.OBJID);
              if(this.flvrs != '')
                {
                 this.EMB.setAttribute('FlashVars', this.flvrs);
                }
              alert(this.flvrs) // this fires 
              this.SWFObj.appendChild(this.EMB); //// <<< error here
    notice error at this.SWFObj.appendChild(this.EMB)
    So, If it is IE, does it really need the embed markup? Other wise what
    is the complaint?
    I tried pressing F12 , nothing happens. Is this instruction applicable to
    IE v7? (or what versions?)

  • #4
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,594
    Thanks
    78
    Thanked 4,386 Times in 4,351 Posts
    F12 only works in MSIE 8 and above.

    Before that, you would need to load the MS Script debugger or use Visual Studio (in any of its variants, including the free Visual Web Developer).

    Not to ask a really dumb question: WHY do you need to keep using this in there???

    If you are going to append object to the SWFobj, anyway, why do they *ALSO* need to be members of this (whatever this refers to)??

    Really doesn't make sense, to me.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #5
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,350
    Thanks
    11
    Thanked 589 Times in 570 Posts
    Quote Originally Posted by Old Pedant View Post
    F12 only works in MSIE 8 and above.

    Before that, you would need to load the MS Script debugger or use Visual Studio (in any of its variants, including the free Visual Web Developer).
    yes, but if you can run 7 you can run 8, including the dev tools. once you have a forward version, you can more-or-less simulate earlier copies of the browser for in-the-wild testing for those of us on ancient machines.
    my site (updated 13/9/26)
    BROWSER STATS [% share] (2014/5/28) IE7:0.1, IE8:5.3, IE11:8.4, IE9:3.2, IE10:3.2, FF:18.2, CH:46, SF:7.9, NON-MOUSE:32%

  • #6
    Regular Coder
    Join Date
    Aug 2010
    Location
    Now Southern Oregon. I was born and had lived my life in Los Angeles until relocating last year (2010)
    Posts
    215
    Thanks
    52
    Thanked 1 Time in 1 Post

    What this is

    The code I posted uses 'this' because it is part of an object constructor function
    A constructor function allows instantiation with the use of 'new'
    Code:
    function joe(name)
                 {
       this.name = name;
       this.argue = function()
             {
                alert('Who is '+this.name+'?')
             }
    }
    
    var who = new joe('ed');
    alert(who.name)
    who.argue();
    But the use of this in the code may be unnecessary in all cases.

  • #7
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,594
    Thanks
    78
    Thanked 4,386 Times in 4,351 Posts
    Quote Originally Posted by rnd me View Post
    yes, but if you can run 7 you can run 8, including the dev tools. once you have a forward version, you can more-or-less simulate earlier copies of the browser for in-the-wild testing for those of us on ancient machines.
    Agreed. And odds are really good that if it works in IE8 it will also work in IE7. (Not so true with IE9 vs. IE7.)
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #8
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,641
    Thanks
    0
    Thanked 649 Times in 639 Posts
    Quote Originally Posted by Old Pedant View Post
    Agreed. And odds are really good that if it works in IE8 it will also work in IE7. (Not so true with IE9 vs. IE7.)
    If you absolutely must still run IE7 and are developing web pages then you should have the developer toolbar plugin installed in the web browser in which case F12 should still bring up the debugger (which is added by the toolbar if you are using IE6 or 7).

    I don't know why the OP is bothering with JavaScript for this at all.

    Provided that you don't need to support IE6 (which required proprietary values on the object tag) you can use a single object tag to attach your flash and not need any JavaScript for it to work.

    Unless you need to support really antiquated flash versions you can even get it to work in IE6 with only a minor change to what you need in the object tag.

    Only where you need to support both IE6 and really old versions of flash do you need to use two nested object tags. There is never a need to use embed tags as that just substitutes for the standard object tag.

    The only purpose SWOobj now serves is to set a minimum flash version - all the rest of the code is there for IE6.

    See http://www.felgall.com/flash.htm for ways to code the object tag that support flash without needing any JavaScript.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #9
    Regular Coder
    Join Date
    Aug 2010
    Location
    Now Southern Oregon. I was born and had lived my life in Los Angeles until relocating last year (2010)
    Posts
    215
    Thanks
    52
    Thanked 1 Time in 1 Post

    All this is interesting and useful... but

    I have coded this heavily with javascript because there are 4 different versions
    of Flash that I am supporting: v 7, 8, 9 & 10. Javascript queries
    the client to find out what version it supports and then renders the markup
    to accommodate various versions.

    I actually did write different versions of Actionscript source for this.
    In these javascript is necessary for every version. Actionscript and javascript
    trade variable values to tell the mp3 player movie what selection to load and
    play.

    In version 7 of my player app, the selection list is rendered in the Flashmovie itself.
    The Actionscript needs the play list in order to render the play list for the
    user to choose from. It gets that via external interface call backs.

    (perhaps if you have ever programmed Actionscript with external interface
    call backs. You know what I mean)

    It has been a while since I put this together and I have been doing some major
    rewriting of site architecture and code styles. So now I am testing the changes.

  • #10
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,641
    Thanks
    0
    Thanked 649 Times in 639 Posts
    Quote Originally Posted by anotherJEK View Post
    I have coded this heavily with javascript because there are 4 different versions
    of Flash that I am supporting: v 7, 8, 9 & 10. Javascript queries
    the client to find out what version it supports and then renders the markup
    to accommodate various versions.
    From memory it is only version 5 and earlier of Flash that need a separate object tag for IE6 - in which case since you don't need to support that far back you really only need to work with the one object tag - just as long as it doesn't have a classid on it as that will stop it working in browsers other than IE.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •