What's new
Photoshop Gurus Forum

Welcome to Photoshop Gurus forum. Register a free account today to become a member! It's completely free. Once signed in, you'll enjoy an ad-free experience and be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

submenus dir not displaying (code included)


spurs2k12

New Member
Messages
1
Likes
0
Ok so have been trying to figure out why sub menus will not direct to requested dir of pdf's. Now im not familiar with AS3 as our guy who was retired recently. So im totally new to this...



import flash.events.MouseEvent;

//init sublinks
var sublink_1:Object = this.getChildByName( 'SublinkMC_1' );
var sublink_2:Object = this.getChildByName( 'SublinkMC_2' );
var sublink_3:Object = this.getChildByName( 'SublinkMC_3' );
var sublink_4:Object = this.getChildByName( 'SublinkMC_4' );
var sublink_5:Object = this.getChildByName( 'SublinkMC_5' );
var sublink_6:Object = this.getChildByName( 'SublinkMC_6' );
var sublink_7:Object = this.getChildByName( 'SublinkMC_7' );
var sublink_8:Object = this.getChildByName( 'SublinkMC_8' );
var sublink_9:Object = this.getChildByName( 'SublinkMC_9' );
var sublink_10:Object = this.getChildByName( 'SublinkMC_10' );
var sublink_11:Object = this.getChildByName( 'SublinkMC_11' );
var sublink_12:Object = this.getChildByName( 'SublinkMC_12' );
var sublink_13:Object = this.getChildByName( 'SublinkMC_13' );
var sublink_14:Object = this.getChildByName( 'SublinkMC_14' );
var sublink_15:Object = this.getChildByName( 'SublinkMC_15' );
var sublink_16:Object = this.getChildByName( 'SublinkMC_16' );
var sublink_17:Object = this.getChildByName( 'SublinkMC_17' );
var sublink_18:Object = this.getChildByName( 'SublinkMC_18' );

//set link names dynamic text
sublink_1.SublinkNameDT.text = 'Note 1 - Summary of Significant Accounting Policies';
sublink_2.SublinkNameDT.text = 'Note 2 - Cash, Cash Equivalents and Investments';
sublink_3.SublinkNameDT.text = 'Note 3 - Disaggregation of Current Receivables and Payables';
sublink_4.SublinkNameDT.text = 'Note 4 - Capital Assets';
sublink_5.SublinkNameDT.text = 'Note 5 - Revenue Bond and Commercial Paper Ordinances Requirements';
sublink_6.SublinkNameDT.text = 'Note 6 - Revenue Bonds';
sublink_7.SublinkNameDT.text = 'Note 7 - Commercial Paper and Related Revolving Credit Agreement';
sublink_8.SublinkNameDT.text = 'Note 8 - Flexible Rate Revolving Note';
sublink_9.SublinkNameDT.text = 'Note 9 - Employee Pension Plan';
sublink_10.SublinkNameDT.text = 'Note 10 - Other Postemployment Benefits';
sublink_11.SublinkNameDT.text = 'Note 11 - Other Obligations and Risk Management';
sublink_12.SublinkNameDT.text = 'Note 12 - Other Financial Instruments';
sublink_13.SublinkNameDT.text = 'Note 13 - Lease-Leaseback';
sublink_14.SublinkNameDT.text = 'Note 14 - South Texas Project';
sublink_15.SublinkNameDT.text = 'Note 15 - Commitments and Contingencies';
sublink_16.SublinkNameDT.text = 'Note 16 - Leases';
sublink_17.SublinkNameDT.text = 'Note 17 - Pollution Remediation Obligation';
sublink_18.SublinkNameDT.text = 'Note 18 - Subsequent Events';

