Creative COW SIGN IN :: SPONSORS :: ABOUT US :: CONTACT US
ADOBE DIRECTOR: HomeDirector ForumTagMotion Graphics

Buddy API - open file with...

Cow Forums : Adobe Director

<< PREVIOUS THREAD   •   VIEW ALL THREADS   •   PRINT   •   NEXT THREAD >>
Buddy API - open file with...
by darren john on Aug 7, 2008 at 3:20:57 pm

Hey there guys!

Wonder if any of you geniuses could help me out with a small thing:

Basically I use the buddy api Xtra to open bitmap jpg files:

on mouseUp
cursor -1
OK = baOpenFile(the moviePath & "Disc resourcesImages" & "image.jpg" , "Normal")
end

All works perfectly, but what I want to do is ensure that the bitmap jpg files ALWAYS open in Windows Picture and Fax viewer (sometimes they open in different applications such as Microsoft Photo Editor on other PCs, depending on what the users default settings are) but I'm thinking that this could simply be out of mine and buddy api's control? Or is there a way? Perhaps using the FindApp function?

The reason I want to open the bitmap files in this application is because it has a scrolling facility (Previous image / Next image) where users can scroll through each of the images without having to open each image individually. This was the clients request and I would just like to know if there IS a way and if so, any help would be greatly appreciated to make this happen but if not, then I can confidently inform the client that it is beyond our control.

HOWEVER...I did a bit of the old research and it seems the Windows Picture and Fax viewer in Vista has now been completely re-written and now uses Windows Photo Gallery Viewer.

So this could be a problem since the project I'm working on now has to consider Vista users so I'm thinking the safest bet is just to leave the function as is, in which case the bitmap file should simply open in the users default picture viewer be it WPAFV or WPGV or some other application that the user has knowingly or unknowlingly set as the default for viewing pictures/images etc on their system.

Then again, I could always code my own image viewer, but I must admit I have never coded my own image viewer to date. Would it be worth me doing this? Are there any good resources you could point me to on how to get started on implementing this?

Your thoughts and advice would be appreciated.

Thanks in advance guys.

Darren



Respond to this post   •   Return to posts index

Re: Buddy API - open file with...
by William McGrath on Aug 18, 2008 at 11:28:48 am

I myself would go for doing everything within the Director player if possible. That way you have a lot more control.

It shouldn't be too hard to, for instance, generate a list of images and then use the buttons to do a simple getAt operation that will open and visualize the next or previous pic.

I would just use the importFileInto(whateverFile&path). However, you should have one single cast member into which you import the different files, so as to not overload your memory. What I do is have a member called, say "images" in a cast called say "bitmaps" and then I go:

member("images", "bitmaps").importFileInto(whateverFile&path)

However, since it renames the member and I need to keep referring to it, I rename it again with something like this:
member("whateverFile", "bitmaps")="images" --back to the original name


To generate a list of images, I would use something like this, perhaps in a prepareMovie handler (this is from an actual CD in which I worked with over a thousand refeences):

on makeList
gImages = [ ]
myPath = "@/images/" --suposing they're in that folder
repeat with i = 1 to 2000 --some way-too-large number
n = getNthFileNameInFolder(myPath, i)
if n = EMPTY then exit repeat
gImages.append(n)
end repeat

return gImages

end makeList


---
william

Respond to this post   •   Return to posts index

Re: Buddy API - open file with...
by darren john on Aug 18, 2008 at 11:47:31 am

Many thanks for your response and advice, it is greatly appreciated. I will have a go at this now and keep you updated.

Thanks again,

Darren



Respond to this post   •   Return to posts index


Re: Buddy API - open file with...
by William McGrath on Aug 18, 2008 at 4:38:22 pm

Yes, let us know how it goes.

Oops! Member("whateverFile", "bitmaps")="images" doesn't mean anything.
Obviously, it should be:
member("whateverFile", "bitmaps").name="images"


---
william

Respond to this post   •   Return to posts index

<< PREVIOUS THREAD   •   VIEW ALL THREADS   •   PRINT   •   NEXT THREAD >>


FORUMSTUTORIALSMAGAZINETRAININGVIDEOS - REELSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

© CreativeCOW.net All rights are reserved.

[Top]