| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
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; }; }; |
|
|
|
![]() |