A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: expecting a ';'

  1. #1
    Senior Member
    Join Date
    Jan 2002
    Posts
    121

    expecting a ';'

    Hi guys,

    when I use this line in KM, it say it's expecting a ';'

    Code:
    for (blankKey =-1; substring(eval("$version"),blankKey,1) ne " "; blankKey++)    { }
    Where exactly does it want to have it ?

    Stephan
    www.aspetersen.de
    Enabling you to communicate across cultures

  2. #2
    Senior Member
    Join Date
    Jun 2000
    Posts
    3,512
    I doubt if 'ne' is supported. Try using '!='.

    Did you write this code or get it elsewhere?
    Last edited by Bob Hartzell; 12-11-2002 at 02:17 PM.

  3. #3
    Senior Member
    Join Date
    Jun 2001
    Posts
    289
    Not sure about that substring syntax. Think it should be:

    MyStr.substring( beginPtr [,endPtr] )

    I think the AS editor is confused by that bit.

    So maybe first do the eval, store in into a string, then do a resultStr.indexOf(" "). eg:

    Code:
     eStr=eval($version);
     j=eStr.indexOf(" ");
     if(j != -1) {
      for(i=0; i != j; i++) {
    
    // process results up to space.
    
      }
     } else {
    
    // no space
    
     }
    Addendum: Except I am not sure what eval does, so the above may be a load of misleading garbage.
    Last edited by OwenAus; 12-11-2002 at 07:13 PM.

  4. #4
    Senior Member
    Join Date
    Jun 2001
    Posts
    289
    Yo, Stephan.

    If you are looking for the version number this will get it:

    // locate the first space, to bypass platform/os? name.
    ptr=$version.indexOf(" ");
    // pull out the string
    wrk=$version.subStr(ptr+1);
    // locate the first comma
    ptr=wrk.indexOf(",");
    // grab the version number
    vernum=1*wrk.subStr(0,ptr);

    Or at least it does on my setup.

  5. #5
    Senior Member
    Join Date
    Jan 2002
    Posts
    121
    Originally posted by Bob Hartzell
    I doubt if 'ne' is supported. Try using '!='.

    Did you write this code or get it elsewhere?
    Hi Bob,

    I'm tring to pull together some AS code from various resources that works with KM and allows for the detection of the Flash player version within a KM movie. This particular line of code is from
    http://www.flashworker.de/tutorial/76/001.html

    This code is supposed to be regular Flash AS.

    Stephan
    www.aspetersen.de
    Enabling you to communicate across cultures

  6. #6
    Senior Member
    Join Date
    Jan 2002
    Posts
    121
    Originally posted by OwenAus
    Not sure about that substring syntax. Think it should be:

    MyStr.substring( beginPtr [,endPtr] )
    Hi Owen,

    as for substring being a method of the string class, your're right. But when using substring as a function, I've frequently seen the use of these 3 parameters.

    Stephan
    www.aspetersen.de
    Enabling you to communicate across cultures

  7. #7
    Senior Member
    Join Date
    Jun 2001
    Posts
    289
    Fair enough.

  8. #8
    Senior Member
    Join Date
    Sep 2001
    Location
    Australia
    Posts
    379
    You are all right - nobody is wrong - problem is that substring as a function is Flash 4 syntax and is deprecated in 5/6 in favor of the String Object. KoolMoves only supports Flash 5 syntax (and now some Flash 6 in Ver 3.6).

    A lot of the syntax in that tutorial is Flash 4 (and some Flash 3) so it will not work in KM.

    KM also has a known problem with evaluating some expressions dynamically, so you are better off dong as suggested by OwenAus, and evaluating expressions into a variable, and then applying the variable where needed.

    For example, this wont work in KM:
    myVal = 1;
    _root.createEmptyMovieClip("field",myVal++);

    myVal is incremented, but not applied within the function. Bob is aware of this issue and has it on the "todo" list ...

    Bob has done a lot of work trying to get it so that you can just copy and paste FLASH 5 SYNTAX into KM and it will work. There is still some work to do, but Ver 3.6 is a lot closer now.

    If you find any Flash 5 actionscript that does not work in KM, send an email to Bob. I'm sure he will be happy to put it right...

    Hilary

    --

  9. #9
    Senior Member
    Join Date
    Jan 2002
    Posts
    121
    Originally posted by bridelh
    You are all right - nobody is wrong - problem is that substring as a function is Flash 4 syntax and is deprecated in 5/6 in favor of the String Object. KoolMoves only supports Flash 5 syntax (and now some Flash 6 in Ver 3.6).
    Hi Hilary,

    thanks a lot for your reply, that clears up a lot of things.

    What that means though is that I should (or rather, have to) forget about a Flash version detection implemented in KM's AS, right? (because at one point or another one has to make use of AS commands that are Flash4 or even earlier)

    Stephan
    www.aspetersen.de
    Enabling you to communicate across cultures

  10. #10
    Senior Member
    Join Date
    Sep 2001
    Location
    Australia
    Posts
    379
    What that means though is that I should (or rather, have to) forget about a Flash version detection implemented in KM's AS, right?
    If you need to do complex stuff with ActionScript , then you are right, but what you could probably do is try and detect the version on the second frame with a script like the one OwenAus gave, and if the result was undefined, you would know that the version was less than ver 5, and then gotoAndPlay a simple tweened frame set with no ActionScript... maybe.....

    You would also have to set the version detection on the HTML page to 3 or 4, otherwise the user would be wisked off to macromedia for an upgraded player.

    Hilary

    --

  11. #11
    Senior Member
    Join Date
    Jul 2000
    Posts
    5,087
    To be honest you are best to skip the version detection altogether. I have hit about 6 sites which haven't been updated that detect that I have the Flash 6 player or QT Player- it has a Flash 5 Handler built in (NS) installed and efectively lock me out.

    Just making sure that the Object and embedd tags are have the proper version in it will direct them to upgrade and if they do not wish to upgrade they can always either;

    1. Close the NS Plug In Finder Page
    2. Click cancel or never download on the IE Auto plug-in feature.

    If they decide not to upgrade the AS is simply ignored.

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center