dcsimg
A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: 3.6 processing variables?

  1. #1
    Member
    Join Date
    Feb 2002
    Posts
    71
    I've tried processing my "score" variable string from the server, using the parsing technique in the 3dfa guestbook (this is just an outline; actual code is combination of actionscript and javascript, and variable names are slightly different).

    Code:
    WHILE
    ndx<Length(names)
    mychar=SubString(names,ndx,1);
    ndx += 1;
    if (mychar=="|")
    {
    names_array.add(arraydata)
    arraydata="";
    }
    else arraydata=arraydata+mychar
    While this worked in 3.51, for some reason I'm getting weird stuff with 3.6. You can see a test I'm running at http://www.pedaplus.com/flash/process_variables.swf; the strings from the server are at the bottom; the edit box left middle is the arraydata variable. It looks like all the characters are getting added to arraydata variable twice, and the variable does not become an empty string when the "|" is encountered. I tried doing more of this with actionscript, and only set the array in javascript, but that didn't seem to help either. What am i doing wrong?

    BTW, the source is http://www.pedaplus.com/flash/process_variables.movie
    [Edited by JDE on 07-18-2002 at 12:12 AM]

  2. #2
    Senior Member kusco's Avatar
    Join Date
    Nov 2001
    Posts
    681

    Movie Source problems

    Hi JDE,

    I tried to download the movie source but I was going nowhere in a hurry.

    Could you please check you link?


  3. #3
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    JDE, I had similar problem when making the new guestbook example...

    here is the new code
    Code:
    max=strlen(data);
    
    
    for (ndx=0;ndx<max;ndx++){
    
    mychar=substring (data,ndx,0);
    if(mychar == "|")
    {
    	
    	thetext=thetext+"\n---------------------------\n";
    	}
    else
    	thetext = thetext + mychar; 
    	
    }
    The substring now works in the javascript which is nice but it seems to have a problem. Using 0 as the length returns 1 character whereas 1 returned 2

    bug? Maybe.

  4. #4
    Senior Member kusco's Avatar
    Join Date
    Nov 2001
    Posts
    681

    Affirmative

    Hi Bret,

    Yep, that would definately be considered a bug which is a shame as I was about to use this feature in an application.
    Guess I'll have to continue using the Actionscript version until this is fixed too.

  5. #5
    Member
    Join Date
    Feb 2002
    Posts
    71

    what is it

    Bret, is "\n----------------\n" a way of inserting a line feed and "--------------------" separator? I'm sorry, I got a little lost on that. Also, I don't quite follow the "0 returns 1, but 1 returns 2" problem. You're saying that using 0 for the length of the substring works, but using 1 doesn't? Or is there a continuation (2 returns 3, etc) - I guess I just need to try it for myself.

    Thanks!

    Jon E.

  6. #6
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244

    Re: what is it

    Originally posted by JDE
    Bret, is "\n----------------\n" a way of inserting a line feed and "--------------------" separator? I'm sorry, I got a little lost on that. Also, I don't quite follow the "0 returns 1, but 1 returns 2" problem. You're saying that using 0 for the length of the substring works, but using 1 doesn't? Or is there a continuation (2 returns 3, etc) - I guess I just need to try it for myself.

    Thanks!

    Jon E.
    Yes the \n is a "newline" there are others you can use

    \t is TAB
    \l is linefeed

    Don't remember any others at the moment

  7. #7
    Senior Member
    Join Date
    Jul 2001
    Posts
    173
    Thanks guys - if there's a bug in there, can someone submit it if it hasn't been done yet ?

    cheers

  8. #8
    Senior Member kusco's Avatar
    Join Date
    Nov 2001
    Posts
    681

    Not a bug???

    Hi Damien,

    I've just checked this again and realised that there doesn't appear to be any bug here?

    Bret, I use Flash 6.0 and was wondering if you do as well? It may be a problem with Flash itself?!???

    I won't be submitting a bug report at at this stage.

  9. #9
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244

    Re: Not a bug???

    Originally posted by kusco
    Hi Damien,

    I've just checked this again and realised that there doesn't appear to be any bug here?

    Bret, I use Flash 6.0 and was wondering if you do as well? It may be a problem with Flash itself?!???

    I won't be submitting a bug report at at this stage.
    I haven't had a chance to really sort out the problem but when I ported the javascript over I was getting double characters like JDE was and Substring (thestring,ndx,0) did indeed return one character

  10. #10
    Senior Member kusco's Avatar
    Join Date
    Nov 2001
    Posts
    681

    Re: Re: Not a bug???

    Originally posted by blanius
    I haven't had a chance to really sort out the problem but when I ported the javascript over I was getting double characters like JDE was and Substring (thestring,ndx,0) did indeed return one character
    Hi Bret,

    I checked this again by creating a new movie and the problem you have describe did show up. I previously used a movie I created in 3.51 to test this and it worked fine. I then made a slight change to the 3.51 movie and the problem started to occur.

    I've submitted a bug report to support with both movies.

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