Results 481 to 495 of 663
Thread: ActionScript 3 Tip of the Day
-
February 19th, 2008, 10:40 AM #4813Registered User
posts
resolved!
Hi,
i finally get this code solved!
i also attach the script here.Code:package { import flash.net.URLRequest; import flash.net.URLLoader; import flash.events.*; public class loadXML extends EventDispatcher { public var url:String ; public var myXML:XML; public var total:Number; private var myLoader:URLLoader; private var dataWritten:Event; public function loadXML(url) { var u = url; var rssXMLURL:URLRequest = new URLRequest(u); myLoader = new URLLoader(rssXMLURL); myLoader.addEventListener("complete", xmlLoaded); } public function xmlLoaded(evtObj:Event):void { var i = 0; var TITLES = []; var COPYS = []; var LINKS = []; myXML = XML(myLoader.data); var outXML:XMLList = new XMLList(); total = myXML.children().length(); trace("as: " + total ); for (i=0; i<total; i++) { TITLES[i] = myXML.children().TITLE.children()[i]; COPYS[i] = myXML.children().COPY.children()[i]; LINKS[i] = myXML.children().LINK.children()[i]; } //this.total = total; //setTotal(total); this.sayHello(); dataWritten = new Event("dataWritten", true); dispatchEvent(dataWritten); } public function sayHello():void { trace(total + " says hello!"); } } }
thanks for helping me out!
-
February 23rd, 2008, 01:18 AM #482
in regards to replacing the global space, what do you think about using a singleton rather than a class filled with static properties/methods?
i remember singletons being pushed. perhaps it was a professor...
actually the only real benefit i can remember is that if one wants to turn a singleton class into a normally instantiated class, it's not as much refactoring...
-
February 29th, 2008, 06:13 PM #4834Registered User
poststype coercion still failed
So I've overridden the clone method for my custom event and it still didn't work. Maybe because the event is dispatched from a loaded swf? If my event handler expects a normal event it won't cause an error (handleEvent(e:Event)), but if the event handler expects a custom event (handleEvent(e:CustomEvent) it will give a type coercion error. I have no idea why but i think it's because it's in a loaded swf. If the event handler is in the same swf where the event was dispatched i can handle the custom event. Anyone have any ideas?
-
February 29th, 2008, 06:14 PM #4844Registered User
postsdamn. wrong thread.
-
March 3rd, 2008, 01:43 PM #485
maybe string distinguishing events is the same as native one
-
March 7th, 2008, 02:44 AM #4861Registered User
postsLOL
LOL
WBR,
Alex
-
March 7th, 2008, 05:45 PM #4873Registered User
postsTextField Problem
Hello, I need some help, im trying to drag and rotate a textfield in AS 3.0, Can its possible?, Im so new in this . Thanks!!!
-
March 10th, 2008, 09:25 AM #488
to rotate a textField u must embed font displayed in it
-
March 10th, 2008, 03:11 PM #4893Registered User
postsI need input text in it and drag to rotate , but doesnt work , I need put that into moviveclip? or exist other way?
Thanks!!!
-
March 10th, 2008, 05:14 PM #490
U don't have to use another MovieClip to rotate (texField extends DisplayObject), but to use startDrag() method u could put it inside a Sprite or just change its x and y values on MouseMove Event
-
March 14th, 2008, 02:18 PM #49110Registered User
postsWhat about the actual URL?
Thanks for the great info on pulling variables into flash in the URL format. I'm a little confused though. Say you wanted to pull the variables from the very URL of the page that loaded the flash document, not an outside file. How would you pull them from that?
Thanks,
Aaron
-
March 18th, 2008, 03:28 PM #4921Registered User
posts
Thanks.....!!
very good idea....
-
March 20th, 2008, 11:40 AM #4932Registered User
postsI'm new to AS3
Hello everyone, I'm a new member to this site and new in Actionscript 3 as well. I was wondring if anyone could give me an advise on where to start from because i do not have any knowledge on AS3.
Thanks
ryan
-
March 22nd, 2008, 05:13 AM #49497Registered User
postsSpam attack! Moderator - delete this post also when you delete the spam.
-
March 25th, 2008, 04:08 PM #4953Registered User
postsHi senocular,
my issue is related with XML in AS3. i m currently working on xmlsocket connection with AS3. but just to make my question simple, i want to create an XML with AS3 which should not have been foramted with linesapces. like if u trace an XML in AS3 it will be like this:
[
<mainNode>
<childNode>
<otherchildNode />
</childNode>
</mainNode>
]
But i want this XML showing no line spaces like this:
<mainNode><childNode><otherchildNode /></childNode></mainNode>
How is it Possible ?


Reply With Quote

Bookmarks