Hi Nitin,

I can think of the following possible reasons why my script is
not working for you.

1) In the line

mypath = "(the path to the directory that contains your images)"

did you replace "(the path to the directory that contains
your images)" with the actual path where Director can find
your images? If you are not sure and for testing create a
directory on harddisk c: and name it "IMG", put your images
in and then replace the line above with

myPath = "c:\IMG\"

Later you would want to replace this line by a command that
let's the user chose from which directory the images are to
be imported.


2) to make this script work you have to call it. Let's say
you want the script to execute right at the beginning of your
movie, you should write

on startMovie
  importPicts
end

If you have already an on startMovie handler in your movie, put it in there!

If you want it to execute when a button is pressed, you could attach a
script to your button reading:

on mouseUp me
  importPicts
end

I wouldn't do that in your case, as each time you pressed the
button, you would re-import all picts and create new cast
members, ... so don't do it. If you want to refresh the
contents of your new cast members, it's possble as well, but
more complicated.

3) Maybe it's not working because the email (my posting) has  wrapped some
lines, so that you now have 2 lines where it
should all be in one line. In this case however I would
expect a Lingo error message - did you get one?

4) Are you sure your images are of the right file type (.jpg or .tif for
instance?) Howdy was right in pointing out that one could check that too!

nextFileName.char[nextFileName.length - 3 .. nextFileName.length]  gives you
the file extension!

5) finally, to check why it's not working, set a breakpoint
and use the debugger to step through the script. For instance
if you set the breakpoint at the line "nextFileName = "...
and step on you can check if nextFileName is a file name of
one of your picts. It not, check "myPath". Is it really the
path your images are in?

Don't hesitate to ask again, if you don't succeed ...

Michael



-----Ursprungliche Nachricht-----
Von: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]Im Auftrag von nitin sharma
Gesendet: Donnerstag, 18. April 2002 13:54
An: [EMAIL PROTECTED]
Betreff: <lingo-l> importing image into director file by lingo


hi
Michael von Aichberger

thanks for ur help but its not working i don't know
why
i write ur script but nothing is happing.

i created one bitmap cast member & named it,
"forImport" and write following
script in movie script

 on importPicts

 mypath = "(the path to the directory that contains
 your images)"

 repeat with i = 1 to 9999999

  nextFileName = getNthFileNameInFolder(myPath, i)

     if nextFileName = EMPTY then
       exit
     end if


     member("forImport").fileName = myPath &
 nextFileName

     -- create new cast member
    newMember = new(#bitmap)
    newMember.image =
 member("forImport").image.duplicate()

   end repeat
 end

but.......

where i m wrong ?
if i want this script on a button then?

i should write it in button script?

plz help again

lots of thanks

nitin



__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is
for learning and helping with programming Lingo.  Thanks!]

[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]

Reply via email to