View Full Version : call back functions?????
flashsavvy
March 29th, 2005, 11:46 PM
hi
can anybody tell me what is a callbakc function and how it works and where it is used.
thanks
flashsavvy
fRedline
March 30th, 2005, 07:49 AM
Callback functions allow us to centralize all of our code in a keyframe.
The old way to respond to events was to attach actions directly to an instance:
on(press) {this._x=100;}
Now, (with callback functions) you refer to an instance from the keyframe and respond to any event:
myButton.onPress=function(){this._x=100;}
or:
instanceName.eventName=someFunction
Now you won't have to click on all of your instances to find the piece of code you want to edit. You just click on the keyframe that holds all of your code and edit it there. More upfront planning but way easier debugging and modification.
Callback functions can be added to any object that can be referred to with an instance name.
Hope that helps, I'm trying to give some back to the Kirupa forums.
A7RSTR7K3
March 30th, 2005, 07:50 AM
LOL was about to explain it myself... thnx redline
flashsavvy
March 31st, 2005, 03:38 AM
HI
Thanx.... Redline..
I hav one more question....can i include html tags in XML files..i mean i want to have a some text in an XML node which wil have a <a href> tag to apply a link to that text..Is it possible...if yes..how?
flashsavvy
scotty
March 31st, 2005, 03:47 AM
Check this tutorial
http://www.kirupa.com/web/xml/XMLbasics6.htm
scotty(-:
flashsavvy
April 1st, 2005, 06:27 AM
Hi Scotty !
Thanks 4 d help...but can u provide me an example in which html content is fetched from xml and a link in it
flashsavvy
scotty
April 1st, 2005, 07:48 AM
In your xml put
<caption><![CDATA[<a href="http://www.kirupa.com"><u>Kresge</u></a>]]></caption>
in flash enable the text field for html, lest say you want to show the value of myArray[i]
your_txtfield.html =true;
your_txtfield.htmlText =myArray[i];
will show as Kresge and link to kirupa.com:)
scotty(-:
flashsavvy
April 4th, 2005, 04:38 AM
Thanx Scotty...hope to c u soon
scotty
April 4th, 2005, 05:21 AM
you're welcome=)
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.