A Flash Developer Resource Site

Results 1 to 16 of 16

Thread: sting values

  1. #1

    sting values

    name=_name;
    trace(name);

    myString=eval("name");
    trace(myString);

    suffix=myString.substr( myString.indexOf( "text", 0 ), myString.length );
    trace(suffix);

    Temp=myString.substr( 0, myString.indexOf( "text", 0 ) );
    trace(Temp);
    ---------------------

    the _name of the object is 'londontext'. The whole point of this excercise is to get the value city name out of the object name which is made up of the city name suffixed with the word 'text'.

    i get the first two traces ouputted as 'londontext' so it seems that myString is starting with the correct value for the rest of the script. but then the rest of the code doesnt work. i get 'n' as the third output and nothing fo rthe forth.

    but if i start the script myString="londontext", everything works as expected and the third and fourth outputs are 'text' and 'london' respectivelly.

    what's missing?

  2. #2
    Senior Member
    Join Date
    Apr 2001
    Location
    UK
    Posts
    493
    hello again.

    I've attached an fla that uses a MC with instance name LondonText. The Code is with the actuall MC.
    Attached Files Attached Files

  3. #3

    thanx

    thanx jayhoo,

    im working on a mac now which for some odd reason wont open the fla file- but when i get home i'll check it out on my PC and let you know how i get on.

    your help has been very much appreciated.

  4. #4

    unopenable attachment

    jayhoo,

    the file you attached would not open neither on a mac nor a PC.
    could you please post the code attached to the button.
    - says file format not recognised ?


    thanx

  5. #5
    Senior Member
    Join Date
    Apr 2001
    Location
    UK
    Posts
    493
    what verion of flash are you using?

  6. #6

    fash 5

    flash 5 - but i have mx at home and it still didnt open.
    any chance you could save it as a flash 5 file?

    thanx

  7. #7
    Senior Member
    Join Date
    Apr 2001
    Location
    UK
    Posts
    493
    Sure, see attached.

    (hope its what you want after all this! Let me know if not)
    Attached Files Attached Files

  8. #8

    still not working

    : (
    i dont understand why it's wont open.

    would it not work if you sent me the code attached to the button and i'll try doing within my existing flie?

  9. #9
    Senior Member
    Join Date
    Apr 2001
    Location
    UK
    Posts
    493
    do you want to post an fla example of what you are working on, then at least i can post exactly what you require?

  10. #10

    you're a star

    all the map dots are the same symbol with different instance names. that's what i want to create for the text links. im working on the vienna text link now. so select the vienna button on the text links layer and edit it- you'll find a button with the code you gave me attached.

    thanx

    [had to remove some of the text locations to bring down the filesize]

  11. #11

    you're a star

    all the map dots are the same symbol with different instance names. that's what i want to create for the text links. im working on the vienna text link now. so select the vienna button on the text links layer and edit it- you'll find a button with the code you gave me attached.

    thanx

    [had to remove some of the text locations to bring down the filesize]

    oops! forgot the attachment
    Attached Files Attached Files

  12. #12
    Senior Member
    Join Date
    Apr 2001
    Location
    UK
    Posts
    493
    Your file wont open on my machine either!!
    Was this from your Mac?

  13. #13
    yes. but it shouldnt make a difference. i have sent flash files from here to my home PC and vice versa.

    hmmmm?

  14. #14
    Senior Member
    Join Date
    May 2001
    Posts
    1,838
    Hey the _name is "vienabutton" not "vienatext";

  15. #15

    BIG BIG THANKYOU

    i hate it when this happens- a simple error and it's all gone to pieces.

    jayhoo, ericlin was able to open the file and see a stupid error i had made- your original text wroks perfectly for me.

    ericlin, thanx so much. how come you were able to open the attachements and we weren't?

  16. #16
    Senior Member
    Join Date
    May 2001
    Posts
    1,838
    Mac fla has a 0x80 bytes of header block than PC file.

    For Mac user to open the PC fla, because there is no header block, we needs to open it from "file->open" menu. (I have no experience about this.)

    For PC user to open the Mac file, we use Hex editor to delete the 0x80 bytes of header block from the original file. Then it will be opened by PC.

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