Old 26-02-2008, 22:24   #1 (permalink)
jman6054
jbomb
 
Join Date: Dec 2007
Posts: 1
Modular script help

Hello all, I was hoping for some advice on how to modularise this script - it works fine at the moment but is becomeing very hard to manage. The script relates to a floating text caption over objects in a flow chart I have created.

Each time I add a new node in the flow chart, i have to replicate the script for the caption and the node, here is the script examples for 2 nodes in the flow chart.

Any advice on reducing the amount of repeated code in this script? Thanks in advance...

hoveroverModule.onRollOver = function() {
this.onEnterFrame = function () {
captionModule._alpha += (100-captionModule._alpha)/3;
captionModule._x -= (captionModule._x-_xmouse)/2;
captionModule._y -= (captionModule_y-_ymouse)/2;
}
};
hoveroverModule.onRollOut = function() {
this.onEnterFrame = function() {
captionModule._alpha += (0-captionModule._alpha)/3;
};
};

//FOLDER

hoveroverFolder.onRollOver = function() {
this.onEnterFrame = function () {
captionFolder._alpha += (100-captionFolder._alpha)/3;
captionFolder._x -= (captionFolder._x-_xmouse)/2;
captionFolder._y -= (captionFolder_y-_ymouse)/2;
}
};
hoveroverFolder.onRollOut = function() {
this.onEnterFrame = function() {
captionFolder._alpha += (0-captionFolder._alpha)/3;
};
};
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8