Groups | Blog | Home
all groups > flash actionscript > march 2005 >

flash actionscript : Flashpaper/Menu/Menubar Problem



jfillman
3/7/2005 9:42:57 PM
When I insert CODE 1 into a Flash Form Application (Flash MX 2004), it causes
the menubar component in CODE 2 (Scroll down) not to work. The menu and the
menuItems (Sub-menus) display, but the click event on the menuItems does
nothing when CODE 1 is contained anywhere in the Flash Form Application. I've
tried to make my code as short as possible, but I feel what is here is
necessary to show the whole picture: CODE 1: onClipEvent (load) { //
function: loadFlashPaper // ------------------------ // Parameters: // path_s:
path of SWF to load // dest_mc: Movie clip to hold the imported SWF // width_i:
New size of the dest movie clip // height_i: New size of the dest movie clip //
loaded_o: (optional) Object to be notified that loading is complete function
loadFlashPaper(path_s, dest_mc, width_i, height_i, loaded_o) { var intervalID =
0; var loadFunc = function(){ dest_mc._visible = false; var fp =
dest_mc.getIFlashPaper(); if (!fp) { return; } else if (fp.setSize(width_i,
height_i) == false) { return; } else { clearInterval(intervalID);
dest_mc._visible = true; // Now show the document loaded_o.onLoaded(fp); } }
intervalID = setInterval(loadFunc, 100); dest_mc.loadMovie(path_s); } //
Function called once the FlashPaper SWF is embedded: function onLoaded(fp) {
// We can now call the FlashPaper API functions. // Remove the standard user
interface features: fp.showUIElement('PrevNext', false);
fp.showUIElement('Print', false); fp.showUIElement('Find', false);
fp.showUIElement('Tool', false); fp.showUIElement('Pop', false);
fp.showUIElement('Zoom', false); fp.showUIElement('Page', false);
fp.showUIElement('Overflow', false); fp.enableScrolling(false); // Some
additional API features (here commented out): // Go to page: //
fp.setCurrentPage(8); // Change the magnification to 50%: //
fp.setCurrentZoom(50); } // Now we're ready to start // Create the
destination movie clip to hold the SWF: var theDocMC_mc =
this.createEmptyMovieClip('theDocMC',100); // Position it on the stage:
theDocMC_mc._x = 16; theDocMC_mc._y = 10; // Load the FlashPaper SWF into the
clip, // size it, and trigger the onLoaded() function:
loadFlashPaper('WhartonCentury.swf', theDocMC_mc, 462, 604, this); } CODE2:
onClipEvent (load) { import mx.controls.Menu; import mx.controls.MenuBar; //
Display Settings mga_menu.setStyle('themeColor','haloBlue');
mga_menu.setStyle('fontSize','15'); mga_menu.setStyle('fontWeight','bold');
//Variable Definitions var genInfo_menu:Menu; // Main Menu Items genInfo_menu
= mga_menu.addMenu('General Information'); // Sub-Menu Items
genInfo_menu.addMenuItem({label:'Main Page', type:'radio', selected:true,
enabled:true, instanceName:'main_page', groupName:'group1' } ); //Menu Item
Actions function init():Void { genInfo_menu.addEventListener('change',
genInfo_Listener); } var genInfo_Listener:Object = new Object();
genInfo_Listener.change = function(evt:Object):Void{ switch (evt.menuItem) {
case evt.menu.main_page:
_root.application.Menu_Bar.screenGenInfo.screen_main_page.visible=true; }
} init(); }
roalex
4/24/2005 12:00:00 AM
I have the exact same problem.
You can press the menubar items only if you keep your mouse button pressed
after you acces the menu, select the desired item and then release the mouse
button.
If you find a solution please email me, I'm desperate. ( alexgroups@gmail.com )
CyberNexus
10/7/2005 12:00:00 AM
Has anyone to date ever found a way to resolve this problem? I am using Flash 8
and loading flashpaper docs through the menubar component and i need to hold
the mouse button down over the menu instead of just clicking on the item.

Thanks

- CN
AddThis Social Bookmark Button