StarSoft Multimedia

Examples

All examples

"go to movie" in StarMenu Xtra
Example of StarMenu Xtra in use


Downloads

StarMenuExample_1.zip
Description:
Associated source files
Size:
120 kB
Requirements:
Director MX
StarMenu Xtra

Problem description

If in the function handling the menu item click you place the direct Lingo command go to movie, every several clicks (undetermined amount) you can get an error message "Access violation at address 06CCC80E in module 'starmenu.x32'. Read of address FFFFFFFF". It is due to the fact that every time you go to a new movie, the current one is closed and the StarMenu Xtra cast member deleted from the memory, although one of its functions (i.e. the click handling one) is still being executed. To eliminate this you should use some trick in Director.

Solution idea

The solution is to caused the go to movie command inside other event handler than menu item click handler. The best would be to use exitFrame event, as it is raised tens times per second and the user will not notice any delay between the menu item click and application reaction. We can use additional global variables (of Boolean type) named for instance GoToMovieX allowing to communicate between events. Every new movie will then have its own variable set on true in menu item click handler and tested in exitFrame handler. The true value will make the presentation go to the other movie.

Solution

Below is the contents of StarMenu Xtra cast member script. Let's assume we have 3 menu items named "Articles", "Pictures" and "Movies" and each one of them is to launch a .dir movie named respectively "art.dir", "pict.dir" and "mov.dir".
-- StarMenu Xtra cast member script

global GoToMovie1, GoToMovie2, GoToMovie3

on menuClick menuItem
  if menuItem[#Name] = "Articles" then GoToMovie1 = true
  else if menuItem[#Name] = "Pictures" then GoToMovie2 = true
  else if menuItem[#Name] = "Movies" then GoToMovie3 = true
end

on exitFrame
  if GoToMovie1 then
    GoToMovie1 = false
    go to movie "art"
  end if

  if GoToMovie2 then
    GoToMovie2 = false
    go to movie "pict"
  end if

  if GoToMovie3 then
    GoToMovie3 = false
    go to movie "mov"
  end if
end

Note. In order for exitFrame event to be raised in a cast member, in the current frame there should be a sprite for the given one. Therefore, using the StarMenu Xtra cast member the developer should create a sprite for the whole range of frames for which the script is to work in. Sprite associated with StarMenu is used to display the menu automatically, but if this option is not used (because either Popup or ModalPopup function is used), then this sprite can have 0x0 size and can be put in any place of the stage, as shown below.



For more information on the StarMenu sprite and menu display see the Manual.


Any comments? -


All examples

Best sellers
Most frequently bought products:
1. MediaPlayer Xtra
2. UltimateNet Xtra
3. StarMenu Xtra
News
2008-03-27
Our xtras are Adobe Director 11 ready.

We tested our xtras under latest release of Director and found most of them works absolutely normally.

You can safely use StarSoft Multimedia xtras in Director 11.
Top 10 downloads
Most frequently downloaded files:
MediaPlayer Xtra (57260)
StarMenu Xtra (23185)
MediaPlayer Exp. Xtra (18186)
DisplayMode Xtra (14347)
ProjectorLook Xtra (13315)
AnyShape Xtra (11875)
UltimateNet Xtra (11804)
MailTo Xtra (11575)
MediaPlayer Exp. Demo .exe (8624)
SmartOLE Xtra (7520)