Re: [Flashcoders] RE: retreieving a node that contains a specific attribute from an XML list
You can pick nodes by adding a comparison into your XML path Conteudo.(@id == link) will give you the correct node too Sent from my iPhone On 13 Sep 2009, at 22:09, Isaac Alves isaacal...@gmail.com wrote: Hi, thank you all. I've managed to do it like this, based on what Cor wrote me: function clickItemTitle(e:Event):void { _link = String(e.target.frameLink); var node:int; for (var i:Number = 0; i conteudo.length(); i++) { if (conteudo[...@id == _link) { node = i; } } trace (node: + node); then I just use conteudo[node] to access the content. I was trying to do that without using a for loop , but maybe it wouldn't be possible. anyway I believe there's no need to avoid a loop here, even if there's 1200 nodes in my XML, right? Allandt, I actually didn't understand the use of toXMLString(), at least in this situation.. cheers! isaac -- Message: 5 Date: Sun, 13 Sep 2009 12:44:10 +0100 From: allandt bik-elliott alla...@gmail.com Subject: Re: [Flashcoders] retreieving a node that contains a specific attribute from an XML list. To: Flash Coders List flashcoders@chattyfig.figleaf.com Message-ID: 51f4e795-f48c-4c62-8ffd-586daafb1...@gmail.com Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes also if you're tracing xml, you could try trace(myXML.toXMLString()); which will make sure that even the root node of the xml is traced a On 13 Sep 2009, at 06:39, Cor wrote: Try this: trace (conteudo.slide[...@id); trace (conteudo.slide[...@id); trace (conteudo.slide[0].tit); -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Isaac Alves Sent: zondag 13 september 2009 2:00 To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] retreieving a node that contains a specific attribute from an XML list. I have an XMLList and I would like to retrieve a node in this list that contain a specfic attribute. here is how my XMLlist conteudo is organized. trace (conteudo) throws: slide id=apresentacao titApresentação/tit txt (lots of text...)/txt /slide slide id=sumario titApresentação/tit txt (lots of text...)/txt /slide etc... I've tried the following ways: //gets all nodes that contain the attribue id. that is , the same as trace(conteudo), cause every node contain an // id attribute. i don't need them all to contain the attribute, but i've made so, trying to avoid errors. so there a lot of // nodes in which the id attribute is equal to . //trace (conteudo.(hasOwnProperty(@id)); //this one doesn't throws an error, but doesn't retrieve anything //trace (conteudo.(hasOwnProperty(@id == apresentacao))); //throws the error: ReferenceError: Error #1065: A variá vel apresentacao não foi definida. (variable not defined) //trace (conteudo.(hasOwnProperty(@id == apresentacao))); // same reference error... //trace (conteudo.(hasOwnProperty(@id == apresentacao))); // why it doesn't work like this? same reference errpr //trace (node i want: + conteudo.(@id == apresentacao)); // this one doesn't throws an error, but doesn't retrieve anything //trace (vamo ve: + conteudo.(@id == apresentacao)); //throws all the attributes @id that exist inside the xmllist, concatenated //trace ( + conteu...@id); //again, here it throws all the attributes @id that exist inside the xmllist , concatenated //if (conteudo.(hasOwnProperty(@id == apresentacao))) //{ //trace (tem o id: ); //trace (conteu...@id); //} help please!! ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Re: time based smooth animation w/ GTween. HELP!
Hey Isaac. What exactly are you trying to accomplish with the renderTime(10)? Your example tween was only 1 second long, so where does the 10 come from? If you want to skip to a certain time in a TweenMax tween, make sure you're using the latest v11 (http://blog.greensock.com/v11beta/) and just set the currentTime property like myTween.currentTime = 10 would make it go to the 10-second point. Or use the currentProgress property (always between 0 and 1 where 0.5 is halfway finished) like myTween.currentProgress = 0.5. Dont use renderTime() - use the currentTime, currentProgress, totalTime, or totalProgress getters/setters. The convenience of these getters/setters is that they can easily be tweened for advanced effects. And there's an easier way to accomplish your repeatReverse() functionality. Just use the yoyo and repeat features like: var plantaTween:TweenMax = new TweenMax(planta, 1, {y:414, repeat:1, yoyo:true, ease:Sine.easeInOut}); That'll repeat it once and since yoyo is true, it'll play forward the first time through and backwards the second time through. Full ASDoc documentation is at http://www.greensock.com/as/docs/tween/ Again, make sure you've got v11: http://blog.greensock.com/v11beta/. Feel free to use the forums at http://forums.greensock.com for these types of questions. I try to be pretty active in responding there. Jack PS For the record, TweenLite/Max does NOT use a Timer to drive updates. It's ENTER_FRAME driven which is generally optimal for many reasons (I won't bore you with an explanation here). You can have any tween base its timing on frames instead of time if you prefer (new in v11) by setting useFrames:true. -Original Message- From: Isaac Alves [mailto:isaacal...@gmail.com] Sent: Monday, September 14, 2009 9:04 AM To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] Re: time based smooth animation w/ GTween. HELP! Hey Joel, so, I´m giving a try with TweenMax. as far as I understood, tweenmax´s default timing mode is set to time based , not frame. how can I change then the renderTime? I-ve tried to do so but no success. var plantaTween:TweenMax = new TweenMax(planta, 1, {y:414, onComplete: repeatReverse, immediateRender:true, ease:Sine.easeInOut}); // TweenMax.renderTime(10); // this doesn´t work, how should I set it ? function repeatReverse():void { plantaTween.reverse(); } thanks! -- Grant has now merged forces with Jack Doyle, author of TweenLite, TweenMax and TweenGroup. The syntax is almost identical and I think you'll have an easier time achieving the effect you want. A tweens pulse can be updated via a setInterval, use of a Timer object, based on the milliseconds a flash movie has been running (getTime) or Enter_Frame events. Enter_Frame has proven to be the most reliable but due to differences in computer speed and network conditions none of them are bullet proof. TweenLite, I believe uses a combination of enter_frame and a Timer where the pulse is updated via enter_frame and the Timer object is then used to determine exactly which frame of the tween is to be rendered. This means if for some reason the flash movie lags, you may see a jump in animation in order to complete in the time you've allotted. You do not have to specify this when using TweenLite but keep in mind your movies framerate, the distance of the tween and the amount of time you are allowing for the tween to finish all factor in to the smoothness of playback. On Fri, Sep 11, 2009 at 10:48 AM, Isaac Alves isaacal...@gmail.com wrote: Hello! I would like to create a time based and very smooth animation with GTween (or another one). But I´m used to GTween , though. here is my code: var plantaTween = new GTween(planta, 1.5, {y: 414}, {delay: 0.8, reversed: true, reflect: true, repeat: 999, ease:Quartic.easeInOut}); I´ve read the following examples in Gtween´s documentation and somewhere else but i can-t quite understand it .. GTween.timingMode = GTween.TIME; at http://www.gskinner.com/blog/archives/2008/08/gtween_a_new_tw.html should I use: plantaTween.timingMode = GTween.TIME; or: GTween.timingMode = GTween.TIME; ? What does the latter exactly means? it doesn´t do nothing. maybe cause the default timeInterval property is 25ms. how do i set it ? the first one throws a reference error Error #1056: and i-ve seen this also at the documentation http://www.gskinner.com/libraries/gtween/docs/ Implementation public static function get timeInterval():uint public function set timeInterval(value:uint):void Implementation public static function get timingMode():String public function set timingMode(value:String):void but cannot figure out how to implement it... help ! thanks ! ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com
Re: [Flashcoders] Loading local files with query strings
Don't use query strings? Seriously - local file names on files systems don't take query strings. You don't have any files called C:\windows\test.exe?id=33, do you? To make a query string work, you need to route the call through an HTTP server. Sounds like you're trying to avoid caching? But I'm not clear why you'd want to avoid caching a local, non-dynamic file... Ian On Mon, Sep 14, 2009 at 7:16 PM, Álvaro Saraiva alv...@glups.pt wrote: Hi everyone, I have a strange problem loading external assets from local files with Loader() Class in AS3. If i use query string in the file name, the asset don't loads. This code doesnt load the swf file inside a class this.mySWFLoader = new Loader(); this.mySWFLoader.contentLoaderInfo.addEventListener(Event.INIT, displaySwfContainer ); this.mySWFLoader.load(new URLRequest(my_swf.swf?id=33)); if i dont use the '?id=33' it works. Any suggestions? Thanxs in advance, Álvaro ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] Loading local files with query strings
Hi everyone, I have a strange problem loading external assets from local files with Loader() Class in AS3. If i use query string in the file name, the asset don't loads. This code doesnt load the swf file inside a class this.mySWFLoader = new Loader(); this.mySWFLoader.contentLoaderInfo.addEventListener(Event.INIT, displaySwfContainer ); this.mySWFLoader.load(new URLRequest(my_swf.swf?id=33)); if i dont use the '?id=33' it works. Any suggestions? Thanxs in advance, Álvaro ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Loading local files with query strings
___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Loading local files with query strings
Appending arguments to the end of a swf file acts the same as setting FlashVars. So, I take it you are trying to pass an id to the loaded in sub swf? Another way to go about it would be to wait until it loads, and then access the contents of the subloaded swf and set variables that way. Or you can just use a static var like MyApp.varName = value; and then the subloaded swf can check for MyApp.varName - Taka On Mon, Sep 14, 2009 at 11:48 AM, Ian Thomas i...@eirias.net wrote: Don't use query strings? Seriously - local file names on files systems don't take query strings. You don't have any files called C:\windows\test.exe?id=33, do you? To make a query string work, you need to route the call through an HTTP server. Sounds like you're trying to avoid caching? But I'm not clear why you'd want to avoid caching a local, non-dynamic file... Ian On Mon, Sep 14, 2009 at 7:16 PM, Álvaro Saraiva alv...@glups.pt wrote: Hi everyone, I have a strange problem loading external assets from local files with Loader() Class in AS3. If i use query string in the file name, the asset don't loads. This code doesnt load the swf file inside a class this.mySWFLoader = new Loader(); this.mySWFLoader.contentLoaderInfo.addEventListener(Event.INIT, displaySwfContainer ); this.mySWFLoader.load(new URLRequest(my_swf.swf?id=33)); if i dont use the '?id=33' it works. Any suggestions? Thanxs in advance, Álvaro ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Loading local files with query strings
___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Loading local files with query strings
Hi, But the loaded swf its in AS2, so the swfLoader file cant access the variables in swfLoaded file and vice-versa, right? Álvaro Taka Kojima escreveu: Appending arguments to the end of a swf file acts the same as setting FlashVars. So, I take it you are trying to pass an id to the loaded in sub swf? Another way to go about it would be to wait until it loads, and then access the contents of the subloaded swf and set variables that way. Or you can just use a static var like MyApp.varName = value; and then the subloaded swf can check for MyApp.varName - Taka On Mon, Sep 14, 2009 at 11:48 AM, Ian Thomas i...@eirias.net wrote: Don't use query strings? Seriously - local file names on files systems don't take query strings. You don't have any files called C:\windows\test.exe?id=33, do you? To make a query string work, you need to route the call through an HTTP server. Sounds like you're trying to avoid caching? But I'm not clear why you'd want to avoid caching a local, non-dynamic file... Ian On Mon, Sep 14, 2009 at 7:16 PM, Álvaro Saraiva alv...@glups.pt wrote: Hi everyone, I have a strange problem loading external assets from local files with Loader() Class in AS3. If i use query string in the file name, the asset don't loads. This code doesnt load the swf file inside a class this.mySWFLoader = new Loader(); this.mySWFLoader.contentLoaderInfo.addEventListener(Event.INIT, displaySwfContainer ); this.mySWFLoader.load(new URLRequest(my_swf.swf?id=33)); if i dont use the '?id=33' it works. Any suggestions? Thanxs in advance, Álvaro ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Loading local files with query strings
Hi Ian, The reason i'm using query strings it's because the same swf must to respond in different manners according the parameters passed. I'm catching the paramenters in loaded swf (its in AS2 :() via _root. But the same approach in flex works, but with flash IDE dont. Is tehre any way to pass the variables to AS2 swf in the call, besides localConnection for example? Thanxs, Álvaro Ian Thomas escreveu: Don't use query strings? Seriously - local file names on files systems don't take query strings. You don't have any files called C:\windows\test.exe?id=33, do you? To make a query string work, you need to route the call through an HTTP server. Sounds like you're trying to avoid caching? But I'm not clear why you'd want to avoid caching a local, non-dynamic file... Ian On Mon, Sep 14, 2009 at 7:16 PM, Álvaro Saraiva alv...@glups.pt wrote: Hi everyone, I have a strange problem loading external assets from local files with Loader() Class in AS3. If i use query string in the file name, the asset don't loads. This code doesnt load the swf file inside a class this.mySWFLoader = new Loader(); this.mySWFLoader.contentLoaderInfo.addEventListener(Event.INIT, displaySwfContainer ); this.mySWFLoader.load(new URLRequest(my_swf.swf?id=33)); if i dont use the '?id=33' it works. Any suggestions? Thanxs in advance, Álvaro ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Loading local files with query strings
Hi Ian, The reason i'm using query strings it's because the same swf must to respond in different manners according the parameters passed. I'm catching the paramenters in loaded swf (its in AS2 :() via _root. But the same approach in flex works, but with flash IDE dont. Is tehre any way to pass the variables to AS2 swf in the call, besides localConnection for example? Thanxs, Álvaro Ian Thomas escreveu: Don't use query strings? Seriously - local file names on files systems don't take query strings. You don't have any files called C:\windows\test.exe?id=33, do you? To make a query string work, you need to route the call through an HTTP server. Sounds like you're trying to avoid caching? But I'm not clear why you'd want to avoid caching a local, non-dynamic file... Ian On Mon, Sep 14, 2009 at 7:16 PM, Álvaro Saraiva alv...@glups.pt wrote: Hi everyone, I have a strange problem loading external assets from local files with Loader() Class in AS3. If i use query string in the file name, the asset don't loads. This code doesnt load the swf file inside a class this.mySWFLoader = new Loader(); this.mySWFLoader.contentLoaderInfo.addEventListener(Event.INIT, displaySwfContainer ); this.mySWFLoader.load(new URLRequest(my_swf.swf?id=33)); if i dont use the '?id=33' it works. Any suggestions? Thanxs in advance, Álvaro ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Loading local files with query strings
Hi, But the loaded swf its in AS2, so the swfLoader file cant access the variables in swfLoaded file and vice-versa, right? Álvaro Taka Kojima escreveu: Appending arguments to the end of a swf file acts the same as setting FlashVars. So, I take it you are trying to pass an id to the loaded in sub swf? Another way to go about it would be to wait until it loads, and then access the contents of the subloaded swf and set variables that way. Or you can just use a static var like MyApp.varName = value; and then the subloaded swf can check for MyApp.varName - Taka On Mon, Sep 14, 2009 at 11:48 AM, Ian Thomas i...@eirias.net wrote: Don't use query strings? Seriously - local file names on files systems don't take query strings. You don't have any files called C:\windows\test.exe?id=33, do you? To make a query string work, you need to route the call through an HTTP server. Sounds like you're trying to avoid caching? But I'm not clear why you'd want to avoid caching a local, non-dynamic file... Ian On Mon, Sep 14, 2009 at 7:16 PM, Álvaro Saraiva alv...@glups.pt wrote: Hi everyone, I have a strange problem loading external assets from local files with Loader() Class in AS3. If i use query string in the file name, the asset don't loads. This code doesnt load the swf file inside a class this.mySWFLoader = new Loader(); this.mySWFLoader.contentLoaderInfo.addEventListener(Event.INIT, displaySwfContainer ); this.mySWFLoader.load(new URLRequest(my_swf.swf?id=33)); if i dont use the '?id=33' it works. Any suggestions? Thanxs in advance, Álvaro ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Loading local files with query strings
how about just escaping the ? symbol # 063; On Mon, Sep 14, 2009 at 11:49 AM, Álvaro Saraiva alv...@glups.pt wrote: Hi Ian, The reason i'm using query strings it's because the same swf must to respond in different manners according the parameters passed. I'm catching the paramenters in loaded swf (its in AS2 :() via _root. But the same approach in flex works, but with flash IDE dont. Is tehre any way to pass the variables to AS2 swf in the call, besides localConnection for example? Thanxs, Álvaro Ian Thomas escreveu: Don't use query strings? Seriously - local file names on files systems don't take query strings. You don't have any files called C:\windows\test.exe?id=33, do you? To make a query string work, you need to route the call through an HTTP server. Sounds like you're trying to avoid caching? But I'm not clear why you'd want to avoid caching a local, non-dynamic file... Ian On Mon, Sep 14, 2009 at 7:16 PM, Álvaro Saraiva alv...@glups.pt wrote: Hi everyone, I have a strange problem loading external assets from local files with Loader() Class in AS3. If i use query string in the file name, the asset don't loads. This code doesnt load the swf file inside a class this.mySWFLoader = new Loader(); this.mySWFLoader.contentLoaderInfo.addEventListener(Event.INIT, displaySwfContainer ); this.mySWFLoader.load(new URLRequest(my_swf.swf?id=33)); if i dont use the '?id=33' it works. Any suggestions? Thanxs in advance, Álvaro ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] closures
I was wondering if anyone here uses closures in AS3? I like them a ton; yet, I am wondering if they are ever used in a real world development projects in AS3? Can you see an excuse for using them? I know it does make somethings easier to port to and from JS if coded right. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders