Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 05-20-2012, 09:38 AM   #1
ahanslot
Registered User
 
Join Date: Jan 2010
Posts: 37
Default Write a new function that takes 2 arguments

I have this question any help

c) Write a new function called 'getFullName2()' which takes two arguments (firstName and lastName) and replace the code below. Explain the difference.

Code:
var firstName:String = new String("Tom");
var lastName:String = new String("Smith");

function getFullName():String{

var fullName:String = firstName + " " + lastName;

return fullName;

}

var fullName:String = getFullName();
trace("name is: ",fullName);


thanks
ahanslot is offline   Reply With Quote
Old 05-20-2012, 11:45 AM   #2
arkitx
Senior Member
 
Join Date: Jan 2011
Posts: 703
Default

ActionScript Code:
var firstName:String = new String("Tom"); var lastName:String = new String("Smith"); function getFullName(fName:String,lName:String):String{ var fullName:String = fName + " " + lName; return fullName; } var fullName:String = getFullName(firstName,lastName); trace("name is: ",fullName);



__________________
Regards

arkitx
arkitx is offline   Reply With Quote
Old 05-20-2012, 11:52 AM   #3
ahanslot
Registered User
 
Join Date: Jan 2010
Posts: 37
Default

thanks


Quote:
Originally Posted by arkitx View Post
ActionScript Code:
var firstName:String = new String("Tom"); var lastName:String = new String("Smith"); function getFullName(fName:String,lName:String):String{ var fullName:String = fName + " " + lName; return fullName; } var fullName:String = getFullName(firstName,lastName); trace("name is: ",fullName);



ahanslot is offline   Reply With Quote
Old 05-20-2012, 08:27 PM   #4
henke37
Senior Member
 
henke37's Avatar
 
Join Date: Mar 2009
Location: Sweden
Posts: 10,861
Send a message via Skype™ to henke37
Default

That sure looks like homework. Very trivial homework that none the less manages to over complicate things.
__________________
Signature: I wrote a pair of articles about the timeline.
henke37 is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:21 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.