Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using member(#).fileName = ... To generate a cast from an XML file.

Status
Not open for further replies.

yantzgh

Programmer
Dec 11, 2001
3
CA
Hi,

I am using Director to read an XML file and then generate the cast based on that file. The reading is OK and generation works when I use importFileInto member(#), "fileName.ext". The only problem is that this makes the load time really long.

On my home computer, I used...
member(#).fileName = the applicationPath&"fileInfoName.ext" to set the file for each member, which links to the external file and doesn't import it into Director (as far as I can tell). At work, this method fails every time. Any suggestions as to why this would happen?? Here is a sample of the code (without the XML interaction)...

on prepareMovie me
member(2).fileName = the applicationPath &"images/somePic.gif"
member(2).name = "somePic"
end

...Thanks for your help.
 
I would suggest cheating a bit. if you know the file type (I will assume you do or can modify things so it can) use something along the lines of

set newmember = newmember(#bitmap)
member(newmember).filename = whateveryoulike
member(newmember).name = whateveryoulike

That should do the trick.

newmember(#bitmap, 1 of castlib "images") should (I never tried this) force it into that cast member and cast lib.

 
I tried that, but it doesn't seem to work. The file type will always either be png or swf. I always know which type it will be and when based on the XML info that is entered.

What exactly is the variable 'newmember' that you have above? It keeps saying that newmember doesn't have a handler to set the #bitmap property.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top