Admin wrote:
The problem is that I can’t have another rollout event for the entire menu as it conflicts with the submenu rollouts. If that makes any sense.
Here is the script I have now:
// generates a list of menu items (effectively one menu)
// given the inputted parameters. This makes the main menu
// as well as any of the submenus
GenerateMenu = function(container, name, x, y, depth, node_xml) {
// variable declarations
var curr_node;
var curr_item;
var curr_menu = container.createEmptyMovieClip(name, depth);
var menuBackground = container.createEmptyMovieClip(name, depth);
var menuHeight;
// for all items or XML nodes (items and menus)
// within this node_xml passed for this menu
for (var i=0; i numofitems=node_xml.childNodes.length;
// movieclip for each menu item
curr_item = curr_menu.attachMovie("menuitem","item"+i+"_mc", i+1);
curr_item._x = x;
curr_item._y = y + i*curr_item._height;
curr_item.trackAsMenu = true;
//measure height of main menu
menuHeight = curr_item._height*numofitems+16;
trace(menuHeight);
// item properties assigned from XML
curr_node = node_xml.childNodes[i];
curr_item.action = curr_node.attributes.action;
curr_item.variables = curr_node.attributes.variables;
curr_item.name.text = curr_node.attributes.name;
curr_item.linkDescription.text = curr_node.attributes.linkDescription;
curr_item.linkIcon.loadMovie(curr_node.attributes.linkIcon);
// item submenu behavior for rollover event
if (node_xml.childNodes[i].nodeName == "menu"){
// open a submenu
curr_item.node_xml = curr_node;
curr_item.onRollOver = curr_item.onDragOver = function(){
var x = this._x + this._width;
var y = this._y + 8;
GenerateMenu(curr_menu, "submenu_mc", x, y, 1000, this.node_xml);
// show a hover color
var col = new Color(this.background);
col.setRGB(0xf4faff);
};
}else{ // nodeName == "item"
curr_item.arrow._visible = false;
// close existing submenu
curr_item.onRollOver = curr_item.onDragOver = function(){
curr_menu.submenu_mc.removeMovieClip();
// show a hover color
var col = new Color(this.background);
col.setRGB(0xf4faff);
};
}
curr_item.onRollOut = curr_item.onDragOut = function(){
// restore color
var col = new Color(this.background);
col.setTransform({ra:100,rb:0,ga:100,gb:0,ba:100,bb:0});
};
// any item, menu opening or not can have actions
curr_item.onRelease = function(){
Actions[this.action](this.variables);
CloseSubmenus();
CloseMainMenu();
};
/*menuBackground.onRollOut = function(){
if(!mainmenu_mc.submenu_mc.hitTest(_root._xmouse, _root._ymouse, true)){
CloseMainMenu();
}
}*/
} // end for loop
currMenuBackground = menuBackground.attachMovie("background","background", 0);
currMenuBackground._x = x;
currMenuBackground._y = y - 8;
currMenuBackground._yscale = menuHeight;
};
// create the main menu, this will be constantly visible
CreateMainMenu = function(x, y, depth, menu_xml){
// generate a menu list
GenerateMenu(this, "mainmenu_mc", x, y, depth, menu_xml.firstChild);
// close only submenus if visible durring a mouseup
// this main menu (mainmenu_mc) will remain
mainmenu_mc.onMouseUp = function(){
if (mainmenu_mc.submenu_mc && !mainmenu_mc.hitTest(_root._xmouse, _root._ymouse, true)){
CloseSubmenus();
}
};
mainmenu_mc.onRollOut = function(){
if(!mainmenu_mc.submenu_mc.hitTest(_root._xmouse, _root._ymouse, true)){
CloseMainMenu();
}
}
};
// closes all submenus by removing the submenu_mc
// in the main menu (if it exists)
CloseSubmenus = function(){
mainmenu_mc.submenu_mc.removeMovieClip();
};
//closes the main menu by removing the movie clip
CloseMainMenu = function(){
mainmenu_mc.removeMovieClip();
trace("CloseMainMenu");
}
// load XML, when done, run CreateMainMenu to interpret it
menu_xml = new XML();
menu_xml.ignoreWhite = true;
menu_xml.onLoad = function(ok){
// create main menu after successful loading of XML
if (ok){
CreateMainMenu(10, 10, 0, this);
message_txt.text = "message area";
}else{
message_txt.text = "error: XML not successfully loaded";
}
};
// load first XML menu
menu_xml.load("menu1.xml");Posted in Flash Application and Games Development | No Comments »
Today, The Cult of the Dead Cow, the infamous hacking collective, has released a Google hacking utility called Goolag Scan that brings the ability to search the information engine for web-based data that is normally hidden to anyone wannabe with a web browser and half a brain. It does this by implementing something in the region of 1500 customised Google search routines to reveal application server passwords, credit card numbers, corporate email records and audit logs to name just a few examples. Sure, the ability to find this stuff is open to anyone using Google who knows what to look for and how…
(Link)
Posted in Flash Application and Games Development | No Comments »
Today,
Posted in Flash Application and Games Development | No Comments »
Today, IDC is out with its annual IT market forecast and, at first glance, 2008 won’t be setting any box-office records, business-wise.According to the Boston-based consultancy, growth in global technology spending will slow next year, rocked by a potential U.S. economic downturn that could crimp spending on computer hardware.Overall, IDC estimates worldwide technology spending growth to range between 5.5 percent and 6 percent in 2008, down from about 7 percent this year. U.S. spending growth will dip to 3 percent to 4 percent next year from 6.6 percent in 2007, IDC said.The report also…
(Link)
Posted in Flash Application and Games Development | No Comments »
Admin wrote:
However, when I click the button, the timing gets screwed up and other slides tend to keep playing and out of order. I am not sure what I’m doing wrong as I have every MC stops on the last frame, but it acts as though these continue to play in the background.
example here:
http://www.kadlac.com/misc/main/
Posted in Flash Application and Games Development | No Comments »
Admin wrote: I love Irish music, so I didn’t resist to post this funny video WPvideo 1.10fun, off topic, Videos
(Link)
Posted in Flash Application and Games Development | No Comments »
Admin wrote:
class blah{
var myparameter
public function set parameter(targetMcStr:String):Void {
myparameter=targetMcStr
}
[Inspectable(defaultValue="= enter the target Movie Clip instance name here =")]
public function get parameter():String {
return myparameter;
}
function blah(){}
}but when i click in the property area (at the bottom of the flash IDE) with my component on stage and selected it says "this component may only be edited via the component inspector" rather than listing my custom parameter to be edited….
anyone got any idea why?
[edit] If i s4elect my component in the library and select "component definition" it shows my parameter…just not in the property inspector area
Posted in Flash Application and Games Development | No Comments »
Admin wrote: From what I’m seeing out here in the trenches, economists just can’t seem to agree on the health of the U.S. economy, in general, and the technology economy, in particular in 2008.Last week’s consumer numbers seem to suggest that people are still willing to break out the checkbooks and buy new computers, cameras, TV’s and other tech-related consumer goods. CEO surveys are a bit more cautious, perhaps because marketing and research spending are flat so far in 2007.To give us further hope, a new forecast out this morning suggests that the manufacturing economy - - especially computer makers…
(Link)
Posted in Flash Application and Games Development | No Comments »
Admin wrote:
I’ve made xml gallery which has simple slideshow in starting and after clicking on that its takes to the xml loaded scrolling mc which is not scrolling properly like the tuts here in Kirupa. I’ve following code for that
function ScrollingCollectionTimeLine(target:MovieClip, speed:Number, dir:Number) {
var mousePercent:Number = page_collections._xmouse/725;
//trace(mousePercent);
var mSpeed:Number;
if (dir == 1) {
mSpeed = 1-mousePercent;
} else {
mSpeed = mousePercevnt;
}
target.destX = Math.round(-((target._width-725)*mSpeed));
target.onEnterFrame = function() {
if (target._x == target.destX) {
delete target.onEnterFrame;
} else {
target._x += Math.ceil((target.destX-target._x)*(speed/100));
}
};
}
I am also attaching my fla and swf file here. Any help will be highly appreciated and many thx in advance.
Regards
Posted in Flash Application and Games Development | No Comments »
Admin wrote: CES always provides plenty of great news, and plenty of juicy gossip, but I love it best when it mixes the two and you end up with a nice big fight. This would appear to be what is happening right now after the One Laptop Per Child (OLPC) project announced that it and Microsoft were working to develop a dual-booting, Linux and Windows, version of the cheap and cheerful laptop for third world kids. Nicholas Negroponte, OLPC chairman, has been quoted as saying “We are working with them very closely to make a dual-boot system so that, like on an Apple, you can boot either one up. The version…
(Link)
Posted in Flash Application and Games Development | No Comments »




