Re: [Flashcoders] simple load vars function - why doesn't this work?
Thanks Zeh - much appreciated. Best, Mike D . Mike Dunlop // Droplab [ e ] [EMAIL PROTECTED] On Dec 28, 2006, at 7:49 PM, Zeh Fernando wrote: Mike Dunlop wrote: function loadMyVars(url,type) { (...) } This always returns false You are creating events and expecting them to run at the same time; they won't. They're just skipped and it goes straight to "return false" after creating them. When creating your onLoads, you're just telling what code should be run *when* the onLoad occur, not running it. For your code to work, it would have to halt all code execution on flash until onLoad runs for the return to work they way you expect it to. Either way, "return" inside of onLoad would also return from the onLoad, not from your function. So it would never work one way or the other. So you can't have a function try to load something and reply with results. They're asynchronous; you'd have a function that does the call and goes back with no result at all, then something else that handles results accordingly. That's why there are events. Also, use "var xml = (...)" when creating your xml object (the same way you did with LoadVars) or else you'll have scope issues in the future. Zeh ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] AS to convert bitmap -> vector?
On 12/28/06, Matthew Pease <[EMAIL PROTECTED]> wrote: Anyone know of a tool to convert a bitmap -> vector on the command line in linux? I think nowadays it's getting more difficult to say "you can't do X with AS" -- since you can read colour values of pixels, you could of course write your own vector tracing code... :) Anyway, there are and . The latter can export SWFs. HTH, Mark ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] simple load vars function - why doesn't this work?
Mike Dunlop wrote: function loadMyVars(url,type) { (...) } This always returns false You are creating events and expecting them to run at the same time; they won't. They're just skipped and it goes straight to "return false" after creating them. When creating your onLoads, you're just telling what code should be run *when* the onLoad occur, not running it. For your code to work, it would have to halt all code execution on flash until onLoad runs for the return to work they way you expect it to. Either way, "return" inside of onLoad would also return from the onLoad, not from your function. So it would never work one way or the other. So you can't have a function try to load something and reply with results. They're asynchronous; you'd have a function that does the call and goes back with no result at all, then something else that handles results accordingly. That's why there are events. Also, use "var xml = (...)" when creating your xml object (the same way you did with LoadVars) or else you'll have scope issues in the future. Zeh ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
[Flashcoders] simple load vars function - why doesn't this work?
function loadMyVars(url,type) { if(type == "xml") { xml = new XML(); xml.ignoreWhite = true; xml.load(url); xml.onLoad = function(success) { if(success) return this; else return false; } } else { var mvar:LoadVars = new LoadVars(); mvar.onLoad = function (success) { if(success) return this; else return false; } mvar.load(url); } return false; } This always returns false . Mike Dunlop // Droplab [ e ] [EMAIL PROTECTED] ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Multidimensional Object/Array Question
Awesome Ron -- Thanks much!! Best, Mike D . Mike Dunlop // Droplab [ e ] [EMAIL PROTECTED] On Dec 28, 2006, at 2:04 PM, Ron Wheeler wrote: Why would you not put this into an object and make your life simple? The list object has a single property - an array of cats. (list probably should be called cats but that is just a naming thing.) Each cat object seems to have a name property and a note property and an array of medium objects. The medium seems to have 3 properties. You can build a constructor for each of list, cat and medium that takes an XML sub-tree as an argument and parses its incoming tree to create itself. This way no one has to know anything about the XML tree of its parents or children and parsing at each level gets pretty simple. Each class can use cloneNode to get the subtree to pass to the child's constructor once it has found out what kind of node was in the tree that was passed in to the class's level. We do this a lot and it works really well as things change. You only have to fix the constructor of the object and do not have to go searching for the guy who is doing the parsing if, for example, you add a date to the cat. Just fix the constructor for the cat and add a getter for the date. All your modifications are in one class except for where date is used but the object wanting the cat's date info already has the cat object, most of the time, so just has to write dateout=mycatinstance.getdate(); to get the new field. Turning XML into arrays is going to be harder to write and much harder to maintain. You might simplify the XML by removing single values from nodes to attributes. This makes it easier to parse since the only nodes are sub-trees and attributes are easier to parse. It also makes your XML smaller. Ron Mike Dunlop wrote: Hi gang, I'm having difficulty parsing an xml file into a multidimensional array and was wondering if anyone could see why the following isn't working... My guess is that an object variable can't be an array? XML Sample - - Art Glass Drypoint media/18_medium_tn.jpg - - Actionscript - - var arr:Array = xml.firstChild.childNodes; for(var i:Number = 0; i < arr.length; i++) { var item:Object = new Object(); item.id = arr[i].attributes.id; item.name = arr[i].firstChild.firstChild.nodeValue; item.notes = arr [i].firstChild.nextSibling.firstChild.nodeValue; /* this part isn't working ***/ item.mediums = new Array(); if(arr[i].firstChild.nextSibling.nextSibling.hasChildNodes ()) { var m:Array = arr [i].firstChild.nextSibling.nextSibling.childNodes; for(var i_m:Number = 0; i_m < m.length; i_m++) { item.mediums[item.mediums.length]['id'] = m [i_m].attributes.id; item.mediums[item.mediums.length]['name'] = m [i_m].firstChild.firstChild.nodeValue; item.mediums[item.mediums.length]['notes'] = m [i_m].firstChild.nextSibling.firstChild.nodeValue; item.mediums[item.mediums.length]['img'] = m [i_m].firstChild.nextSibling.nextSibling.firstChild.nodeValue; } } /* /this part isn't working ***/ } - - Thanks for your help guys! Best, Mike D ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Multidimensional Object/Array Question
Yeah, i don't touch AS2's xml api any more than I have to. I know there are other systems out there, but I find XPath does the job for me about 100% of the time. Here's a little tute I threw together for XPath: http://criticalpile.com/blog/?p=4 -Scott On 12/28/06, Mike Dunlop <[EMAIL PROTECTED]> wrote: Thanks for the input Scott! I simply trying to find the easiest way to dump a 2D xml structure into an array/object that can be easily iterated through in a loop. Do you think there is a better way than what i am trying to do? I'm an experienced php/sql developer but still learning the ropes in AS 2.0 Your thoughts are much appreciated. Happy New Year. - Mike D . Mike Dunlop // Droplab [ e ] [EMAIL PROTECTED] On Dec 28, 2006, at 1:49 PM, slangeberg wrote: >> >> item.mediums = new Array(); >> > > Should be fine, however: > > item.mediums[item.mediums.length]['id'] = m[i_m].attributes.id; > > > Looks like you're trying to access a 2D array or Object in array, > so you > would have to do something like: > > var medium:Object = new Object(); > medium.id = m[i_m].attributes.id; > medium.name = m[i_m].firstChild.firstChild.nodeValue; > . > . > item.mediums.push( medium ); > > This doesn't mean that what you're doing is necessarily a best > practice, but > I'm not sure what your motivation is to do so. If you simply want > to access > xml as a more manageable data object, you can use things like XPath or > Xml2Object(?). > > -Scott > > On 12/28/06, Mike Dunlop <[EMAIL PROTECTED]> wrote: >> >> Hi gang, >> >> I'm having difficulty parsing an xml file into a multidimensional >> array and was wondering if anyone could see why the following isn't >> working... My guess is that an object variable can't be an array? >> >> >> >> XML Sample >> - >> - >> >> >> >> Art Glass >> >> >> >> Drypoint >> >> media/18_medium_tn.jpg >> >> >> >> >> >> - >> - >> >> >> Actionscript >> - >> - >> >> >> var arr:Array = xml.firstChild.childNodes; >> >> for(var i:Number = 0; i < arr.length; i++) { >> var item:Object = new Object(); >> item.id = arr[i].attributes.id; >> item.name = arr[i].firstChild.firstChild.nodeValue; >> item.notes = >> arr[i].firstChild.nextSibling.firstChild.nodeValue; >> >> /* this part isn't working ***/ >> item.mediums = new Array(); >> if(arr >> [i].firstChild.nextSibling.nextSibling.hasChildNodes()) >> { >> var m:Array = >> arr[i].firstChild.nextSibling.nextSibling.childNodes; >> for(var i_m:Number = 0; i_m < m.length; i_m >> ++) { >> item.mediums[item.mediums.length] >> ['id'] = >> m[i_m].attributes.id; >> item.mediums[item.mediums.length] >> ['name'] >> = m >> [i_m].firstChild.firstChild.nodeValue; >> item.mediums[item.mediums.length] >> ['notes'] >> = m >> [i_m].firstChild.nextSibling.firstChild.nodeValue; >> item.mediums[item.mediums.length] >> ['img'] = >> m >> [i_m].firstChild.nextSibling.nextSibling.firstChild.nodeValue; >> } >> } >> /* /this part isn't working ***/ >> } >> >> - >> - >> >> >> Thanks for your help guys! >> >> Best, >> Mike D >> >> >> ___ >> Flashcoders@chattyfig.figleaf.com >> To change your subscription options or search the archive: >> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders >> >> Brought to you by Fig Leaf Software >> Premier Authorized Adobe Consulting and Training >> http://www.figleaf.com >> http://training.figleaf.com >> > > > > -- > > : : ) Scott > ___ > Flashcoders@chattyfig.figleaf.com > To change your subscription options or search the archive: > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > Brought to you by Fig Leaf Software > Premier Authorized Adobe Consulting and Training > http://www.figleaf.com > http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com
Re: [Flashcoders] Flash adds seconds to audio clip
From your description, it's not clear if the trace output is 32 seconds or 28.1 seconds. But either way, if the sound were being slowed down or sped up that much, you would likely hear a difference in pitch (especially if it's music). Try timing the audio with a stopwatch. I'm guessing it's the trace call that's being delayed due to the sound processing, and that the sound is being played correctly. Marc Hoffman At 12:30 PM 12/28/2006, you wrote: Hello all, When I play a 30 second audio file in Flash (.wav or .mp3), it is taking flash 32 seconds to run it. To test this, I've made it real simple and only used one layer (The frame rate for the audio is 12 fps). The audio starts on the first frame and lasts until the 361st (30 seconds x 12 fps + 1) frame. I've added this code to these frames: var tmp = new Date(); trace("start time: " + tmp.getSeconds()); On the 362nd frame (immediately after the audio has played) I have another key frame with this code: var tmp = new Date(); trace("end time: " + tmp.getSeconds()); That's it. I just output the time when the movie starts and when it stops. When I only use 338 frames (instead of 361), then the whole clips pays fine and lasts 30 seconds. Why is a 30 second clip (running at 12 fps) only taking 28.1 seconds to play? Thank you - Frank ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Multidimensional Object/Array Question
Why would you not put this into an object and make your life simple? The list object has a single property - an array of cats. (list probably should be called cats but that is just a naming thing.) Each cat object seems to have a name property and a note property and an array of medium objects. The medium seems to have 3 properties. You can build a constructor for each of list, cat and medium that takes an XML sub-tree as an argument and parses its incoming tree to create itself. This way no one has to know anything about the XML tree of its parents or children and parsing at each level gets pretty simple. Each class can use cloneNode to get the subtree to pass to the child's constructor once it has found out what kind of node was in the tree that was passed in to the class's level. We do this a lot and it works really well as things change. You only have to fix the constructor of the object and do not have to go searching for the guy who is doing the parsing if, for example, you add a date to the cat. Just fix the constructor for the cat and add a getter for the date. All your modifications are in one class except for where date is used but the object wanting the cat's date info already has the cat object, most of the time, so just has to write dateout=mycatinstance.getdate(); to get the new field. Turning XML into arrays is going to be harder to write and much harder to maintain. You might simplify the XML by removing single values from nodes to attributes. img="media/18_medium_tn.jpg" /> img="media/19_medium_tn.jpg" /> img="media/11_medium_tn.jpg" /> img="media/12_medium_tn.jpg" /> This makes it easier to parse since the only nodes are sub-trees and attributes are easier to parse. It also makes your XML smaller. Ron Mike Dunlop wrote: Hi gang, I'm having difficulty parsing an xml file into a multidimensional array and was wondering if anyone could see why the following isn't working... My guess is that an object variable can't be an array? XML Sample -- Art Glass Drypoint media/18_medium_tn.jpg -- Actionscript -- var arr:Array = xml.firstChild.childNodes; for(var i:Number = 0; i < arr.length; i++) { var item:Object = new Object(); item.id = arr[i].attributes.id; item.name = arr[i].firstChild.firstChild.nodeValue; item.notes = arr[i].firstChild.nextSibling.firstChild.nodeValue; /* this part isn't working ***/ item.mediums = new Array(); if(arr[i].firstChild.nextSibling.nextSibling.hasChildNodes()) { var m:Array = arr[i].firstChild.nextSibling.nextSibling.childNodes; for(var i_m:Number = 0; i_m < m.length; i_m++) { item.mediums[item.mediums.length]['id'] = m[i_m].attributes.id; item.mediums[item.mediums.length]['name'] = m[i_m].firstChild.firstChild.nodeValue; item.mediums[item.mediums.length]['notes'] = m[i_m].firstChild.nextSibling.firstChild.nodeValue; item.mediums[item.mediums.length]['img'] = m[i_m].firstChild.nextSibling.nextSibling.firstChild.nodeValue; } } /* /this part isn't working ***/ } -- Thanks for your help guys! Best, Mike D ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Multidimensional Object/Array Question
Thanks for the input Scott! I simply trying to find the easiest way to dump a 2D xml structure into an array/object that can be easily iterated through in a loop. Do you think there is a better way than what i am trying to do? I'm an experienced php/sql developer but still learning the ropes in AS 2.0 Your thoughts are much appreciated. Happy New Year. - Mike D . Mike Dunlop // Droplab [ e ] [EMAIL PROTECTED] On Dec 28, 2006, at 1:49 PM, slangeberg wrote: item.mediums = new Array(); Should be fine, however: item.mediums[item.mediums.length]['id'] = m[i_m].attributes.id; Looks like you're trying to access a 2D array or Object in array, so you would have to do something like: var medium:Object = new Object(); medium.id = m[i_m].attributes.id; medium.name = m[i_m].firstChild.firstChild.nodeValue; . . item.mediums.push( medium ); This doesn't mean that what you're doing is necessarily a best practice, but I'm not sure what your motivation is to do so. If you simply want to access xml as a more manageable data object, you can use things like XPath or Xml2Object(?). -Scott On 12/28/06, Mike Dunlop <[EMAIL PROTECTED]> wrote: Hi gang, I'm having difficulty parsing an xml file into a multidimensional array and was wondering if anyone could see why the following isn't working... My guess is that an object variable can't be an array? XML Sample - - Art Glass Drypoint media/18_medium_tn.jpg - - Actionscript - - var arr:Array = xml.firstChild.childNodes; for(var i:Number = 0; i < arr.length; i++) { var item:Object = new Object(); item.id = arr[i].attributes.id; item.name = arr[i].firstChild.firstChild.nodeValue; item.notes = arr[i].firstChild.nextSibling.firstChild.nodeValue; /* this part isn't working ***/ item.mediums = new Array(); if(arr [i].firstChild.nextSibling.nextSibling.hasChildNodes()) { var m:Array = arr[i].firstChild.nextSibling.nextSibling.childNodes; for(var i_m:Number = 0; i_m < m.length; i_m ++) { item.mediums[item.mediums.length] ['id'] = m[i_m].attributes.id; item.mediums[item.mediums.length] ['name'] = m [i_m].firstChild.firstChild.nodeValue; item.mediums[item.mediums.length] ['notes'] = m [i_m].firstChild.nextSibling.firstChild.nodeValue; item.mediums[item.mediums.length] ['img'] = m [i_m].firstChild.nextSibling.nextSibling.firstChild.nodeValue; } } /* /this part isn't working ***/ } - - Thanks for your help guys! Best, Mike D ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- : : ) Scott ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Multidimensional Object/Array Question
item.mediums = new Array(); Should be fine, however: item.mediums[item.mediums.length]['id'] = m[i_m].attributes.id; Looks like you're trying to access a 2D array or Object in array, so you would have to do something like: var medium:Object = new Object(); medium.id = m[i_m].attributes.id; medium.name = m[i_m].firstChild.firstChild.nodeValue; . . item.mediums.push( medium ); This doesn't mean that what you're doing is necessarily a best practice, but I'm not sure what your motivation is to do so. If you simply want to access xml as a more manageable data object, you can use things like XPath or Xml2Object(?). -Scott On 12/28/06, Mike Dunlop <[EMAIL PROTECTED]> wrote: Hi gang, I'm having difficulty parsing an xml file into a multidimensional array and was wondering if anyone could see why the following isn't working... My guess is that an object variable can't be an array? XML Sample -- Art Glass Drypoint media/18_medium_tn.jpg -- Actionscript -- var arr:Array = xml.firstChild.childNodes; for(var i:Number = 0; i < arr.length; i++) { var item:Object = new Object(); item.id = arr[i].attributes.id; item.name = arr[i].firstChild.firstChild.nodeValue; item.notes = arr[i].firstChild.nextSibling.firstChild.nodeValue; /* this part isn't working ***/ item.mediums = new Array(); if(arr[i].firstChild.nextSibling.nextSibling.hasChildNodes()) { var m:Array = arr[i].firstChild.nextSibling.nextSibling.childNodes; for(var i_m:Number = 0; i_m < m.length; i_m++) { item.mediums[item.mediums.length]['id'] = m[i_m].attributes.id; item.mediums[item.mediums.length]['name'] = m [i_m].firstChild.firstChild.nodeValue; item.mediums[item.mediums.length]['notes'] = m [i_m].firstChild.nextSibling.firstChild.nodeValue; item.mediums[item.mediums.length]['img'] = m [i_m].firstChild.nextSibling.nextSibling.firstChild.nodeValue; } } /* /this part isn't working ***/ } -- Thanks for your help guys! Best, Mike D ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- : : ) Scott ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
[Flashcoders] Multidimensional Object/Array Question
Hi gang, I'm having difficulty parsing an xml file into a multidimensional array and was wondering if anyone could see why the following isn't working... My guess is that an object variable can't be an array? XML Sample -- Art Glass Drypoint media/18_medium_tn.jpg -- Actionscript -- var arr:Array = xml.firstChild.childNodes; for(var i:Number = 0; i < arr.length; i++) { var item:Object = new Object(); item.id = arr[i].attributes.id; item.name = arr[i].firstChild.firstChild.nodeValue; item.notes = arr[i].firstChild.nextSibling.firstChild.nodeValue; /* this part isn't working ***/ item.mediums = new Array(); if(arr[i].firstChild.nextSibling.nextSibling.hasChildNodes()) { var m:Array = arr[i].firstChild.nextSibling.nextSibling.childNodes; for(var i_m:Number = 0; i_m < m.length; i_m++) { item.mediums[item.mediums.length]['id'] = m[i_m].attributes.id; item.mediums[item.mediums.length]['name'] = m [i_m].firstChild.firstChild.nodeValue; item.mediums[item.mediums.length]['notes'] = m [i_m].firstChild.nextSibling.firstChild.nodeValue; item.mediums[item.mediums.length]['img'] = m [i_m].firstChild.nextSibling.nextSibling.firstChild.nodeValue; } } /* /this part isn't working ***/ } -- Thanks for your help guys! Best, Mike D ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] AS to convert bitmap -> vector?
Anyone know of a tool to convert a bitmap -> vector on the command line in linux? Sorry if that is too off topic. Thanks - Matt On 12/28/06, Grégoire Divaret <[EMAIL PROTECTED]> wrote: With Actionscript you can't convert a bitmap into a verctor graphic. You can only do this in flash with modify>bitmap>trace bitmap so it won't be dynamic... Matthew Pease a écrit : >Hey Flashcoders - > > It struck me that what I'm trying to do could possibly be better >accomplished via first changing the bitmap into a vector graphic. > > I'm wondering, is it possible to convert a bitmap -> a vector >programmatically using Actionscript? > > That way I can convert the image into a vector & then flip that. >The result will look more cartoonish, but that is OK. > > >Thank you- >Matt >___ >Flashcoders@chattyfig.figleaf.com >To change your subscription options or search the archive: >http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > >Brought to you by Fig Leaf Software >Premier Authorized Adobe Consulting and Training >http://www.figleaf.com >http://training.figleaf.com > > > _ Découvrez le blog Eragon sur Windows Live Spaces! http://eragon-heroic-fantasy.spaces.live.com/ ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Flash Game - Post Encrypted Score toserver sidescript
Record the input for the game and transfer it to the server, then simply "play back" the winner to see if they earned it. I've done it, although not for a high scoreboard, and as long as you don't use Math.random() it works fine. If you need a random number generator you'd have to write your own and transfer the seed as well. It's not the easy solution though, that's for sure. On 12/28/06, Ron Wheeler <[EMAIL PROTECTED]> wrote: I still think that more server side logging will stop hackers more effectively than any thing you can do on the client side if you are going to have to give them the client code. Some server side logic will add to the difficulty without increasing your code very much. A small script that takes the game state and return you a token that has to be returned with the next transaction lets you track time or plausible state sequences will be hard to beat without actually playing the game AND getting a high score AND tapping the TCP/IP traffic. If you let them continue to play after you have found them cheating, that will also slow them down. Ron Steve Mathews wrote: > Everyone always underestimates hackers. Everything is hackable, it is > just a matter of time. > > That isn't to say don't bother. You just have to find the right > balance of time and effort vs. security. > > On 12/28/06, JulianG <[EMAIL PROTECTED]> wrote: >> I agree. >> Perhaps it's a good thing that once the game is launched the contest for >> the prize won't last too long. >> So that might reduce the amount of hackers that eventually notice the >> game. >> I hope I'm not under estimating hackers, I guess they could crack the >> game in a few hours anyway. >> >> Thanks for your help! >> JulianG >> >> >> Danny Kodicek wrote: >> > Be aware that once you're allowing for hackers getting into your >> game, just >> > hacking into the server communication is not your only problem: >> they may >> > find ways to cheat the game without touching that code. As a simple >> example: >> > suppose you have a space invaders game with a function >> 'destroyShip', if >> > they invoke this function they might be able to increase the score >> > 'legitimately'. Look into the history of MMORPGs to see the number of >> > ingenious methods hackers have found to cheat their way in (my >> favourite is >> > the story of the rogue carpenters who held characters to ransom by >> building >> > wardrobes around them) >> > >> > Danny >> > >> > __ >> ___ >> Flashcoders@chattyfig.figleaf.com >> To change your subscription options or search the archive: >> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders >> >> Brought to you by Fig Leaf Software >> Premier Authorized Adobe Consulting and Training >> http://www.figleaf.com >> http://training.figleaf.com >> > ___ > Flashcoders@chattyfig.figleaf.com > To change your subscription options or search the archive: > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > Brought to you by Fig Leaf Software > Premier Authorized Adobe Consulting and Training > http://www.figleaf.com > http://training.figleaf.com > > ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Flash on Wii
Hey, good news. The buttons on the Wiimote give out key events. http://wiinintendo.net/2006/12/27/wiimote-d-pad-works-in-javascript-or-flash-games/ On 12/25/06, Max <[EMAIL PROTECTED]> wrote: Any key events? What about right-clicks or mouse scrolling? I'd do it myself but I'm facinated by this and don't have any wireless Internet for a while so I can't test anything. On 12/25/06, Martin Jonasson <[EMAIL PROTECTED]> wrote: > I've also been doing some poking around. It seems it renders the page at > a higher resolution than the one displayed and then scales it down > (since you can zoom), so setting the swf to half the resolution (400x250 > for 4:3) and then zooming in gives a nice performance boost. > > The only real problems I've been having is some trouble getting all > mousedown's to register properly, sometimes it just ignores the clicks, > but zooming in and then out again helps. It might be my code acting up > though. > > Josh Santangelo skrev: > > I did some poking around and discovered the following: > > > > - The user-agent of the Wii browser (US version) is "Opera/9.00 > > (Nintendo Wii; U; ; 1309-9; en)". > > - The Flash Player version on the Wii is "WII 7.0.70.0" > > - You CAN enter a URL directly to a SWF. > > - You CAN add a favorite directly to a SWF, but it won't show a good > > icon in the favorites screen. > > - A SWF's stage at 100% width and height in 16:9 mode (480p) is 1024x500. > > - In 4:3 mode it is 800x500. > > - After messing with the screen mode I was able to get the browser > > into a state where it was reporting the stage size as 700x150. > > Restarting the Wii fixed it. > > - There are no global objects named Controller, Remote, Buttons, Wii, > > Nintendo, or com (looking for things like Mouse and Key). > > - When pressing the A button on the remote, you get a mousedown event > > -- in fact it seems like you get four of them! > > - Releasing the A button does not create a mouseup event. > > - onMouseMove works pretty much as expected. > > - Mouse.hide() does not hide the Wii remote pointer. > > - Clicking on a text input field does bring up the Wii on-screen > > keyboard. > > - I was not able to trap any events from buttons other than A on the > > main remote using mouse or keyboard events -- also tried Nunchuck and > > Classic Controller. > > > > My only tools here are outputting things to a text field and using > > ASSetPropFlags to unhide any potentially-hidden variables. If anyone > > else has other tricks for finding things, I'd be into hearing them, > > but at this point it looks like you can't do anything particularly > > cool with Flash on Wii. > > > > -josh > > > > On Dec 22, 2006, at 9:37a, Josh Santangelo wrote: > > > >> The Wii's "Internet Channel" launched today, which is basically a > >> downloadable version of Opera. Of course the first thing I did after > >> getting it was check out what version of Flash was included. > >> getVersion() returns "WII 7.0.70.0". > >> > >> Kind of lame that it's only Flash 7. It looks like wiicade.com, a > >> site full of Flash games to play on the Wii, was surprised too: > >> http://wiicade.com/ > >> > >> I wonder if there's any kind of hidden API to trap events from the > >> Wii remote control. > > ___ > > Flashcoders@chattyfig.figleaf.com > > To change your subscription options or search the archive: > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > > Brought to you by Fig Leaf Software > > Premier Authorized Adobe Consulting and Training > > http://www.figleaf.com > > http://training.figleaf.com > > > > > > > > ___ > Flashcoders@chattyfig.figleaf.com > To change your subscription options or search the archive: > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > Brought to you by Fig Leaf Software > Premier Authorized Adobe Consulting and Training > http://www.figleaf.com > http://training.figleaf.com > ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
[Flashcoders] help creating a a loader movie clip
Hi, this would be very dumb and easy for the flashcoders but I'm breaking my head with. Look I have a button inside a mask and inside a movie clip, the button have an on release order that creates a loader which loads a movie inside , the problem is that the loader and the movie load inside the movie clip where the button is, do you know a way to create the loader from the button but in the _root. The code I'm using is: on(release){ import mx.controls.Loader; var myLoader:Loader = createClassObject( Loader, "loader",0) myLoader.contentPath="main.swf"; myLoader.setSize(myLoader.content.width, myLoader.content.height); } I'd appreciate your help, I'd know this would be a dumb question for many of you, but I'm worried about it. Regards Gustavo Duenas ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
[Flashcoders] Using ExternalInterface to pop windows up in Firefox
Just solved a troubling issue that I couldn't find information about online. Thought I'd share: We are using ExternalInterface to call a JavaScript function that pops windows up. The JavaScript function looks like this: function popupWindow(href, page, width, height) { // ... typical JavaScript popup code } Then, of course, in ActionScript there's a call like this: ExternalInterface.call("popupWindow", href, id, width, height); Problem is, when called from Firefox, it would kill some (but not all) of the Flash content's functionality. Animations would freeze and most interactive elements would stop working. (Oddly enough, though, buttons with links to external pages, including the button that triggered the popup, still worked. This despite the fact that they weren't simply calling ExternalInterface of getURL, but using a complex, event-driven architecture for page navigation.) One solution, it turns out, is to use setTimeout in the JavaScript: function popupWindow(href, page, width, height) { setTimeout("popupWindow2('" + href + "','" + page + "'," + width + "," + height + ")", 1); } function popupWindow2(href, page, width, height) { // ... typical JavaScript popup code } Now it works fine in both FF and IE. If anyone knows of a more elegant solution (not that this is that bad--I can certainly live with it), please post. -- T. Michael Keesey The Dinosauricon: http://dino.lm.com Parry & Carney: http://parryandcarney.com ISPN Forum: http://www.phylonames.org/forum ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
[Flashcoders] Flash adds seconds to audio clip
Hello all, When I play a 30 second audio file in Flash (.wav or .mp3), it is taking flash 32 seconds to run it. To test this, I've made it real simple and only used one layer (The frame rate for the audio is 12 fps). The audio starts on the first frame and lasts until the 361st (30 seconds x 12 fps + 1) frame. I've added this code to these frames: var tmp = new Date(); trace("start time: " + tmp.getSeconds()); On the 362nd frame (immediately after the audio has played) I have another key frame with this code: var tmp = new Date(); trace("end time: " + tmp.getSeconds()); That's it. I just output the time when the movie starts and when it stops. When I only use 338 frames (instead of 361), then the whole clips pays fine and lasts 30 seconds. Why is a 30 second clip (running at 12 fps) only taking 28.1 seconds to play? Thank you - Frank ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
[Flashcoders] twilight zone: flvPlayback doesn't work if there are too many functions in the fla!
PROBLEMS SOLVED Both problems -- 2nd-video-not-playing and too-many-functions -- were fixed when I upgraded to the new flvPlayback component. Using NetConnection/Netstream also worked, but I'm going to stick with the component for a while. ONE MINOR PROBLEM LEFT When I was using the old version of the component, I set its classes to load in frame 2, because frame 1 was a preloader. For some reason, the new version of the flvPlayback component doesn't work unless I load the classes in frame 1. Which screws up the preloader. The actual component isn't on stage until Frame 2, but I have to load its classes in frame 1. Why? ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] AS to convert bitmap -> vector?
With Actionscript you can't convert a bitmap into a verctor graphic. You can only do this in flash with modify>bitmap>trace bitmap so it won't be dynamic... Matthew Pease a écrit : Hey Flashcoders - It struck me that what I'm trying to do could possibly be better accomplished via first changing the bitmap into a vector graphic. I'm wondering, is it possible to convert a bitmap -> a vector programmatically using Actionscript? That way I can convert the image into a vector & then flip that. The result will look more cartoonish, but that is OK. Thank you- Matt ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com _ Découvrez le blog Eragon sur Windows Live Spaces! http://eragon-heroic-fantasy.spaces.live.com/ ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
[Flashcoders] AS to convert bitmap -> vector?
Hey Flashcoders - It struck me that what I'm trying to do could possibly be better accomplished via first changing the bitmap into a vector graphic. I'm wondering, is it possible to convert a bitmap -> a vector programmatically using Actionscript? That way I can convert the image into a vector & then flip that. The result will look more cartoonish, but that is OK. Thank you- Matt ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] which tool to 3d rotate image?
Thanks to everyone who responded. It seems that if I want to do this I ought to use Sandy, or possibly Paperworks 3d. I had another idea which creates another question. So I'll post that now. Thank you- Matt ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Flash Game - Post Encrypted Score toserver sidescript
I still think that more server side logging will stop hackers more effectively than any thing you can do on the client side if you are going to have to give them the client code. Some server side logic will add to the difficulty without increasing your code very much. A small script that takes the game state and return you a token that has to be returned with the next transaction lets you track time or plausible state sequences will be hard to beat without actually playing the game AND getting a high score AND tapping the TCP/IP traffic. If you let them continue to play after you have found them cheating, that will also slow them down. Ron Steve Mathews wrote: Everyone always underestimates hackers. Everything is hackable, it is just a matter of time. That isn't to say don't bother. You just have to find the right balance of time and effort vs. security. On 12/28/06, JulianG <[EMAIL PROTECTED]> wrote: I agree. Perhaps it's a good thing that once the game is launched the contest for the prize won't last too long. So that might reduce the amount of hackers that eventually notice the game. I hope I'm not under estimating hackers, I guess they could crack the game in a few hours anyway. Thanks for your help! JulianG Danny Kodicek wrote: > Be aware that once you're allowing for hackers getting into your game, just > hacking into the server communication is not your only problem: they may > find ways to cheat the game without touching that code. As a simple example: > suppose you have a space invaders game with a function 'destroyShip', if > they invoke this function they might be able to increase the score > 'legitimately'. Look into the history of MMORPGs to see the number of > ingenious methods hackers have found to cheat their way in (my favourite is > the story of the rogue carpenters who held characters to ransom by building > wardrobes around them) > > Danny > > __ ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
[Flashcoders] twilight zone: flvPlayback doesn't work if there are too many functions in the fla!
Hi. Thanks for the help with my last flvPlayback issue (2nd movie wasn't playing). Now I have a new one, and it's really freaky: the video was playing fine and then all the sudden it stopped playing. It stopped when I added a new function to my code. The weird thing is that the function had NOTHING to do with the component. It was just a function that took in a string, parsed it, and returned a parsed value. I wasn't even calling the function. Just having the function in my code -- without calling it -- stopped the flvPlayback component from working. By the way, everything else worked fine (it's a complex swf that reads in xml, does a bunch of as drawing, etc.) No syntax error. Nothing. Everything works except for the flvPlayback component. And when I comment out the function, the component starts working again. It gets weirder! A co-worker of mine, who doesn't know anything about Flash, suggested that maybe I'd exceeded the number of functions I'm allowed to have in one file. I scoffed at that. The file isn't that long (1200 lines of code -- long, but I've seen longer). But to placate him, I deleted the function and created another one -- a dummy function -- that looks like this function xyz():Void{} and to my shock, it also stopped the player. If I commented it out, the player worked again. I have now done a bunch of tests and have concluded that if I keep the number of functions at exactly what it was before I added my string-processing function, the component works; if I add any more, it doesn't. It doesn't matter what the new functions are named or what they do -- the component doesn't like them. And it's ONLY a problem for the component. Everything else is fine with however many functions I put in the code. So it seems that the component DOES place a limit on the number of functions you can have in your code. WHY? WHAT CAN I DO? I'm thinking of ditching the component altogether and hand-coding a video player. But I don't want to go to all that trouble if it's not going to help! ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Flash Game - Post Encrypted Score toserver sidescript
Everyone always underestimates hackers. Everything is hackable, it is just a matter of time. That isn't to say don't bother. You just have to find the right balance of time and effort vs. security. On 12/28/06, JulianG <[EMAIL PROTECTED]> wrote: I agree. Perhaps it's a good thing that once the game is launched the contest for the prize won't last too long. So that might reduce the amount of hackers that eventually notice the game. I hope I'm not under estimating hackers, I guess they could crack the game in a few hours anyway. Thanks for your help! JulianG Danny Kodicek wrote: > Be aware that once you're allowing for hackers getting into your game, just > hacking into the server communication is not your only problem: they may > find ways to cheat the game without touching that code. As a simple example: > suppose you have a space invaders game with a function 'destroyShip', if > they invoke this function they might be able to increase the score > 'legitimately'. Look into the history of MMORPGs to see the number of > ingenious methods hackers have found to cheat their way in (my favourite is > the story of the rogue carpenters who held characters to ransom by building > wardrobes around them) > > Danny > > __ ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Tweaking Full-Screen Mode in Flash Player 8
Thanks, below is the relavent AS code: function resizeToggle():Void { if(vidSize == 1){ with(vidWrapper){ _x = 72; _y = 38; _width = 600; _height = 440; } vidWrapper.vidDisplayPlate._visible = true; wrapper1._y = 488; wrapper1._x = 70; wrapper1._alpha = 80; //wrapper1.playlistIcon._visible = false; interfaceBackground.gotoAndStop(2); vidSize = 2; }else if(vidSize == 2){ vidWrapper.gotoAndStop(1); with(vidWrapper){ _x = -30; _y = -6; _width = 800; _height = 600; } vidWrapper.vidDisplayPlate._visible = false; vidWrapper.screenMask._visible = true; wrapper1._y = 488; wrapper1._x = 70; wrapper1._alpha = 100; //wrapper1.playlistIcon._visible = false; interfaceBackground.gotoAndStop(2); filmStrip.scrollTracker.scrollButton.gotoAndStop(8); vidSize = 3; //filmstripToLarge(); }else if(vidSize == 3){ playPauseFunction(); getURL("javascript:MakeItSo()"); with(vidWrapper){ _x = -30; _y = -6; _width = 800; _height = 600; interfaceBackground._visible = false; } vidSize = 1; } } and the relevant html/JS: JS function in main html page: function MakeItSo(){ if((detectOS() == 'Windows') && (detectBrowser() == 'IE')) { window.open('vidPlayerFullScreen.html ','LargePorn..Beeotch','fullscreen=yes'); } else { onload=FullScreen(); } code of full screen html page: http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"; width="100%" height="100%" id="vidPlayerAlpha" align="center"> http://www.macromedia.com/go/getflashplayer"; /> ** The full-screen content initializes exactly as the main content does, and with an interface object I'd like to see off during full screen viewing. These are the parameters that need to be passed into full screen mode: with(vidWrapper){ _x = -30; _y = -6; _width = 800; _height = 600; interfaceBackground._visible = false; Again, much obliged for your help. - Kelly ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
RE: [Flashcoders] Q:Simulate HTML anchors in html text
You must have your text specified somewhere in chunks. I usually bring mine in from XML, so it's already fashioned this way. Below I'm using a simplified data structure for the sake of this example. I'm also presuming there is a TextField instance on the Stage identified as "someScrollingTextField" for the example. There are, of course, many ways to customize the basic idea I'm presenting here. var scrollingIndex:Object = new Object(); var textContent:Object = { anchorName01:'fulano de tal', anchorName02:'bujigangas', anchorName03:'blah blah blah', anchorName04:'outro conteudo' }; function createScrollingIndex():Void { for (var propertyName:String in this.textContent) { this.scrollingIndex[propertyName] = this.getLineCount(this.someScrollingTextField, 'text'); this.someScrollingTextField.htmlText += this.textContent[propertyName]; } } // Returns one of two possible things, depending on the "determiner" argument: // 1. Total lines occupied by text within a field (passing a "text" argument, or nothing). // 2. Display height of a field, measured in lines (passing a "field" argument). // Obs: Line count depends on text attributes -- font family, font size, physical font styling, leading, etc. // Obs: It also depends on less common things like embedded images or attaching a UIScrollbar instance. function getLineCount(textArea:TextField, determiner:String):Number { if (textArea instanceof TextField) { var lineCount:Number; var originalScrollPosition:Number; determiner = determiner.toLowerCase() != 'field' ? 'text' : 'field'; originalScrollPosition = textArea.scroll; textArea.scroll = determiner == 'text' ? textArea.maxscroll : 1; lineCount = textArea.bottomScroll; textArea.scroll = originalScrollPosition; return lineCount; } } function showDocumentFragment(anchorName:String):Void { this.someScrollingTextField.scroll = this.scrollingIndex[anchorName]; } this.createScrollingIndex(); this.showDocumentFragment('anchorName03'); - Jason Lutes Allen Communication Learning Services, Inc. Technical Lead, Programming Team Phone: 801.799.7265 Fax: 801.537.7805 E-mail: [EMAIL PROTECTED] > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf > Of vipin chandran > Sent: Friday, December 22, 2006 2:22 PM > To: Flashcoders mailing list > Subject: Re: [Flashcoders] Q:Simulate HTML anchors in html text > > I have also faced same issue, where i wanted to put anchors > in html display > of one of my projects, and i could not do it. > If you can be little more specifics, that will be geat! > ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] which tool to 3d rotate image?
> In that case have you considered just creating a box on the fly > something like this: > > http://www.flashloaded.com/flashcomponents/3dbox/example3.html This looks close. But i'd like to use my own image. Actually, you can use any image that you want with this component. I acutally bought it a year or two ago. It works, but I found the API difficult to work with. In theory it should be able to do *exactly* what you want, but I gave up trying to get it to do what I wanted and the support wasnt very good, other than that they were willing to refund my money, which I guess was in the end good customer service at least. But the point is that all the engineering to do what you want to do is in there. You would just need to have serious patience. Regards, Hank ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] which tool to 3d rotate image?
http://www.roanesky.com/swf/test.html - (done in PV3D) this guy did it 2 different ways, yesterday, he had a building in a city scape clickable. Today he posted a question about this having planes that are clickable. Don't know if that helps, but there you have it ;) On 12/28/06, Zeh Fernando <[EMAIL PROTECTED]> wrote: >> I'm trying to figure out which tool is best to 3d rotate an image on a >> plane. >> Something like this: >> http://karmapop.com/content/cardFlip.swf >> but with a dynamically loaded image on the "front" and another image >> on the "back" with a font superimposed on it. this is going to be a >> postcard. >> this is basically a shape tween, but where an image is being distorted. >> I want the animation to be as smooth as possible, the file size to be >> as small as possible, and keeping it to Flash 7 to allow the most >> people to use it. >> Sandy >> http://www.mosessupposes.com/Fuse/ >> http://hosted.zeh.com.br/mctween/ Fuse, MC Tween, Laco's Tween or any other tween won't "do" the job. They're just tweening engines, so they'd only be used when setting the angle of the thing. Say, from 0 to 360 using different equations. Useful, but to properly *project* the object, to draw the thing, you'd need something else. It's not their job. >> Papervision3d Papervision3d and Sandy will do the job *fine*, but from what I've seen they're meant for Flash 8+ because they use BitmapData to do it. >> Something else? Well, how dependent you are of Flash 7? To do this on Flash8+, you'd use Papervision3d or Sandy. It's probably not very painful. On Flash7, you would need to do the proper 3d transformation *and* all projection. I don't think there's any 'ready-made' engine for that, so basically, you'll need to map and rotate all vectors, then project all triangles using skewing and masks. This is possible, but it's pretty ugly compared to the easier/faster BitmapData fill. A similar technique has been used here: http://www.nkag.co.jp/ You can't see, but each face is made of a bunch of triangles. However, due to the complexity of the masks, you'll see artifacts once in a while, and speed won't be exactly the best. The technique used by most 3d engines today is similar, but they simply fill the data instead of creating movieclips with masks and skewing/scaling them. So all in all, I'd recommend you using Sandy/Papervision3d instead, under Flash 8. 90% of the user penetration seems good enough (specially considering 7 is just a bit more, 95%). Of course, you just scale your object vertically/horizontally... there would be no perspective, but sometimes the simplest/easiest way is enough. And finally, people, please keep this in mind when doing your 3d rotations and face projections and whatnot: http://hosted.zeh.com.br/misc/perspective.png Zeh ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- [ JPG ] ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
RE: [Flashcoders] How to return with loadvars within a function?
> Hi Coders > > I have problem with the following code. I cannot return the > value but i can trace inside the onload. I am mentioning the > dummyXML. Anyone can help would be appricated. > > function mloader(file, toobject) { > encLoad = new LoadVars(); > encLoad.onLoad = function(success) { > xmldata = encLoad.data; > decdata = RC4.decrypt(xmldata, "mykey"); > dummyXML = new XML(); > dummyXML.ignoreWhite = true; > dummyXML.parseXML(decdata); > return dummyXML; > }; > encLoad.load(file); > } You have a kind of scope problem. Your mloader function doesn't return anything, only the embedded onLoad function (and this actually doesn't return anything either, because it doesn't have any calling function to return it to). This doesn't run until some time after the mloader function finishes, when the data is returned from the server. To do what you're looking for, you need to set up some kind of callback system. There are various ways to do it, but here's an example: function mloader(file) { var encLoad = new LoadVars(); encLoad.onLoad = function(success) { var xmldata = encLoad.data; var decdata = RC4.decrypt(xmldata, "mykey"); this.dummyXML = new XML(); this.dummyXML.ignoreWhite = true; this.dummyXML.parseXML(decdata); }; encLoad.load(file); return encLoad } var loadListener = mloader("parent.xml.enc"); var xmlWatcher:Function = function(prop, oldVal, newVal) { trace(newVal) loadListener.unwatch("dummyXML") } loadListener.watch("dummyXML", xmlWatcher); This is a slightly odd way to do it, but it's just an example of how you might fit it into your structure. The main point is that you can't expect calls to a server to run synchronously, you have to set them going and then set up some system that waits for them to complete - that's what the onLoad call is for. Danny ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
[Flashcoders] How to return with loadvars within a function?
Hi Coders I have problem with the following code. I cannot return the value but i can trace inside the onload. I am mentioning the dummyXML. Anyone can help would be appricated. function mloader(file, toobject) { encLoad = new LoadVars(); encLoad.onLoad = function(success) { xmldata = encLoad.data; decdata = RC4.decrypt(xmldata, "mykey"); dummyXML = new XML(); dummyXML.ignoreWhite = true; dummyXML.parseXML(decdata); return dummyXML; }; encLoad.load(file); } kk = mloader("parent.xml.enc", "kk"); trace(kk); ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] which tool to 3d rotate image?
I'm trying to figure out which tool is best to 3d rotate an image on a plane. Something like this: http://karmapop.com/content/cardFlip.swf but with a dynamically loaded image on the "front" and another image on the "back" with a font superimposed on it. this is going to be a postcard. this is basically a shape tween, but where an image is being distorted. I want the animation to be as smooth as possible, the file size to be as small as possible, and keeping it to Flash 7 to allow the most people to use it. Sandy http://www.mosessupposes.com/Fuse/ http://hosted.zeh.com.br/mctween/ Fuse, MC Tween, Laco's Tween or any other tween won't "do" the job. They're just tweening engines, so they'd only be used when setting the angle of the thing. Say, from 0 to 360 using different equations. Useful, but to properly *project* the object, to draw the thing, you'd need something else. It's not their job. Papervision3d Papervision3d and Sandy will do the job *fine*, but from what I've seen they're meant for Flash 8+ because they use BitmapData to do it. Something else? Well, how dependent you are of Flash 7? To do this on Flash8+, you'd use Papervision3d or Sandy. It's probably not very painful. On Flash7, you would need to do the proper 3d transformation *and* all projection. I don't think there's any 'ready-made' engine for that, so basically, you'll need to map and rotate all vectors, then project all triangles using skewing and masks. This is possible, but it's pretty ugly compared to the easier/faster BitmapData fill. A similar technique has been used here: http://www.nkag.co.jp/ You can't see, but each face is made of a bunch of triangles. However, due to the complexity of the masks, you'll see artifacts once in a while, and speed won't be exactly the best. The technique used by most 3d engines today is similar, but they simply fill the data instead of creating movieclips with masks and skewing/scaling them. So all in all, I'd recommend you using Sandy/Papervision3d instead, under Flash 8. 90% of the user penetration seems good enough (specially considering 7 is just a bit more, 95%). Of course, you just scale your object vertically/horizontally... there would be no perspective, but sometimes the simplest/easiest way is enough. And finally, people, please keep this in mind when doing your 3d rotations and face projections and whatnot: http://hosted.zeh.com.br/misc/perspective.png Zeh ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Flash Game - Post Encrypted Score toserver sidescript
I agree. Perhaps it's a good thing that once the game is launched the contest for the prize won't last too long. So that might reduce the amount of hackers that eventually notice the game. I hope I'm not under estimating hackers, I guess they could crack the game in a few hours anyway. Thanks for your help! JulianG Danny Kodicek wrote: Be aware that once you're allowing for hackers getting into your game, just hacking into the server communication is not your only problem: they may find ways to cheat the game without touching that code. As a simple example: suppose you have a space invaders game with a function 'destroyShip', if they invoke this function they might be able to increase the score 'legitimately'. Look into the history of MMORPGs to see the number of ingenious methods hackers have found to cheat their way in (my favourite is the story of the rogue carpenters who held characters to ransom by building wardrobes around them) Danny __ ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] which tool to 3d rotate image?
Helmut Granda a écrit : another more extended explanation by senocular: http://www.senocular.com/flash/tutorials/transformmatrix/ On 12/28/06, Matthew Pease <[EMAIL PROTECTED]> wrote: > This sounds like a request to Santa Claus. Heh. and i was a good boy this year too. > Did you say that all this has to be acomplished dynamicly? So nothing has to > be pre-rendered? Right. > In that case have you considered just creating a box on the fly > something like this: > > http://www.flashloaded.com/flashcomponents/3dbox/example3.html This looks close. But i'd like to use my own image. Probably the front of the postcard will be higher resolution than the image that actually gets rotated, to speed the rotation. How about those other tools i mentioned? i would love it if i could buy a tool that would just do this, or pay someone to do this for me. Anyone out there good at AS & 3d Flash (or just image distorting) need a little extra money? Thank you - Matt ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com The DistortImage class uses BitmapData so I'm not sure that it can be exported for flash 7... Transformations described on Senocular can be a solution but the effect won't be the same. The best solution to have the same effect for F7 is to use masks but it's not very clean... _ Les révélations de la starac 6 commentées par Jérémy! http://starac2006.spaces.live.com/ ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] which tool to 3d rotate image?
another more extended explanation by senocular: http://www.senocular.com/flash/tutorials/transformmatrix/ On 12/28/06, Matthew Pease <[EMAIL PROTECTED]> wrote: > This sounds like a request to Santa Claus. Heh. and i was a good boy this year too. > Did you say that all this has to be acomplished dynamicly? So nothing has to > be pre-rendered? Right. > In that case have you considered just creating a box on the fly > something like this: > > http://www.flashloaded.com/flashcomponents/3dbox/example3.html This looks close. But i'd like to use my own image. Probably the front of the postcard will be higher resolution than the image that actually gets rotated, to speed the rotation. How about those other tools i mentioned? i would love it if i could buy a tool that would just do this, or pay someone to do this for me. Anyone out there good at AS & 3d Flash (or just image distorting) need a little extra money? Thank you - Matt ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- ...helmut helmutgranda.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] which tool to 3d rotate image?
Well, Fuse is more for linear animation with ActionScript, and for what I have seen PaperVision works only with Flash8 and 9 and you are targeting flash7 so that is out of the question. One thing that you have to keep in mind is that flash doesnt skew bitmaps as you want it but after looking at Sandy I would say that is your best bet since the class is in AS2 and then you can export for F7. On 12/28/06, Matthew Pease <[EMAIL PROTECTED]> wrote: > This sounds like a request to Santa Claus. Heh. and i was a good boy this year too. > Did you say that all this has to be acomplished dynamicly? So nothing has to > be pre-rendered? Right. > In that case have you considered just creating a box on the fly > something like this: > > http://www.flashloaded.com/flashcomponents/3dbox/example3.html This looks close. But i'd like to use my own image. Probably the front of the postcard will be higher resolution than the image that actually gets rotated, to speed the rotation. How about those other tools i mentioned? i would love it if i could buy a tool that would just do this, or pay someone to do this for me. Anyone out there good at AS & 3d Flash (or just image distorting) need a little extra money? Thank you - Matt ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- ...helmut helmutgranda.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
RE: [Flashcoders] Flash Game - Post Encrypted Score toserver sidescript
> Thanks Danny! > There is a prize involved, but no money. I mean users do not > pay for this. > > I'll take a look at the SHA-1 algorithm. > Of course hackers will be able to find the encryption string > by "decompiling" the SWF. > So I might need some code obfuscation, which I'm not a big fan of. Be aware that once you're allowing for hackers getting into your game, just hacking into the server communication is not your only problem: they may find ways to cheat the game without touching that code. As a simple example: suppose you have a space invaders game with a function 'destroyShip', if they invoke this function they might be able to increase the score 'legitimately'. Look into the history of MMORPGs to see the number of ingenious methods hackers have found to cheat their way in (my favourite is the story of the rogue carpenters who held characters to ransom by building wardrobes around them) Danny ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] which tool to 3d rotate image?
Matthew Pease a écrit : This sounds like a request to Santa Claus. Heh. and i was a good boy this year too. Did you say that all this has to be acomplished dynamicly? So nothing has to be pre-rendered? Right. In that case have you considered just creating a box on the fly something like this: http://www.flashloaded.com/flashcomponents/3dbox/example3.html This looks close. But i'd like to use my own image. Probably the front of the postcard will be higher resolution than the image that actually gets rotated, to speed the rotation. How about those other tools i mentioned? i would love it if i could buy a tool that would just do this, or pay someone to do this for me. Anyone out there good at AS & 3d Flash (or just image distorting) need a little extra money? Thank you - Matt You can have some code to distort an image with four controls points at this adress: http://sandy.media-box.net/blog/distordimage-the-way-to-distord-bitmaps-by-code.html But I think that even with this it won't be easy to have different images on the front and the back... _ Les révélations de la starac 6 commentées par Jérémy! http://starac2006.spaces.live.com/ ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] which tool to 3d rotate image?
This sounds like a request to Santa Claus. Heh. and i was a good boy this year too. Did you say that all this has to be acomplished dynamicly? So nothing has to be pre-rendered? Right. In that case have you considered just creating a box on the fly something like this: http://www.flashloaded.com/flashcomponents/3dbox/example3.html This looks close. But i'd like to use my own image. Probably the front of the postcard will be higher resolution than the image that actually gets rotated, to speed the rotation. How about those other tools i mentioned? i would love it if i could buy a tool that would just do this, or pay someone to do this for me. Anyone out there good at AS & 3d Flash (or just image distorting) need a little extra money? Thank you - Matt ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Tweaking Full-Screen Mode in Flash Player 8
Can we some code you are using at the moment? Maybe it just needs some tweaking rather than starting from scratch. On 12/27/06, Kelly Smith <[EMAIL PROTECTED]> wrote: Hello - I am building a video application which requires a full-screen mode for flash 8 players. I want to pass along some settings from the normal-sized view (browser) to the full-screen browser when it opens upon user's command via javascript. Specifically, I want to take some objects out of view, and scale others, when the app is full screen. Unfortunately, what I've tried to this point gets me nothing except for the initialization settings defined in my app. Hints? Suggestions? thanky - Kelly ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- ...helmut helmutgranda.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] which tool to 3d rotate image?
This sounds like a request to Santa Claus. Did you say that all this has to be acomplished dynamicly? So nothing has to be pre-rendered? In that case have you considered just creating a box on the fly something like this: http://www.flashloaded.com/flashcomponents/3dbox/example3.html ...helmut On 12/28/06, Matthew Pease <[EMAIL PROTECTED]> wrote: Hello All - I'm trying to figure out which tool is best to 3d rotate an image on a plane. Something like this: http://karmapop.com/content/cardFlip.swf but with a dynamically loaded image on the "front" and another image on the "back" with a font superimposed on it. this is going to be a postcard. this is basically a shape tween, but where an image is being distorted. I want the animation to be as smooth as possible, the file size to be as small as possible, and keeping it to Flash 7 to allow the most people to use it. Which of these is best for the job? Sandy http://www.mosessupposes.com/Fuse/ http://hosted.zeh.com.br/mctween/ Papervision3d Something else? Thank You - Matt San Francisco ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- ...helmut helmutgranda.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com