//set url addresses
var url_sublink_1:URLRequest = new URLRequest( 'PDF_FILES/13. Note 1 – Summary of Significant Accounting Policies.pdf' );
var url_sublink_2:URLRequest = new URLRequest( 'PDF_FILES/14. Note 2 - Cash, Cash Equivalents and Investments.pdf' );
var url_sublink_3:URLRequest = new URLRequest( 'PDF_FILES/15. Note 3 - Disaggregation of Current Receivables and Payables.pdf' );
var url_sublink_4:URLRequest = new URLRequest( 'PDF_FILES/16. Note 4 - Capital Assets.pdf' );
var url_sublink_5:URLRequest = new URLRequest( 'PDF_FILES/17. Note 5 - Revenue Bond and Commercial Paper Ordinances Requirements.pdf' );
var url_sublink_6:URLRequest = new URLRequest( 'PDF_FILES/18. Note 6 - Revenue Bonds.pdf' );
var url_sublink_7:URLRequest = new URLRequest( 'PDF_FILES/19. Note 7 - Commercial Paper.pdf' );
var url_sublink_8:URLRequest = new URLRequest( 'PDF_FILES/20. Note 8 - Flexible Rate Revolving Note.pdf' );
var url_sublink_9:URLRequest = new URLRequest( 'PDF_FILES/21. Note 9 - Employee Pension Plan.pdf' );
var url_sublink_10:URLRequest = new URLRequest( 'PDF_FILES/22. Note 10 - Other Postemployment Benefits.pdf' );
var url_sublink_11:URLRequest = new URLRequest( 'PDF_FILES/23. Note 11 - Other Obligations and Risk Management.pdf' );
var url_sublink_12:URLRequest = new URLRequest( 'PDF_FILES/24. Note 12 - Other Financial Instruments.pdf' );
var url_sublink_13:URLRequest = new URLRequest( 'PDF_FILES/25. Note 13 - Lease-Leaseback.pdf' );
var url_sublink_14:URLRequest = new URLRequest( 'PDF_FILES/26. Note 14 - South Texas Project.pdf' );
var url_sublink_15:URLRequest = new URLRequest( 'PDF_FILES/27. Note 15 - Commitments and Contingencies.pdf' );
var url_sublink_16:URLRequest = new URLRequest( 'PDF_FILES/28. Note 16 - Leases.pdf' );
var url_sublink_17:URLRequest = new URLRequest( 'PDF_FILES/29. Note 17 - Pollution Remediation Obligation.pdf' );
var url_sublink_18:URLRequest = new URLRequest( 'PDF_FILES/30. Note 18 - Subsequent Events.pdf' );


//run subroutines
set_sublink( sublink_1, url_sublink_1 );
set_sublink( sublink_2, url_sublink_2 );
set_sublink( sublink_3, url_sublink_3 );
set_sublink( sublink_4, url_sublink_4 );
set_sublink( sublink_5, url_sublink_5 );
set_sublink( sublink_6, url_sublink_6 );
set_sublink( sublink_7, url_sublink_7 );
set_sublink( sublink_8, url_sublink_8 );
set_sublink( sublink_9, url_sublink_9 );
set_sublink( sublink_10, url_sublink_10 );
set_sublink( sublink_11, url_sublink_11 );
set_sublink( sublink_12, url_sublink_12 );
set_sublink( sublink_13, url_sublink_13 );
set_sublink( sublink_14, url_sublink_14 );
set_sublink( sublink_15, url_sublink_15 );
set_sublink( sublink_16, url_sublink_16 );
set_sublink( sublink_17, url_sublink_17 );
set_sublink( sublink_18, url_sublink_18 );

//subroutines
function set_sublink( sublinkObject:Object, sublinkURL ):void {
sublinkObject.addEventListener( MouseEvent.CLICK, click_sublink );
sublinkObject.addEventListener( MouseEvent.MOUSE_OVER, mouse_over_sublink );
sublinkObject.addEventListener( MouseEvent.MOUSE_OUT, mouse_out_sublink );

function click_sublink( evt:MouseEvent):void {
navigateToURL( sublinkURL, '_blank' );
}

function mouse_over_sublink( evt:MouseEvent ):void {
sublinkObject.mouseChildren = false;
sublinkObject.buttonMode = true;
sublinkObject.useHandCursor = true;

sublinkObject.gotoAndStop( 'On' );
}

function mouse_out_sublink( evt:MouseEvent ):void {
sublinkObject.gotoAndStop( 'Off' );
}
}
 

Back
Top