Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: QTJava and Flash interactivity



ok, this is what you do :

tools you will need :
- a way to 'wire' your flash button. IE : LivestagePro (
http://www.totallyhip.com )
you're going to be attaching DebugStr actions to your flash button - you can
do this programatically, through java, or you can save yourself weeks of
effort and just get a hold of a copy of livestage. (RECOMMENDED)
note : there are other actions that work as well for this, but i've found
DebugStr to be the simplist and most appropriate for all tasks.


you need to use a QTPlayer() because you're going to be capturing mcAction
events from its MovieController in a class that you will subclass from
ActionFilter. Also to preserve your interactivity in your swf, you need to
use the QTPlayer().

_mc = new MovieController(_m);

_mc.setKeysEnabled(true); // let key events into the movie -- optional...
_mc.setControllerKeysEnabled(true);

// this is the event trap
_filter = new MyActionFilter(kMCActionEvent, (Object)_movieName);
_mc.setActionFilter(_filter, false); //don't do idle events
_mc.setVisible(false); // up to you
_player = new QTPlayer(_mc);

.....

public class MCActionFilter extends ActionFilter {

/**
* This method will receive the following actions:
* mcActionLinkToURL mcActionShowMessageString mcActionGetNextURL
*
* DebugStrs sent via QuickTime will arrive here.
*/
public boolean execute (MovieController mc, int action, StringHandle string)
{
String thisIsWhatYouWant = string.toJavaString();
}

}


that's basically it -- as far as getting a template project for you - i'd
recommend starting with the PlayMovie code in the SDK, then add this stuff
to it. if you need a simple flash button wired up - i'd be happy to send you
an example for you to test with. it would just take a sec to make, and could
save you tons of frustration.

rf



> I'm new to QTJava and this list. I've been through
> the zoo tutorial. What I want to do is click on a
> button in a flash movie and be able to listen for that
> event in Java.
>
> When I try to play a flash movie that has buttons, the
> movie doesn't react to the mouse clicks or anything.
> I guess I'm missing something somewhere. If someone
> has suggestions on how to do this, I would really
> appreciate it!
>
> (btw, I am not a flash animator, just a java
> programmer trying to get the connection between flash
> and QTJava to work).
>
> Thanks!
>
> Dave.


References: 
 >QTJava and Flash interactivity (From: David Mullens <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.