|
Prev: Pan zoom in and out with sprites
Next: Quiz Project
From: jclegs on 6 May 2008 08:35 Hi I'm trying to import images to a shockwave movie but I don't know how director stores an image file e.g. to load text in I used a field cast member. Can anyone shed any light on this? Thanks
From: Mike Blaustein on 6 May 2008 08:46 You can use a #bitmap image and set the .filename to the address of the image. Make sure you include all the appropriate xtras for import/export of the file types you are using (e.g bitmap, png, jpeg, etc)
From: Chunick on 6 May 2008 09:50 If you're referring to the option to browse that you see in forms on webpages then you might be interested in this link: http://www.lingoworkshop.com/Testzone/UploadTest.php
From: jclegs on 7 May 2008 07:29 So do I change the field type to #bitmap in the following piece of code that I got from adobe's site to import an image? Thanks on readFromFile global myFile if objectP(myFile) then set myFile = 0 --Deletes the instance if it already exists set myFile = new(xtra "fileio") -- Creates an instance of FileIO if the machinetype = 256 then setfiltermask (myfile, "All files,*.*,Text files,*.txt") -- Sets the filter mask (Win) else setfiltermask (myfile, "TEXT") -- Set the filter mask (Mac) end if set fileName = displayOpen(myFile) -- Displays the "Open" dialog if not voidP(filename) and not (filename = EMPTY) then openFile(myFile, filename, 1) -- Opens file that user selected if status(myFile) = 0 then set theFile = readFile(myFile) -- Reads the file into a Lingo variable put theFile into field "myField" -- Displays the text in a field else alert error(myfile,status(myfile)) -- Displays error message end if end if closeFile(myFile) -- Closes the file set myFile = 0 -- Disposes of the instance end
From: Mike Blaustein on 7 May 2008 08:01
That code reads the text from an external text file, so it would not be correct for use if you want to set the image of a bitmap. All you need to do is get the path to the bitmap you want to use, then member("yourBitmapMemberName").filename="c:\path\to\file.jpg" |