Hi, there
Can we Play a sound when clicking a text on a page of Print2Flash documents? It is very important in making a tutorial that need a sound (like giving an example of pronouncing a word or sentence in an e-book for learning forign language.
Thanks for your attention
Playing a sound when clicking a text on a page
Re: Playing a sound when clicking a text on a page
Print2Flash Document APi broadcasts onSelection event whenever the user changes text selection. You may get the selected text in this event handler by calling getSelectedText function which may be used to determine the text to pronounce. More information on this event is available at http://print2flash.com/help/DocumentAPIEvents.php
Re: Playing a sound when clicking a text on a page
thanks for your information, but what I mean is how to Play a sound (like *.wav or *.mp3) when clicking a text or an object on a page of Print2Flash documents?
Re: Playing a sound when clicking a text on a page
The problem is how you would want to detect what is clicked on a page. For example, when user clicks on a text, do you want to know the text around the cursor or just the word clicked or something else? And what would you want to know if user clicks an image?
Our suggested solution with text selection allows a user to select a specific text with mouse which you may determine in the onSelection event handler and play an appropriate MP3 file as a reaction on text selection. To play MP3 files we think you may use the standard technique as described by Adobe at http://livedocs.macromedia.com/flash/8/ ... 01565.html
Our suggested solution with text selection allows a user to select a specific text with mouse which you may determine in the onSelection event handler and play an appropriate MP3 file as a reaction on text selection. To play MP3 files we think you may use the standard technique as described by Adobe at http://livedocs.macromedia.com/flash/8/ ... 01565.html
Re: Playing a sound when clicking a text on a page
Suppose I just want to click an object (including texts or image, not select a text) and the object will response by giving command to .... (including ...to play an audio file or run other commands such as go to other pages).
Re: Playing a sound when clicking a text on a page
Each document page is a MovieClip object composed of text, images, lines and other graphic primitives. The problem is MovieClip seems not to provide a way to enumerate its constituent objects and track clicks on them.
You may obtain a reference to the page movie instance using this undocumented method:
Here the 0 index refers to the first page, the 1 would refer to the second page and so on. Then in principle you can attach an event listener to this object and track clicks on it. But as constituent objects cannot be determined, this seems to allow you to track only the coordinates of the click or the text near the click point.
You may obtain a reference to the page movie instance using this undocumented method:
Code: Select all
var page1=doc.Pages[0].movie
Re: Playing a sound when clicking a text on a page
the samples, please!
Re: Playing a sound when clicking a text on a page
See attached an adaptation of our Print2Flash SDK Flash sample. When you click within any area of the first page, It should write to the Flash Professional output window the coordinates of the click point and the position of the text symbol near the click point (if any).
- Attachments
-
- sample.ZIP
- (205.12KiB)Downloaded 1297 times