dcsimg
A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: GRRRR!!!!! can't loadMovie with a variable in a text file!!!!

  1. #1
    Junior Member
    Join Date
    Apr 2001
    Posts
    18
    I have a text file with only a line of script :
    tab[0]="fiche.swf"
    I load variables with : loadVariables("myfyle.txt",0);
    so I make a loadMovie(tab[0],myObject);
    but nothing appear ????
    I did a trace (tab[0]); , and the window show "fiche.swf", I guess the loadvariable work well but how can I use the content of the variable to load the movie ?

    Thanxxxxxxxx

    Ejoe

  2. #2
    Beyond the Sea
    Join Date
    Mar 2000
    Posts
    997

    hmm...

    I just did a couple of tests. It looks like flash won't automatically create an array if you load in a bunch of variables named with array notation like:
    bob[0]=this.swf&
    bob[1]=that.swf&
    bob[2]=someother.swf&

    Then, when you reference the variables, flash thinks they should be an array and won't return the value correctly. What you could do is just name the variables sequentially, like this:
    bob0=this.swf&
    bob1=that.swf&
    bob2=someother.swf&

    Then, you can loop through them with a for loop. The bad thing is you won't have a .length attribute to know how many total variables you have.

  3. #3
    Junior Member
    Join Date
    Apr 2001
    Posts
    18
    thanx man, but I have tried what you said , the loadVariables works but then I try loadMovie(tab0,myObject); but it didn't works why?

    thanks !

    PS: Do you search a job ?

  4. #4
    Beyond the Sea
    Join Date
    Mar 2000
    Posts
    997

    well, take a look at my test files

    Go here:
    http://www.richpaul.com/learning/loa...loadArray.html

    download that example. It should get you moving in the right direction.

    ps. Yes, I'm looking for a job...work is scarce, so it seems, for front-end flash designers...at least here in Utah...

    [edit]stupid path names...sheesh[/edit]

  5. #5
    Junior Member
    Join Date
    Apr 2001
    Posts
    18

    hey, thanks man.

    thanks for your help man, it works well!

    By the way, why don't you come in France ? There are lots of good opportunities here!
    Flash Designers are really welcome !

    Ejoe

  6. #6
    Junior Member
    Join Date
    Apr 2001
    Posts
    18

    hummm...

    excuse me, I don't understood that line:
    someBob[i] = _root["bob" + i];
    what is _root["bob1"] ?

    Thanks!

  7. #7
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766

    obj["name"] is an alternate method of accessing a named propery of an object, it's equivalent to saying obj.name but the method using the brackets lets you use an expression in place of the property name which is a LOT more flexible.

    This is covered very nicely in Colin Moock's new book ActionScript : The Definitive Guide. You must have a copy of this on your desk. You can find out more at http://www.moock.org/asdg


  8. #8
    Junior Member
    Join Date
    Apr 2001
    Posts
    18

    thanks!!!!!!

    Ok i got it ( at last! )
    Thank you for all !

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