Re: [Flashcoders] Text Editor Undo/Redo Stack
Use javascript: //HTML script language=javascript function getClipBoardText() { var t = window.clipboardData.getData(TEXT); return t; } /script //FLASH import mx.utils.Delegate; import flash.external.ExternalInterface; function pasteClickHandler(evt:Object):Void { var t:Object = ExternalInterface.call(getClipBoardText); trace(t.toString()); } paste_btn.addEventListener(click, Delegate.create(this, pasteClickHandler)); No idea which browsers it works/doesn't work in though. Check google for javascript clipboardData or javascript execCommand paste regards, Muzak - Original Message - From: James Marsden [EMAIL PROTECTED] To: flashcoders@chattyfig.figleaf.com Sent: Tuesday, September 11, 2007 11:32 AM Subject: Re: [Flashcoders] Text Editor Undo/Redo Stack Hallo, The text editor app is up and running now, thanks to those folks that offered suggestions. I've got everything working apart from the pasting of text. Does anyone know how it is possible to do this? Any cool tricks to access the clipboard from ActionScript (I've had a look online and found nowt). Cheers! James ___ 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] toString(aArray[i]) ?? does this work
What is stored in the Array? - Original Message - From: [EMAIL PROTECTED] To: Flash Coders flashcoders@chattyfig.figleaf.com Sent: Tuesday, September 11, 2007 5:30 AM Subject: [Flashcoders] toString(aArray[i]) ?? does this work Quick question, can I toString an array element. ie: var myStr:String = toString(aArray[i]);// where 'i' is the increment. I am having an issue with this. when I trace myStr it traces [object object] instead of what I intended/expected mcMovieClipName14 as a string. Any insite would be appreciated. Thanks in advance, Paul V. ___ 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] Text Editor Undo/Redo Stack
Hallo, The text editor app is up and running now, thanks to those folks that offered suggestions. I've got everything working apart from the pasting of text. Does anyone know how it is possible to do this? Any cool tricks to access the clipboard from ActionScript (I've had a look online and found nowt). It's not possible without a wrapper. Our text editor runs within Director, so we paste the text into a Director cast member, then send it through to Flash. Unfortunately this messes up with non-Western text, so we search for ? characters, and if there are more than a few in a row, we throw an alert that recommends the users use Ctrl-V instead. Never really understood the value of this security feature, especially given that Shockwave doesn't have it. 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] Access loaded SWF variables, methods, etc ?
I am loading a SWF into a movieclip and want to access variables, etc. from my main class. I have this in my main document class: private function loadViewElements():void { var module1Loader:Loader = new Loader(); module1Loader.contentLoaderInfo.addEventListener( Event.COMPLETE, completeEvent ); module1Loader.contentLoaderInfo.addEventListener( IOErrorEvent.IO_ERROR, ioError ); // Create and load the Views NUMBERPAD = new MovieClip(); NUMBERPAD.name = numberPad; addChild( NUMBERPAD ); NUMBERPAD.addChild( module1Loader ); var moduleURL:URLRequest = new URLRequest( views/view.swf ); module1Loader.load( moduleURL ); } private function completeEvent( event:Event ):void { trace( event.target + loaded ); trace( NUMBERPAD.getChildAt(0) ); var who = getChildByName( numberPad ); trace( who.name ); trace( who.iam ); } Inside the loaded SWF I have a simple variable: var iam:String = view; I am trying to find a decent way to navigate things in the loaded SWF. I must be overlooking something? - eric ___ 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] Isometic game - zdepth managing for multiple movable characters
He guys (and maybe girls), I have a question that is related to z-depth managing in an isometric game, that needs to be made in AS2. In the game I basically use one abstract layer that holds all the tiles and their information wheter or not a movable object is allowed to 'walk' over the tile. Then there is another layer that holds all the objects, so that includes a player, a computer controlled player and enviormental objects that players cannot walk through being the visualization of the first layer. Every object gets a z-depth assigned. For the players the zdpeth need to be set based on the tile they are at. This way the players can walk 'around' the enviorment objects. For the z-depth calculation I use the tile grid x and y plus the width of the row, this generates an unique z-depth number and makes sure that the higher the y, the bigger the z-depth , thus objects appear infront of objects with a lower y index. Here is the problem I am trying to figure out. If two movable objects, or even three of them are at the same time on the same tile, then the above described z-depth managing will fail. How do I deal with that? Then another question I have is this. Does every movable object needs to check/swap z-depth on every frame. Wouldn't that be to CPU intensive? I really hope someone can clear this up for me. thank you in advance, Jiri ___ 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] IOErrror using URLLoader with files bigger than a few kb
I am having problems using URLLoader to send data to a server side script. What I am doing is loading in a file as binary data and converting to Base64 then sending this Base64 string within an xml string. It is working fine with very small files of only a few kb. However if the files are larger than this, I get an IOError#2032 The client insists there is no problem at the server side and I cannot think of anything else to try my end. Is there any possibility that with larger files, the Base64.Encode operation has not completed before the data is sent? Here is the relevant code: var dataStrEncoded:String=Base64.Encode(ByteLoader.data); var XMLString:String; XMLString = '?xml version=\1.0\ encoding=\UTF-8\?'; XMLString = 'file'; XMLString += '![CDATA[' + dataStrEncoded + ']]'; XMLString += '/file'; var scriptPath:String = uploadUrl + ?xml= + XMLString + key= + _key + session= + _sessionId; _loader = new URLLoader(); _loader.addEventListener(Event.COMPLETE,fileUploadCompleteListener); _loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorListener); var request:URLRequest = new URLRequest(scriptPath); _loader.load(request); ___ 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] Access loaded SWF variables, methods, etc ?
Okay - I had to dig in a little more, I have a blog post about this (whats the best way to approach)? http://www.ericd.net/2007/09/as3-accessing-loaded-swf-stuff.html On 9/11/07, eric e. dolecki [EMAIL PROTECTED] wrote: I am loading a SWF into a movieclip and want to access variables, etc. from my main class. I have this in my main document class: private function loadViewElements():void { var module1Loader:Loader = new Loader(); module1Loader.contentLoaderInfo.addEventListener( Event.COMPLETE, completeEvent ); module1Loader.contentLoaderInfo.addEventListener( IOErrorEvent.IO_ERROR, ioError ); // Create and load the Views NUMBERPAD = new MovieClip(); NUMBERPAD.name = numberPad; addChild( NUMBERPAD ); NUMBERPAD.addChild( module1Loader ); var moduleURL:URLRequest = new URLRequest( views/view.swf ); module1Loader.load( moduleURL ); } private function completeEvent( event:Event ):void { trace( event.target + loaded ); trace( NUMBERPAD.getChildAt(0) ); var who = getChildByName( numberPad ); trace( who.name ); trace( who.iam ); } Inside the loaded SWF I have a simple variable: var iam:String = view; I am trying to find a decent way to navigate things in the loaded SWF. I must be overlooking something? - eric ___ 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] Golden Ratio Spiral points
Thanks Glen, Danny, and Mark, I'll give these a try! Jason Merrill Bank of America GTO Learning Leadership Development eTools Multimedia Team ___ 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] Import images into whiteboard
Hi Guys. I am currently developing a multi-user whiteboard using Flash Media Server. The client wants a user to be able to import an image from their hard-drive into the whiteboard for all to see. The most straight forward solution I can see is for the image to be uploaded to the server, and then all the client swfs will be able to see it and open it from the server. However, this will result in a lot of images building up on the server that are in reality only ever going to be seen once. Does anyone know of a method I can use to transfer the image to other clients by sending data from within Flash and without having to upload the original image to the server? I tried sending a BitmapData object to the server but it didn't like that. SharedObjects don't accept BitmapData objects either, and trying to send a MovieClip with a jpeg loaded into it didn't work at all. Any ideas? It's not essential it works this way, but it would make more sense for the image data be destroyed once the session is over, and it saves me chasing up the server developers for another webservice. Geoff Bower Developer MotivatEd web: www.MotivatEd.ltd.uk http://www.MotivatEd.ltd.uk email: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] switch: +44 (0)1223 265 624 mobile: +44 (0)7971 627 687 ___ 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] toString(aArray[i]) ?? does this work
Try toString(aArray[i]._name) instead I'm not 100% sure what you're storing in your array, but it sounds like you're storing movieClip objects in there, in which case the result [object Object] would be the correct output. Hal -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Monday, September 10, 2007 8:30 PM To: Flash Coders Subject: [Flashcoders] toString(aArray[i]) ?? does this work Quick question, can I toString an array element. ie: var myStr:String = toString(aArray[i]);// where 'i' is the increment. I am having an issue with this. when I trace myStr it traces [object object] instead of what I intended/expected mcMovieClipName14 as a string. Any insite would be appreciated. Thanks in advance, Paul V. ___ 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] Nokia Software Installer...
Hi and sorry for that offtopic question, but did somebody know who made the product software installers for example the Nokia N76 Series. Looks like a flashinterface and I think it is one, but I wanted to know whats under the hood, maybe a simple windows installer? If somebody know something about such flash interface software installers, or have some links, or know a company who did that stuff, it would be great if some of you send me a link. Wanted to look into the archives but had a problem to get in, because of the login process went wrong. Thank you Peter Peter Oliver Geller interface design, animation development Lindenstraße 14 . 50674 Cologne 0221 - 92 42 81 - 52 phone http://petegellers.blogspot.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] Displaying Progress of calls to external scripts
I am calling several external scripts in my app using the URLLoader. These calls return xml data. I am trying to display the progress of the data flow using the event.Progress as follows but I am not getting very good results. It is currently displaying the following. Loaded: 349 Total: 0 Percent Infinity Perhaps this is not possible? _loader.addEventListener(ProgressEvent.PROGRESS, handleProgress); var request:URLRequest = new URLRequest(scriptPath); request.method = URLRequestMethod.POST; var variables:URLVariables = new URLVariables(); variables.xml = dataToSend; request.data = variables; _loader.load(request); private function handleProgress(event:ProgressEvent):void { var percent:Number = Math.round(event.bytesLoaded / event.bytesTotal * 100); _sessionInstance.progressTxt = Loaded: + event.bytesLoaded + \n + Total: + event.bytesTotal + \n + Percent + percent; } ___ 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 share class library across a network?
Hi there, I would like to share my class library with other developers on my local network. We are soon to be using Version Cue or something similar but in the meantime it would be good if we could al be working from the same class library (there are only 2 of us). Almost every time we exchange a file lots of compiler errors are thrown up even though the class paths are set correctly, this is usually rectified after restarting the computer or Flash. I have copied my class library to a network share but when I compile a SWF from Flash I get lots of compiler errors starting with line 6 of toplevel.as 'The class or interface 'Boolean' could not be loaded' 'The class or interface 'Object' could not be loaded' 'The class or interface 'Number' could not be loaded' If I point my class path (set in my AS preferences for the Flash app) to an exact copy of the same folder but on my local drive everything works fine! If someone could help me out here I would be really grateful, this is proving a real headache! Cheers, Ali ___ 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] AS3 - Serial?
May be with a localhost Socket you can get something 2007/9/10, Ricky Bacon [EMAIL PROTECTED]: eric e. dolecki wrote: Ricky - that looks sweet. Have you tried it? Will it work with a USB interface? I haven't used that particular one, but I've used the same concept to interface with custom hardware. Re: USB from the description: The software works in Windows and macosX, it requires java installed in the local computer, (java is installed by default on the Mac) and a serial port connection. On the Mac and in some PCs a USB to serial adapter is required to connect most microcontrollers. Keyspan USB adapters had been tested to work fine. cheers -Ricky ___ 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 -- Andrés González Aragón Ejecutivo Nacional Agel Enterprises LCC Desarrollador Multimedia http://www.quantium.com.mx ___ 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] toString(aArray[i]) ?? does this work
Maybe try; var myStr:String = String( aArray[i] ); or var myStr:String = aArray[i].toString(); -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Monday, September 10, 2007 8:30 PM To: Flash Coders Subject: [Flashcoders] toString(aArray[i]) ?? does this work Quick question, can I toString an array element. ie: var myStr:String = toString(aArray[i]);// where 'i' is the increment. I am having an issue with this. when I trace myStr it traces [object object] instead of what I intended/expected mcMovieClipName14 as a string. Any insite would be appreciated. Thanks in advance, Paul V. ___ 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] AS2 Sound.stop()
I don't understand the docs for the AS2 Sound.stop command. my_sound.stop([idName:String]) : Void I can't find any documentation about sounds having an idName. Method; stops all sounds currently playing if no parameter is specified, or just the sound specified in the idName parameter. But my_sound is an instance of the Sound class, so why would I need to specify an id? This seem to imply that I could use Sound.stop(); to stop all sounds currently playing. But it won't compile. I get Sound has no static field stop. So, how do you stop all currently playing sounds? Thanks! ___ 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] AS3 Sound = wtf
So i got my AS3 books finally. Essential AS3 by Moock, AS3 animation/making things move and AS3 design patterns. Of these 3, none give particular interest in the sound API. Making things move takes a fleeting glance at AS3 sound, limited to a = new Sound(); a.play();, and Design Patterns makes an equally simple example. The AS3 docs (F1 in the IDE) suggests a hack of a class to encapsulate Sound handling and otherwise assures us that the AS3 api is powerful. I still fail to see why. When Andre Michelle makes an AS3 303 emulator we're all impressed, but we somehow fail to realize he made it with *hacks*. Advanced AS3 sound manipulation is effectively barred to those not of his calibre. For the rest of us, we're stuck waiting for someone to build a robust sound control API wrapper for AS3's frankensteinian mess. In my opinion, AS3 sound is only as strong as you're willing to take punishment. Things were rough in AS2, but we could work it. In AS3 it's equally rough, with added edges. Considering the *vast* improvements AS3 and the new VM gave us, i find it bewildering how something so core to the multimedia experience has been either ignored completely or thrown in as an afterthought. I'm told by peers that oh you know, Sound is weak in Flash. Like a dogma. Which makes me think engineers threw a roundtable to somehow assure that in their shiny new VM, Sound remained weak. I have never seen an AS topic so skirted. It's like a dark secret nobody really wants to discuss. Like pooping. Either people out there *don't care about sound* which blows my mind, or Adobe didn't give a shit. I'm trying to port my AS2 3d sound positioning and effects control library to AS3 and, right now, it's disillusioning and sometimes infuriating. Dual stop methods for streaming and preloaded audio, the contextually wrong of which doesn't generate exceptions, but sound glitches. Soundchannels allow for quick and easy orphaning of sound. Go orphans! Soundmixer only really stopping sound and giving an *incomplete* spectrum, ignoring Microphone. There's parts of AS3 that force us to get stricter, and this is fine. The sound library forces us to either wrap or get sloppy. So am i right about this? Do Flash developers really care this little about audio? Positive sides? Loading sound resources externally and SoundTransform. And still being able to actually play audio. I don't know of a fix for this beyond doing the sound API over with a little more consideration. But i'd love to hear some best practises and experiences from other developers. Anything to learn more about this POWERFUL NEW API. Yeah. - Andreas SJ ___ 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] control flv playback speed
Is there any way to let the user control the playback speed of a flv in Flash? And even better, is there any way to change the playback speed without changing the audio pitch (as can be done with Quicktime)? thx, Helen ___ 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] Variables in HTTPService url via flashVars
I'm passing a var into Flex via flashvars and am trying to use it with HTTPService in the url field to read an xml file where part of the path is the variable. I am receiving the var fine, but just can't find a way to incorporate into the url field in a way that the HTTPService will read it. Is this possible? Everything I've tried thus far has failed. To give you a better idea, here's a snippet of one of my tries: mx:Script ![CDATA[ [Bindable] public var myPackage:String; private function initPackageVar():void { myPackage = Application.application.parameters.myPackage; } ]] /mx:Script mx:HTTPService id=myClipArtService url=assets/{myPackage}/clipart.xml result=resultClipArtHandler(event)/ -M ___ 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 with listener for custom class (AS3)
Greetings All, I'm trying to do more and more of my projects with external classes and, along with that, creating classes for routines that I regularly do. I have a class that reads an XML file and CSS file once it's called. It has worked fine for the first few projects I used it in. With my recent project, it's not wanted to behave. The code for the class is as follows: package { import flash.display.Sprite; import flash.text.StyleSheet; import flash.events.*; import flash.net.*; public class fileImports extends Sprite { public var newStyleSheet:StyleSheet = new StyleSheet(); public var newXML:XML = new XML(); public function fileImports(xmlFile:String, cssFile:String):void { //load css file var cssToLoad:URLRequest=new URLRequest(cssFile); var cssLoader:URLLoader = new URLLoader; cssLoader.load(cssToLoad); //load xml file var xmlToLoad:URLRequest=new URLRequest(xmlFile); var xmlLoader:URLLoader = new URLLoader;; xmlLoader.load(xmlToLoad); //event listeners xmlLoader.addEventListener(Event.COMPLETE,xmlLoaded); cssLoader.addEventListener(Event.COMPLETE, cssLoaded); } public function cssLoaded(event:Event):void { newStyleSheet.parseCSS(event.target.data); } public function xmlLoaded(event:Event):void { newXML = XML(event.target.data); } } } I am creating an instance on my main timeline with this: var fileForThis:fileImports = new fileImports(courseInfo.xml,styles.css); I am trying to use the data that is coming in with the XML file to populate some combo boxes. My problem is I don't know how to listen to the class from the main timeline to find out if the class is finished processing the XML. Right now if I try to use fileForThis.newXML I get a value of null. But if I put a trace on newXML in the class, it shows the content of my XML file. I have gotten this to work on other projects because I haven't tried to use the data immediately - so the data has time to process before it's put into a text field, etc. I appreciate any help I can get on this. Thanks! D. Dane Williams The Learning Center Buckman Laboratories, International 901-272-6774 ___ 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] toString(aArray[i]) ?? does this work
You're using toString wrong. toString is a native method of objects. Use: aArray[i].toString() or String(aArray[i]) ___ 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] dynamically attaching a movie clip to a class/object
You are not defining what the movie should be attached to. Try: _root.attachMovie(signPost, myPost, _root.getNextHighestDepth()); Note that I removed this.getNextHighestDepth(). Because this does not exist on the stage yet, you can not get its next highest depth. Charles P. On 4/26/07, sebastian chedal [EMAIL PROTECTED] wrote: hello flash coders! ive just joined and there are some nice discussions here, i hope to contribute positivly to the level of knowledge in the group. :) i'm currently learning how to work in an OOP manner in flash, and thus meeting some basic hurdles. it would be very kind of you if you could assist me in my [probably very simple] problems. :-) I'm using external *.as files, and at the moment i am trying to figure out how to attach a movie to it [should be simple, right?] my as file: class Post extends CoreClass { private var myPost:MovieClip; public function setCord(px,py,pz):Void { //set coordinates public var px:Number = px; public var py:Number = py; public var pz:Number = pz; //original point locations private var ox:Number = px; private var oy:Number = py; private var oz:Number = pz; } public function attachMe ():Void { attachMovie(signPost, myPost, this.getNextHighestDepth()); myPost._x = 0; myPost._y = 0; trace (myPost = + myPost._x); } } In frame 1 of the movie i write: Post0 = new Post (); //Post0.setCord(100,100,0.9); Post0.attachMe(); The trace comes up 'undefined' if i use the 'attachmovie' from the root in the main time line, it works just fine. any clues? thanks! sebastian / amsterdam ___ 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] XML confusion
The trace functions arguments are implemented as follows trace(... arguments). Which means that all types of variables are accepted. Every type of variable extends Object and with that every instance will have a toString method. This is the method the trace function will call to display the value. The actual text from the documentation: Displays expressions, or writes to log files, while debugging. A single trace statement can support multiple arguments. If any argument in a trace statement includes a data type other than a String, the trace function invokes the associated toString() method for that data type. For example, if the argument is a Boolean value the trace function invokes Boolean.toString() and displays the return value. Greetz Erik On 9/10/07, ben gomez farrell [EMAIL PROTECTED] wrote: I don't think you're doing anything wrong, its just that the trace function only accepts strings as parameters. So when you pass in your XML variable it would throw an error if you were using a more strict language like Actionscript 3 (at least I assume it throws an error in AS3, maybe it actually does the same thing). However, if you're using AS2, which is less strict, the trace function expects a string, so it'll try to convert your XML to a string, and it looks like its successful. It probably runs the XML.toString() method when it gets to the trace method. So you're not going to get anything from trace except for a converted string. And it'll do the same thing in your scriptPath string, because its going to convert that XML variable to a string. If you want more control, you might try looping through your XML to create a more custom string, and then use that. ben ___ 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] toString(aArray[i]) ?? does this work
toString() is a method of the Object class and it doesn't have any arguments. So while every object in Flash has a toString method, by default it returns [object Object]. From your code it looks like what you're actually doing is calling this.toString(), you probably want to do something like myStr:String = aArray[i].toString(); but that still might not give you what you're looking for. If the items in the array are references to movieclips and you want the instance names of those clips, you should try aArray[i]._name (AS2) or aArray[i].name (AS3) Jamie On 9/10/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Quick question, can I toString an array element. ie: var myStr:String = toString(aArray[i]);// where 'i' is the increment. I am having an issue with this. when I trace myStr it traces [object object] instead of what I intended/expected mcMovieClipName14 as a string. Any insite would be appreciated. Thanks in advance, Paul V. ___ 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] toString(aArray[i]) ?? does this work
Ah, since the local scope is the object in the array then just using `toString()` without any arguments would work (just doing `this.toString()` basically). Can you provide the code where you populate the array? It's possible you're adding something other than the movie clips to the array (or maybe some type info is being lost). I'm actually not sure how the `i` variable is handled in this case. If you're always getting 126 then Flash might be keeping a reference to the variable and evaluating it when the function runs, instead of evaluating it when creating the function. This might be how things work, I really don't know. A different way to handle it would be to do this: aArray[i].myArrayIndex = i; aArray[i].onPress = function() { ... } and then within the function use `this.myArrayIndex` instead of `i`. This way you're storing the index for the object within the object itself, so you can query it whenever you want without worrying about the scope chain. One other thing, just as a sanity check. You said you did this: setInterval(rollOvers,10); //calls function 100/second to If that's the actual code then you're going to have problems. That will run your rollOvers function every 10 milliseconds. You probably only want it run once (no point in changing the onPress functions when they've already been assigned). You're going to want to store the interval's ID and then clear it: var rollOversInterval:Number = setINterval(rollOvers, 10); function rollOvers() { clearInterval(rollOversInterval); /* rest of the function */ } If for some reason you do need to update the onPress functions you should really only do it when an event occurs that would require it, instead of constantly doing so. -Andy On 9/11/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Andy, I see what you are saying, I think. That the .toString() has to be used as a method directly being addressed by the object. Like I said that what I think you are saying. How ever it seems I still can not get the string myMCinArray1 or myMCinArray2 or myMCinArray3 etc when I use the toString on an array Element. By the way, the scope in this case is actually the Array lement(MovieClip) -see coded snippet setInterval(rollOvers,10); //calls function 100/second to function rollOvers(){ for (i=0; iaArray.length; i++) { aArray[i].onPress = function() { var myStr:String = aArray[i].toString(); //* THIS LINE trace(myStr);// still traces [object object] trace(i); //gives me 126 .which is the array length. if I could get this to give me the value of the Array element clicked I would fine too. }; } } Again any follow up on this post would be appreciated. Paul V. - Original Message - From: Andy Herrman [EMAIL PROTECTED] To: [EMAIL PROTECTED]; flashcoders@chattyfig.figleaf.com Sent: Tuesday, September 11, 2007 12:00 PM Subject: Re: [Flashcoders] toString(aArray[i]) ?? does this work I think what you really want is this: var myStr:String = aArray[i].toString(); I don't know of any global toString() function. What's probably happening is that you're doing the equivalent of `this.toString(aArray[i])`. The scope object's toString function ignores all arguments and gives you the string representation of itself (which will be what you said you're seeing unless it has a custom toString() implementation). -Andy On 9/10/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Quick question, can I toString an array element. ie: var myStr:String = toString(aArray[i]);// where 'i' is the increment. I am having an issue with this. when I trace myStr it traces [object object] instead of what I intended/expected mcMovieClipName14 as a string. Any insite would be appreciated. Thanks in advance, Paul V. ___ 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] export movieclip as jpg question..
Hello everyone, Im looking for a way to export an mc inside an swf as jpg image and email it. There are php scripts which converts the swf to jpg buy reading swf pixel by pixel, but i didnt use it before. The mc I want to make an image has 3 mc's and 1 mask mc and which masks one of this 3, inside itself. Looks it will be a problem. Any clues or hints do you have on the subject? Thanks a lot, Kerem ISERI ___ 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] Property check works differently in CS3?
Hi all, I have a component (AS2) that extends MovieClip (as usual). It shows user's text placed along the curve: http://gousable.com/flash/text2curve.html A couple of days ago I've added the options to format the text as bold/italic. The getter/setter names are, respectively, bold and italic. It work nice on my machine in Flash 8 and MX 2004. However, a client reports an error that comes in Flash CS3 (published in AS2 for FP8): There is no property with the name 'bold'. There is no property with the name 'italic'. I suggested to try array syntax : t2c[bold] = true; // instead of t2c.bold Of course, array syntax eliminated the error(s) and then everything works ok. My guess is that the compiler in CS3 tries to prevent alien property names. If so, tbold instead of bold should work for MC (will send to him today :-) Unfortunately, I don't have the CS3 myself (maybe because I read all these horror stories here :-) and can't test it. Does anyone know about such differences in Flash 8 vs. Flash CS3 compilers? -- Best regards, GregoryN http://GOusable.com Flash components development. Usability services. ___ 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] Multilingual video with Flash
Hi, What would be the best way to a flash video project with multilingual audio? - A copy of the video for each language (means several video files) ? or - One video and different audiotraks ? As I am not streaming from a server but from a CD, I have a limited space condition. The video is about 5 minutes long, and I remeber, in earlier versions, separated audio didn´t syncronize to good in longer videos. Any suggestions ? Thanks ! -- Volker Scarpatetti Dirección Interactiva - Advertis Interactiva ___ 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 do you delete child movieclips?
Thank you - a good idea! On 9/3/07, Steven Sacks [EMAIL PROTECTED] wrote: I highly recommend putting all your child clips into a container clip and then just remove the container clip rather than iterate through it and remove the child clips one by one. ___ 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] Multilingual video with Flash
Hi, What would be the best way to a flash video project with multilingual audio? - A copy of the video for each language (means several video files) ? or - One video and different audiotraks ? As I am not streaming from a server but from a CD, I have a limited space condition. The video is about 5 minutes long, and I remeber, in earlier versions, separated audio didn´t syncronize to good in longer videos. Any suggestions ? Thanks ! -- Volker Scarpatetti Dirección Interactiva - Advertis Interactiva ___ 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] Can't display multiple components
I am wanting to display 2 components at the same time, along with having a preloader in place. So I have put my components on frame 3, my preloading is done on frame 1. In my actionscript publish settings I have set my export frame for classes to 2 and unchecked export in first frame in the library... phew! When I test the movie I only get one component working properly. Is this a bug? Cheers ___ 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] toString(aArray[i]) ?? does this work
var myStr:String = aArray[i].toString(); HTH, Mark On 9/11/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Quick question, can I toString an array element. ie: var myStr:String = toString(aArray[i]);// where 'i' is the increment. I am having an issue with this. when I trace myStr it traces [object object] instead of what I intended/expected mcMovieClipName14 as a string. Any insite would be appreciated. Thanks in advance, Paul V. ___ 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] RE: Import images into whiteboard
Sorry if you've had this already, but I didn't receive a copy when I sent it to the lists yesterday, and Im sure normally it would send to me too, so Im gonna send it again. G:-) From: Geoff Bower Sent: 11 September 2007 15:06 To: 'flashcoders@chattyfig.figleaf.com'; '[EMAIL PROTECTED]' Subject: Import images into whiteboard Hi Guys. I am currently developing a multi-user whiteboard using Flash Media Server. The client wants a user to be able to import an image from their hard-drive into the whiteboard for all to see. The most straight forward solution I can see is for the image to be uploaded to the server, and then all the client swfs will be able to see it and open it from the server. However, this will result in a lot of images building up on the server that are in reality only ever going to be seen once. Does anyone know of a method I can use to transfer the image to other clients by sending data from within Flash and without having to upload the original image to the server? I tried sending a BitmapData object to the server but it didn't like that. SharedObjects don't accept BitmapData objects either, and trying to send a MovieClip with a jpeg loaded into it didn't work at all. Any ideas? It's not essential it works this way, but it would make more sense for the image data be destroyed once the session is over, and it saves me chasing up the server developers for another webservice. Geoff Bower Developer MotivatEd web: www.MotivatEd.ltd.uk http://www.MotivatEd.ltd.uk email: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] switch: +44 (0)1223 265 624 mobile: +44 (0)7971 627 687 ___ 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] Text Editor Undo/Redo Stack
skillz, thanks :) Muzak wrote: Use javascript: //HTML script language=javascript function getClipBoardText() { var t = window.clipboardData.getData(TEXT); return t; } /script ___ 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] toString(aArray[i]) ?? does this work
try var myStr:String = String(aArray[i]);// where 'i' is the increment. J Muzak wrote: What is stored in the Array? - Original Message - From: [EMAIL PROTECTED] To: Flash Coders flashcoders@chattyfig.figleaf.com Sent: Tuesday, September 11, 2007 5:30 AM Subject: [Flashcoders] toString(aArray[i]) ?? does this work Quick question, can I toString an array element. ie: var myStr:String = toString(aArray[i]);// where 'i' is the increment. I am having an issue with this. when I trace myStr it traces [object object] instead of what I intended/expected mcMovieClipName14 as a string. Any insite would be appreciated. Thanks in advance, Paul V. ___ 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] Setting percentage to circular preloader
Alright, I wrote some code that draws a circle and I added an easing effect using Tweener as follows: var Circle:MovieClip = _root.createEmptyMovieClip(Circle, 2); function drawC(centerX, centerY, radius, sides){ Circle.per = 0; Circle.lineStyle(4,0xFF,100); Circle.moveTo(centerX + radius, centerY); var to = {per:100, time:1, transition:easeOutQuad,onUpdate:function() { var pointRatio = (this.per/sides); var xSteps = Math.cos(pointRatio*2*Math.PI); var ySteps = Math.sin(pointRatio*2*Math.PI); var pointX = centerX + xSteps * radius; var pointY = centerY + ySteps * radius; Circle.lineTo(pointX, pointY); } } Tweener.addTween(Circle, to); } I tried than to use it as a preloader by adding the Preload function and ading a parameter to the drawC function as follows:: function drawC(centerX, centerY, radius, sides, percent){ *// here i added the percent par* Circle.per = 0; Circle.lineStyle(4,0xFF,100); Circle.moveTo(centerX + radius, centerY); var to = {per:percent, time:1, transition:easeOutQuad,onUpdate:function() {// *here i assigned the per property to the variable passed by the percent parameter* var pointRatio = (this.per/sides); var xSteps = Math.cos(pointRatio*2*Math.PI); var ySteps = Math.sin(pointRatio*2*Math.PI); var pointX = centerX + xSteps * radius; var pointY = centerY + ySteps * radius; Circle.lineTo(pointX, pointY); } } Tweener.addTween(Circle, to); } Preload = function () { total = _root.getBytesTotal(); onEnterFrame = function () { loaded = _root.getBytesLoaded(); percentage = Math.floor(loaded/total * 100); if(percentage !== 100) { _root.drawC(250, 200, 15, 100, percentage); *// the percentage is passed to the drawC* }else if (percentage==100){ delete this.onEnterFrame; }; }; }; Preload(); It doesn't work when theoretically it should.. I tried it without Tweener, using a loop and it worked but without easing. like this: function drawC(centerX, centerY, radius, sides, percent){ *// here i added the percent par* Circle.lineStyle(4,0xFF,100); Circle.moveTo(centerX + radius, centerY); for (i=0;i=percent;i++); *// used a loop here - passed the var percent* var pointRatio = (i/sides);// *Used I instead of this.per* var xSteps = Math.cos(pointRatio*2*Math.PI); var ySteps = Math.sin(pointRatio*2*Math.PI); var pointX = centerX + xSteps * radius; var pointY = centerY + ySteps * radius; Circle.lineTo(pointX, pointY); } Tweener.addTween(Circle, to); } Now how can I relate the percentage that is returned to the drawing circle process with Tweener? Is there something wrong or something i miss? Regards -- Omar M. Fouad - Digital Emotions http://www.omarfouad.net This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you. ___ 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] Isometic game - zdepth managing for multiple movable characters
Hi Jiri, The key here is that you can have 'empty' depth levels i.e. an object at depth 5 and an object at depth 8 with nothing at depth 6 and 7. You can make the depth dependent on the actual pixel _y value of the object rather than on the y value of the tile - so depth=_y (or more likely depth=startDepth+_y, because you'll want things behind your objects - like the tiles). To handle multiple objects etc. - from memory, when I last did this I wrote a depth manager that did something like: - Reserve 100 'slots' per_ y-value (so you could have up to 100 objects sharing the same vertical position) - Assign a depth value that combines the y value with the first free slot number - so (something like) depth=startDepth+y*100+freeSlotNumberForThisYValue That's not exact, but you get the idea. That way, generally you just need to assign a depth to an object, you don't need to shuffle all the other objects around. IIRC, it worked rather well. Hope that's helpful. Ian On 9/11/07, Jiri Heitlager [EMAIL PROTECTED] wrote: He guys (and maybe girls), I have a question that is related to z-depth managing in an isometric game, that needs to be made in AS2. In the game I basically use one abstract layer that holds all the tiles and their information wheter or not a movable object is allowed to 'walk' over the tile. Then there is another layer that holds all the objects, so that includes a player, a computer controlled player and enviormental objects that players cannot walk through being the visualization of the first layer. Every object gets a z-depth assigned. For the players the zdpeth need to be set based on the tile they are at. This way the players can walk 'around' the enviorment objects. For the z-depth calculation I use the tile grid x and y plus the width of the row, this generates an unique z-depth number and makes sure that the higher the y, the bigger the z-depth , thus objects appear infront of objects with a lower y index. Here is the problem I am trying to figure out. If two movable objects, or even three of them are at the same time on the same tile, then the above described z-depth managing will fail. How do I deal with that? Then another question I have is this. Does every movable object needs to check/swap z-depth on every frame. Wouldn't that be to CPU intensive? I really hope someone can clear this up for me. thank you in advance, Jiri ___ 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] Isometic game - zdepth managing for multiple movablecharacters
Hi Jiri, I've pasted below the isometric class that I wrote for one of my game books. It is a handy class that allows for easy translation between screen coords, and iso coords. In addition, it handles tile-based dept calculations as well. You asked how do you handle multiple per tile - check out the leeway variable in this class. If leeway is set to 5, and calculateDepth returns 1230, then you can place your item anywhere from 1230 to 1235. You just have to keep track of which depth is being used. You don't have to swap depths of every item every frame. You just have to swap depths on any items that has just changed tiles. There are two limitations with this technique: 1) It does the depth calculations based on the size of the map. For most uses this is fine. But if your map is like 5000 X 5000 tiles, then this depth calculation can probably quickly get too high for Flash to handle without further modifications. 2) A sortable item needs to be no bigger than a tile. If the base of this item takes up multiple tiles (like a couch, or bench, etc) then you need to either slice it up into tile-sized pieces, or change the depth approach. The approach that you use if you are not slicing it up does require resorting lots of item depths frequently rather than using just using unique depths per tile. //Isometric CLASS class com.electrotank.world.Isometric { private var maxx:Number; private var maxz:Number; private var theta:Number; private var alpha:Number; private var sinTheta:Number; private var cosTheta:Number; private var sinAlpha:Number; private var cosAlpha:Number; var leeway:Number; public function Isometric(x:Number, z:Number) { maxx = x; maxz = z; theta = 30; alpha = 45; theta *= Math.PI/180; alpha *= Math.PI/180; sinTheta = Math.sin(theta); cosTheta = Math.cos(theta); sinAlpha = Math.sin(alpha); cosAlpha = Math.cos(alpha); leeway = 5; } public function mapToScreen(xpp:Number, ypp:Number, zpp:Number):Array { var yp:Number = ypp; var xp:Number = xpp*cosAlpha+zpp*sinAlpha; var zp:Number = zpp*cosAlpha-xpp*sinAlpha; var x:Number = xp; var y:Number = yp*cosTheta-zp*sinTheta; return [x, y]; } public function mapToIsoWorld(screenX:Number, screenY:Number):Array { var z:Number = (screenX/cosAlpha-screenY/(sinAlpha*sinTheta))*(1/(cosAlpha/sinAlpha+sinAlpha/cosAlpha)); var x:Number = (1/cosAlpha)*(screenX-z*sinAlpha); return [x, z]; } public function setLeeway(value:Number) { leeway = value; } public function calculateDepth(x:Number, y:Number, z:Number):Number { var x:Number = Math.abs(x)*leeway; var y:Number = Math.abs(y); var z:Number = Math.abs(z)*leeway; var a:Number = maxx; var b:Number = maxz; var floor:Number = a*(b-1)+x; var depth:Number = a*(z-1)+x+floor*y; return depth; } } Jobe Makar http://www.electrotank.com http://www.electro-server.com phone: 252-627-8026 mobile: 919-609-0408 fax: 919-882-1121 - Original Message - From: Jiri Heitlager [EMAIL PROTECTED] To: flashcoders@chattyfig.figleaf.com Sent: Tuesday, September 11, 2007 8:50 AM Subject: [Flashcoders] Isometic game - zdepth managing for multiple movablecharacters He guys (and maybe girls), I have a question that is related to z-depth managing in an isometric game, that needs to be made in AS2. In the game I basically use one abstract layer that holds all the tiles and their information wheter or not a movable object is allowed to 'walk' over the tile. Then there is another layer that holds all the objects, so that includes a player, a computer controlled player and enviormental objects that players cannot walk through being the visualization of the first layer. Every object gets a z-depth assigned. For the players the zdpeth need to be set based on the tile they are at. This way the players can walk 'around' the enviorment objects. For the z-depth calculation I use the tile grid x and y plus the width of the row, this generates an unique z-depth number and makes sure that the higher the y, the bigger the z-depth , thus objects appear infront of objects with a lower y index. Here is the problem I am trying to figure out. If two movable objects, or even three of them are at the same time on the same tile, then the above described z-depth managing will fail. How do I deal with that? Then another question I have is this. Does every movable object needs to check/swap z-depth on every frame. Wouldn't that be to CPU intensive? I really hope someone can clear this up for me. thank you in advance, Jiri ___ 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
Re: [Flashcoders] Text Editor Undo/Redo Stack
ha, ok It's pretty fugly. All the functionality is accessed through ExternalInterface from JavaScript, so there are no Flash based buttons at all. As the person responsible for building the HTML hasn't focused on it yet, it mings a considerable amount. There are a few bugs still too, where undo/redo does unexpected things, and TextFormats aren't maintained throughout, but the guts of it are done! http://www.futurlab.co.uk/clients/kowari/ J dr.ache wrote: show us! :) James Marsden schrieb: Hallo, The text editor app is up and running now, thanks to those folks that offered suggestions. ___ 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] Access loaded SWF variables, methods, etc ?
Use LoaderInfo.content to access the loaded swf. private function loadViewElements():void { var module1Loader:Loader = new Loader(); module1Loader.contentLoaderInfo.addEventListener( Event.COMPLETE, completeHandler); // Create and load the Views NUMBERPAD = new MovieClip(); NUMBERPAD.name = numberPad; addChild( NUMBERPAD ); NUMBERPAD.addChild( module1Loader ); var moduleURL:URLRequest = new URLRequest(views/view.swf); module1Loader.load(moduleURL); } private function completeHandler(evt:Event):void { var loader:LoaderInfo = evt.currentTarget as LoaderInfo; trace(- loader content: +loader.content); (loader.content as MovieClip).gotoAndStop(10); } - Original Message - From: eric e. dolecki [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Tuesday, September 11, 2007 2:48 PM Subject: [Flashcoders] Access loaded SWF variables, methods, etc ? I am loading a SWF into a movieclip and want to access variables, etc. from my main class. I have this in my main document class: private function loadViewElements():void { var module1Loader:Loader = new Loader(); module1Loader.contentLoaderInfo.addEventListener( Event.COMPLETE, completeEvent ); module1Loader.contentLoaderInfo.addEventListener( IOErrorEvent.IO_ERROR, ioError ); // Create and load the Views NUMBERPAD = new MovieClip(); NUMBERPAD.name = numberPad; addChild( NUMBERPAD ); NUMBERPAD.addChild( module1Loader ); var moduleURL:URLRequest = new URLRequest( views/view.swf ); module1Loader.load( moduleURL ); } private function completeEvent( event:Event ):void { trace( event.target + loaded ); trace( NUMBERPAD.getChildAt(0) ); var who = getChildByName( numberPad ); trace( who.name ); trace( who.iam ); } Inside the loaded SWF I have a simple variable: var iam:String = view; I am trying to find a decent way to navigate things in the loaded SWF. I must be overlooking something? - eric ___ 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] Text Editor Undo/Redo Stack
show us! :) James Marsden schrieb: Hallo, The text editor app is up and running now, thanks to those folks that offered suggestions. I've got everything working apart from the pasting of text. Does anyone know how it is possible to do this? Any cool tricks to access the clipboard from ActionScript (I've had a look online and found nowt). Cheers! James dr.ache wrote: Command done on the text! A command representing the action and the amount, like cut from location 3 to 24 of the text. The text you cut of must also be saved, certainly! James Marsden schrieb: ___ 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] increasing real memory use
Hi list, I created a kioks application that needs to display data (text and images) 24/7. The flash projector file however uses more and more real memory from the start on. I therefore created a simple version of it as can be seen in the code below. It contains four classes: Application.as, Een.as, Twee.as and Three.as. When this simplified version runs the task manager (windows) or activity monitor (mac) reveals a data leak even though I clear up vars and listeners. The code is pretty simple, still I can't find out for quite a while now what the problem can be. Regards, Tom // Application.as // Application.as // Application.as // Application.as // Application.as // Application.as // Application.as // Application.as // Application.as import classes.*; class classes.Application { static var root_p:MovieClip = _root; function Application() { var een:Een = new Een(); var twee:Twee = new Twee(); var drie:Drie = new Drie(); root_p.een = een; root_p.twee = twee; root_p.drie = drie; root_p.een.display(); } } //Een.as //Een.as //Een.as //Een.as //Een.as //Een.as //Een.as //Een.as //Een.as //Een.as //Een.as //Een.as //Een.as //Een.as //Een.as //Een.as //Een.as import classes.*; class classes.Een { static var root_p:MovieClip = _root; function Een() { } function display() { root_p.twee.display(); } } //Twee.as //Twee.as //Twee.as //Twee.as //Twee.as //Twee.as //Twee.as //Twee.as //Twee.as //Twee.as //Twee.as //Twee.as //Twee.as //Twee.as //Twee.as import classes.*; class classes.Twee { static var root_p:MovieClip = _root; function Twee() { } function display() { loadNewImage(); } function loadNewImage() { var _this:Object = this; var image_p:MovieClip = root_p.attachMovie(void, image_mc, 0); var ml:MovieClipLoader = new MovieClipLoader(); var l:Object = new Object(); l.onLoadInit = function(target_mc:MovieClip) { if(target_mc == image_p) { var c:Number = 0; root_p.onEnterFrame = function() { if(c == 20) { c = null this.onEnterFrame = null; delete this.onEnterFrame; root_p.drie.display(ml, l); } else { c++ } } } } ml.addListener(l); ml.loadClip(2246.jpg, image_p); } } //Drie.as //Drie.as //Drie.as //Drie.as //Drie.as //Drie.as //Drie.as //Drie.as //Drie.as //Drie.as //Drie.as //Drie.as //Drie.as //Drie.as //Drie.as //Drie.as //Drie.as // import classes.*; class classes.Drie { static var root_p:MovieClip = _root; function Drie() { } function display(ml:MovieClipLoader, l:Object) { ml.unloadClip(root_p.image_mc); root_p.image_mc.removeMovieClip(); ml.removeListener(l); ml = null; l = null; var c:Number = 0; root_p.onEnterFrame = function() { if(c == 400) { this.onEnterFrame = null; delete this.onEnterFrame; c = null; root_p.een.display(); } else { c++ } } } } ___ 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] IOErrror using URLLoader with files bigger than a fewkb
Use POST instead of GET for large data. var dataStrEncoded:String=Base64.Encode(ByteLoader.data); var XMLString:String; XMLString = '?xml version=\1.0\ encoding=\UTF-8\?'; XMLString = 'file'; XMLString += '![CDATA[' + dataStrEncoded + ']]'; XMLString += '/file'; _loader = new URLLoader(); _loader.addEventListener(Event.COMPLETE,fileUploadCompleteListener); _loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorListener); var scriptPath:String = uploadUrl + ?key= + _key +session= + _sessionId; var request:URLRequest = new URLRequest(scriptPath); request.method = URLRequestMethod.POST request.data = XMLString; _loader.load(request); regards, Muzak - Original Message - From: Paul Steven [EMAIL PROTECTED] To: flashcoders@chattyfig.figleaf.com Sent: Tuesday, September 11, 2007 2:57 PM Subject: [Flashcoders] IOErrror using URLLoader with files bigger than a fewkb I am having problems using URLLoader to send data to a server side script. What I am doing is loading in a file as binary data and converting to Base64 then sending this Base64 string within an xml string. It is working fine with very small files of only a few kb. However if the files are larger than this, I get an IOError#2032 The client insists there is no problem at the server side and I cannot think of anything else to try my end. Is there any possibility that with larger files, the Base64.Encode operation has not completed before the data is sent? Here is the relevant code: var dataStrEncoded:String=Base64.Encode(ByteLoader.data); var XMLString:String; XMLString = '?xml version=\1.0\ encoding=\UTF-8\?'; XMLString = 'file'; XMLString += '![CDATA[' + dataStrEncoded + ']]'; XMLString += '/file'; var scriptPath:String = uploadUrl + ?xml= + XMLString + key= + _key + session= + _sessionId; _loader = new URLLoader(); _loader.addEventListener(Event.COMPLETE,fileUploadCompleteListener); _loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorListener); var request:URLRequest = new URLRequest(scriptPath); _loader.load(request); ___ 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] Attaching webcam video dynamically and on top
Hi Alexander, You can create a video symbol in the library by using the library's menu. As for depth, have you tried putting the video in a movie clip and swapping the depths of that movie clip? That should work. By the way, ElectroServer 4 supports video as well (to add that to your list). http://www.electro-server.com Jobe Makar http://www.electrotank.com http://www.electro-server.com phone: 252-627-8026 mobile: 919-609-0408 fax: 919-882-1121 - Original Message - From: Alexander Farber [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Tuesday, September 11, 2007 10:20 AM Subject: [Flashcoders] Attaching webcam video dynamically and on top Dear flash coders, I have a MovieClip+class called User which represents a player (one of 3) in my small multi-player card game: http://preferans.de/images/pics/Pref-Aug-07-2.jpg It works well and usually displays a player avatar (an image, that I load by a MovieClipLoader). If a player has a webcam connected I'd like to overlay his avatar image however by the webcam video. I know that I have to use Red5 or FMS etc... but currently I'm struggling with the basic problem, that I don't know how to attach a Video object dynamically to the stage. After searching I even suspect, that this is not possible at all and I can only do it in the authoring environment (sans AS). But even if I do it in authoring environment (and pass its name as a string to my user.attachWebcam() method), I still have the problem, that the video is underneath the avatar. I've tried: _root.my_video.swapDepths(5000); but this doesn't work. Any ideas please? Here is a test case movie representing my problem: http://preferans.de/flash/User.swf Regards Alex ___ 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] Isometic game - zdepth managing for multiple movablecharacters
Every object gets a z-depth assigned. For the players the zdpeth need to be set based on the tile they are at. This way the players can walk 'around' the enviorment objects. For the z-depth calculation I use the tile grid x and y plus the width of the row, this generates an unique z-depth number and makes sure that the higher the y, the bigger the z-depth , thus objects appear infront of objects with a lower y index. Here is the problem I am trying to figure out. If two movable objects, or even three of them are at the same time on the same tile, then the above described z-depth managing will fail. How do I deal with that? If this is possible in your game then you'll need to either store sub-tile positions and z-sort further on those (you could, for example, assign ten z-slots per tile to ensure that you have more space) or randomly choose one to be in front of the other (if there's only one position per tile, then it doesn't matter which one gets drawn in front). Then another question I have is this. Does every movable object needs to check/swap z-depth on every frame. Wouldn't that be to CPU intensive? Depends how you do it. If there's only a few movable objects, this shouldn't be particularly hard on the machine - Flash isn't the fastest thing in the world, but it's fast enough for that. However, you can optimise quite a bit by sub-sorting - if you know that object 1 is in the rear 16 tiles and object 2 is in the front 16 tiles, no need to check the z-order. 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] How to share class library across a network?
Sounds like the ASO cache problem. Try Delete ASO files and Test Movie from the Control menu. Making sure that all computers in the Network have the exact same time (PC clock) may prevent this from happening. regards, Muzak - Original Message - From: Alistair Colling [EMAIL PROTECTED] To: flashcoders@chattyfig.figleaf.com Sent: Tuesday, September 11, 2007 5:29 PM Subject: [Flashcoders] How to share class library across a network? Hi there, I would like to share my class library with other developers on my local network. We are soon to be using Version Cue or something similar but in the meantime it would be good if we could al be working from the same class library (there are only 2 of us). Almost every time we exchange a file lots of compiler errors are thrown up even though the class paths are set correctly, this is usually rectified after restarting the computer or Flash. I have copied my class library to a network share but when I compile a SWF from Flash I get lots of compiler errors starting with line 6 of toplevel.as 'The class or interface 'Boolean' could not be loaded' 'The class or interface 'Object' could not be loaded' 'The class or interface 'Number' could not be loaded' If I point my class path (set in my AS preferences for the Flash app) to an exact copy of the same folder but on my local drive everything works fine! If someone could help me out here I would be really grateful, this is proving a real headache! Cheers, Ali ___ 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] this.stage.focus causes Sandbox violation?
I have a line of code in one of my classes that says: this.stage.focus = ioFocus; where ioFocus is an InteractiveObject that is passed into a function. When my program hits this line (and ioFocus at the time is a TextField), flash shows me this: *** Security Sandbox Violation *** SecurityDomain 'file:///C|/Projects/MediaManager/src/main.swf' tried to access Player UI context Anyone have any idea why this would happen? Strange because there are other points in my program where this same exact class is used and this error doesn't get thrown. The class is a DialogBox class I wrote that has a method called show. So when I call DialogBox.show(), it returns a Sprite. One of the parameters of the show() method is an InteractiveObject that should be focused once the DialogBox is open, this is where my code goes a bit crazy. The class is called (in this case) from the document class, if that matters... MR ___ 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] toString(aArray[i]) ?? does this work
You say [object Object] is the correct output if the object is a movie clip. This isn't the behavior I see. Any time I trace a movie clip I get the clip's name (level0.foo.bar.whatever), not the generic object results. -Andy On 9/11/07, Hal Leonard [EMAIL PROTECTED] wrote: Try toString(aArray[i]._name) instead I'm not 100% sure what you're storing in your array, but it sounds like you're storing movieClip objects in there, in which case the result [object Object] would be the correct output. Hal -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Monday, September 10, 2007 8:30 PM To: Flash Coders Subject: [Flashcoders] toString(aArray[i]) ?? does this work Quick question, can I toString an array element. ie: var myStr:String = toString(aArray[i]);// where 'i' is the increment. I am having an issue with this. when I trace myStr it traces [object object] instead of what I intended/expected mcMovieClipName14 as a string. Any insite would be appreciated. Thanks in advance, Paul V. ___ 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] How to share class library across a network?
Try mapping the network share to a drive letter (I'm assuming you're in Windows here). Some tools don't work well with network paths, but if you map the shared folder to a drive letter then it would appear to those tools as a local path. That might help fix your compile errors. -Andy On 9/11/07, Alistair Colling [EMAIL PROTECTED] wrote: Hi there, I would like to share my class library with other developers on my local network. We are soon to be using Version Cue or something similar but in the meantime it would be good if we could al be working from the same class library (there are only 2 of us). Almost every time we exchange a file lots of compiler errors are thrown up even though the class paths are set correctly, this is usually rectified after restarting the computer or Flash. I have copied my class library to a network share but when I compile a SWF from Flash I get lots of compiler errors starting with line 6 of toplevel.as 'The class or interface 'Boolean' could not be loaded' 'The class or interface 'Object' could not be loaded' 'The class or interface 'Number' could not be loaded' If I point my class path (set in my AS preferences for the Flash app) to an exact copy of the same folder but on my local drive everything works fine! If someone could help me out here I would be really grateful, this is proving a real headache! Cheers, Ali ___ 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] AS2 Sound.stop()
Each Sound() object is attached to a particular timeline. So if you do : (new Sound(_root)).stop() everything from _root downwards should stop. HTH, Ian On 9/11/07, Andrew Sinning [EMAIL PROTECTED] wrote: I don't understand the docs for the AS2 Sound.stop command. my_sound.stop([idName:String]) : Void I can't find any documentation about sounds having an idName. Method; stops all sounds currently playing if no parameter is specified, or just the sound specified in the idName parameter. But my_sound is an instance of the Sound class, so why would I need to specify an id? This seem to imply that I could use Sound.stop(); to stop all sounds currently playing. But it won't compile. I get Sound has no static field stop. So, how do you stop all currently playing sounds? Thanks! ___ 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] Displaying Progress of calls to external scripts
Is it possible the server that's providing the XML isn't providing the content length in the response headers? Without this Flash won't know what the total size is, which could explain why you're getting 0. -Andy On 9/11/07, Paul Steven [EMAIL PROTECTED] wrote: I am calling several external scripts in my app using the URLLoader. These calls return xml data. I am trying to display the progress of the data flow using the event.Progress as follows but I am not getting very good results. It is currently displaying the following. Loaded: 349 Total: 0 Percent Infinity Perhaps this is not possible? _loader.addEventListener(ProgressEvent.PROGRESS, handleProgress); var request:URLRequest = new URLRequest(scriptPath); request.method = URLRequestMethod.POST; var variables:URLVariables = new URLVariables(); variables.xml = dataToSend; request.data = variables; _loader.load(request); private function handleProgress(event:ProgressEvent):void { var percent:Number = Math.round(event.bytesLoaded / event.bytesTotal * 100); _sessionInstance.progressTxt = Loaded: + event.bytesLoaded + \n + Total: + event.bytesTotal + \n + Percent + percent; } ___ 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] Traversing through Object goes backwards
Objects work pretty much like hashtables (from my understanding). Hashtables generally don't guarantee any kind of ordering. Flash may enforce some kind of ordering (y seems to be going in reverse order of when things were added) but I don't know of any ordering and generally treat it as arbitrary. Now, if you were using Arrays then your ordering would be guaranteed (for-in loops go backwards through the array I believe). -Andy On 9/11/07, Mendelsohn, Michael [EMAIL PROTECTED] wrote: Hi list... I want object y, below, to output in the same order as x. Is it possible? Thanks, - Michael M. x = {a:first, b:second, c:third}; for (i in x) { trace(i + : + x[i]); } /* output: a: first b: second c: third */ y = new Object(); y[a] = first; y[b] = second; y[c] = third; for (i in y) { trace(i + : + y[i]); } /* output: c: third b: second a: first */ ___ 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] Progressive Download De-Caching Slowing Startup
I've got a FLV player that I've written that is a dual FMS and Progressive Download player and I am noticing a disturbing slow startup using the Progressive Download technique when the FLV has been cached on the user's hard drive at startup. When the user returns after caching the whole movie, basically the whole browser/flash web page halts while the 37MB FLV is loaded into memory. After that, of course, I see very good performance. How can I prevent this - or slow it down - or do something to keep the user experience from being stymied when they return to watch a video they've already cached? It looks sometimes like it might crash... Jeff Harrington http://jeffharrington.org ___ 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] AS2 Sound.stop()
If you had the sound imported into your library, assigned a linkage ID, and then attached it using Sound class's attachSound method, you'd have a 'idName'. If you loaded your audio clip using loadSound method, you wouldn't have a linkageID. So don't worry abt it. Sound has no static field stop. 'coz, as the error message states, there is no static method called 'stop' in the Sound class. You should've called stop() on ur Sound class object - my_sound. - my_sound.stop() -- Arul Prasad http://arulprasad.blogspot.com On 9/12/07, Andrew Sinning [EMAIL PROTECTED] wrote: I don't understand the docs for the AS2 Sound.stop command. my_sound.stop([idName:String]) : Void I can't find any documentation about sounds having an idName. Method; stops all sounds currently playing if no parameter is specified, or just the sound specified in the idName parameter. But my_sound is an instance of the Sound class, so why would I need to specify an id? This seem to imply that I could use Sound.stop(); to stop all sounds currently playing. But it won't compile. I get Sound has no static field stop. So, how do you stop all currently playing sounds? Thanks! ___ 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] AS3 Sound = wtf
Why don't you: 1. List down your queries, and ask for suggestions / help from the community here 2. Write to adobe's feature request list about the features you think are missing, but essential 3. Stop ranting on the list, and go use ur personal blog for this crap. Btw, Stop looking for detailed examples for sound APIs inside a design patterns book or a 'Making things move' book. ~Arul Prasad. On 9/12/07, Andreas Rønning [EMAIL PROTECTED] wrote: So i got my AS3 books finally. Essential AS3 by Moock, AS3 animation/making things move and AS3 design patterns. Of these 3, none give particular interest in the sound API. Making things move takes a fleeting glance at AS3 sound, limited to a = new Sound(); a.play();, and Design Patterns makes an equally simple example. The AS3 docs (F1 in the IDE) suggests a hack of a class to encapsulate Sound handling and otherwise assures us that the AS3 api is powerful. I still fail to see why. When Andre Michelle makes an AS3 303 emulator we're all impressed, but we somehow fail to realize he made it with *hacks*. Advanced AS3 sound manipulation is effectively barred to those not of his calibre. For the rest of us, we're stuck waiting for someone to build a robust sound control API wrapper for AS3's frankensteinian mess. In my opinion, AS3 sound is only as strong as you're willing to take punishment. Things were rough in AS2, but we could work it. In AS3 it's equally rough, with added edges. Considering the *vast* improvements AS3 and the new VM gave us, i find it bewildering how something so core to the multimedia experience has been either ignored completely or thrown in as an afterthought. I'm told by peers that oh you know, Sound is weak in Flash. Like a dogma. Which makes me think engineers threw a roundtable to somehow assure that in their shiny new VM, Sound remained weak. I have never seen an AS topic so skirted. It's like a dark secret nobody really wants to discuss. Like pooping. Either people out there *don't care about sound* which blows my mind, or Adobe didn't give a shit. I'm trying to port my AS2 3d sound positioning and effects control library to AS3 and, right now, it's disillusioning and sometimes infuriating. Dual stop methods for streaming and preloaded audio, the contextually wrong of which doesn't generate exceptions, but sound glitches. Soundchannels allow for quick and easy orphaning of sound. Go orphans! Soundmixer only really stopping sound and giving an *incomplete* spectrum, ignoring Microphone. There's parts of AS3 that force us to get stricter, and this is fine. The sound library forces us to either wrap or get sloppy. So am i right about this? Do Flash developers really care this little about audio? Positive sides? Loading sound resources externally and SoundTransform. And still being able to actually play audio. I don't know of a fix for this beyond doing the sound API over with a little more consideration. But i'd love to hear some best practises and experiences from other developers. Anything to learn more about this POWERFUL NEW API. Yeah. - Andreas SJ ___ 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 -- Arul Prasad http://arulprasad.blogspot.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] AS3 Sound = wtf
I don't have CS3 yet, but what is that ? : Sound.computeSpectrum() This method analyzes all the sound that played and returns a ByteArray containing 512 normalized values (-1 to 1) that you can use to visually display the sound waveform (256 values for the left channel and 256 values for the right channel). You can use these values to create Audio Equalizers for Media Players as well as visual experiments that react to the sound that played. ? Cedric So i got my AS3 books finally. Essential AS3 by Moock, AS3 animation/making things move and AS3 design patterns. Of these 3, none give particular interest in the sound API. Making things move takes a fleeting glance at AS3 sound, limited to a = new Sound(); a.play();, and Design Patterns makes an equally simple example. The AS3 docs (F1 in the IDE) suggests a hack of a class to encapsulate Sound handling and otherwise assures us that the AS3 api is powerful. I still fail to see why. When Andre Michelle makes an AS3 303 emulator we're all impressed, but we somehow fail to realize he made it with *hacks*. Advanced AS3 sound manipulation is effectively barred to those not of his calibre. For the rest of us, we're stuck waiting for someone to build a robust sound control API wrapper for AS3's frankensteinian mess. In my opinion, AS3 sound is only as strong as you're willing to take punishment. Things were rough in AS2, but we could work it. In AS3 it's equally rough, with added edges. Considering the *vast* improvements AS3 and the new VM gave us, i find it bewildering how something so core to the multimedia experience has been either ignored completely or thrown in as an afterthought. I'm told by peers that oh you know, Sound is weak in Flash. Like a dogma. Which makes me think engineers threw a roundtable to somehow assure that in their shiny new VM, Sound remained weak. I have never seen an AS topic so skirted. It's like a dark secret nobody really wants to discuss. Like pooping. Either people out there *don't care about sound* which blows my mind, or Adobe didn't give a shit. I'm trying to port my AS2 3d sound positioning and effects control library to AS3 and, right now, it's disillusioning and sometimes infuriating. Dual stop methods for streaming and preloaded audio, the contextually wrong of which doesn't generate exceptions, but sound glitches. Soundchannels allow for quick and easy orphaning of sound. Go orphans! Soundmixer only really stopping sound and giving an *incomplete* spectrum, ignoring Microphone. There's parts of AS3 that force us to get stricter, and this is fine. The sound library forces us to either wrap or get sloppy. So am i right about this? Do Flash developers really care this little about audio? Positive sides? Loading sound resources externally and SoundTransform. And still being able to actually play audio. I don't know of a fix for this beyond doing the sound API over with a little more consideration. But i'd love to hear some best practises and experiences from other developers. Anything to learn more about this POWERFUL NEW API. Yeah. - Andreas SJ ___ 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] toString(aArray[i]) ?? does this work
Andy, I see what you are saying, I think. That the .toString() has to be used as a method directly being addressed by the object. Like I said that what I think you are saying. How ever it seems I still can not get the string myMCinArray1 or myMCinArray2 or myMCinArray3 etc when I use the toString on an array Element. By the way, the scope in this case is actually the Array lement(MovieClip) -see coded snippet setInterval(rollOvers,10); //calls function 100/second to function rollOvers(){ for (i=0; iaArray.length; i++) { aArray[i].onPress = function() { var myStr:String = aArray[i].toString(); //* THIS LINE trace(myStr);// still traces [object object] trace(i); //gives me 126 .which is the array length. if I could get this to give me the value of the Array element clicked I would fine too. }; It's nothing to do with the fact that it's in an array. toString() always gives [Object object] for movieClips. Try it: make a vanilla movie, put in a single movieclip called 'wossname' then put 'trace(wossName.toString()' in the first frame. If you want to get its name, put aArray[i]._name, as suggested previously. 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] Help with listener for custom class (AS3)
From your cssLoaded and xmlLoaded methods, dispatch an event each, announcing the completion of load. eg public function xmlLoaded(event:Event):void { newXML = XML(event.target.data); dispatchEvent(new Event(xmlLoaded)); } And on the timeline, you can add a listener to that event by doing this: var fileForThis:fileImports = new fileImports(courseInfo.xml,styles.css); fileForThis.addEventListener(xmlLoaded, onXMLLoad); function onXMLLoad() { // xml loaded now } Of course thats not the best way to code ( you could create a custom event object to pass more data etc, ) but the above should get you started. Btw, your 'fileImports' class doesnt seem to be a UI class, so you dont have to extend it from Sprite. Just extend EventDispatcher class. ~Arul Prasad. On 9/12/07, Dane Williams [EMAIL PROTECTED] wrote: Greetings All, I'm trying to do more and more of my projects with external classes and, along with that, creating classes for routines that I regularly do. I have a class that reads an XML file and CSS file once it's called. It has worked fine for the first few projects I used it in. With my recent project, it's not wanted to behave. The code for the class is as follows: package { import flash.display.Sprite; import flash.text.StyleSheet; import flash.events.*; import flash.net.*; public class fileImports extends Sprite { public var newStyleSheet:StyleSheet = new StyleSheet(); public var newXML:XML = new XML(); public function fileImports(xmlFile:String, cssFile:String):void { //load css file var cssToLoad:URLRequest=new URLRequest(cssFile); var cssLoader:URLLoader = new URLLoader; cssLoader.load(cssToLoad); //load xml file var xmlToLoad:URLRequest=new URLRequest(xmlFile); var xmlLoader:URLLoader = new URLLoader;; xmlLoader.load(xmlToLoad); //event listeners xmlLoader.addEventListener(Event.COMPLETE,xmlLoaded); cssLoader.addEventListener(Event.COMPLETE, cssLoaded); } public function cssLoaded(event:Event):void { newStyleSheet.parseCSS(event.target.data); } public function xmlLoaded(event:Event):void { newXML = XML(event.target.data); } } } I am creating an instance on my main timeline with this: var fileForThis:fileImports = new fileImports(courseInfo.xml,styles.css); I am trying to use the data that is coming in with the XML file to populate some combo boxes. My problem is I don't know how to listen to the class from the main timeline to find out if the class is finished processing the XML. Right now if I try to use fileForThis.newXML I get a value of null. But if I put a trace on newXML in the class, it shows the content of my XML file. I have gotten this to work on other projects because I haven't tried to use the data immediately - so the data has time to process before it's put into a text field, etc. I appreciate any help I can get on this. Thanks! D. Dane Williams The Learning Center Buckman Laboratories, International 901-272-6774 ___ 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 -- Arul Prasad http://arulprasad.blogspot.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] dynamically attaching a movie clip to a class/object
You should be assigning the movieclip reference being returned from attachMovie to your myPost variable: myPost = _root.attachMovie(signPost, myPost, _root.getNextHighestDepth()); Without that, your myPost variable is gonna be pointing to nothing. ~Arul Prasad. On 9/12/07, Charles Parcell [EMAIL PROTECTED] wrote: You are not defining what the movie should be attached to. Try: _root.attachMovie(signPost, myPost, _root.getNextHighestDepth()); Note that I removed this.getNextHighestDepth(). Because this does not exist on the stage yet, you can not get its next highest depth. Charles P. On 4/26/07, sebastian chedal [EMAIL PROTECTED] wrote: hello flash coders! ive just joined and there are some nice discussions here, i hope to contribute positivly to the level of knowledge in the group. :) i'm currently learning how to work in an OOP manner in flash, and thus meeting some basic hurdles. it would be very kind of you if you could assist me in my [probably very simple] problems. :-) I'm using external *.as files, and at the moment i am trying to figure out how to attach a movie to it [should be simple, right?] my as file: class Post extends CoreClass { private var myPost:MovieClip; public function setCord(px,py,pz):Void { //set coordinates public var px:Number = px; public var py:Number = py; public var pz:Number = pz; //original point locations private var ox:Number = px; private var oy:Number = py; private var oz:Number = pz; } public function attachMe ():Void { attachMovie(signPost, myPost, this.getNextHighestDepth()); myPost._x = 0; myPost._y = 0; trace (myPost = + myPost._x); } } In frame 1 of the movie i write: Post0 = new Post (); //Post0.setCord(100,100,0.9); Post0.attachMe(); The trace comes up 'undefined' if i use the 'attachmovie' from the root in the main time line, it works just fine. any clues? thanks! sebastian / amsterdam ___ 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 -- Arul Prasad http://arulprasad.blogspot.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] One swf loading another, but never complete/initing
I have one swf whose sole purpose is the loading of another swf and showing the progress of that load. There's currently a textfield in the fla which I use just to see progress and status of the load. The embedded code for it is as follows: var loader:Loader = new Loader(); var ctxt:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain); loader.contentLoaderInfo.addEventListener(securityError, onLoaderError); loader.contentLoaderInfo.addEventListener(ioError, onLoaderError); loader.contentLoaderInfo.addEventListener(progress, onProgress); loader.contentLoaderInfo.addEventListener(init, onProgress); loader.load(new URLRequest(swf/frame.swf),ctxt); addChild(loader); tError.text = ; function onProgress(event:Event):void { tError.text = event.type + + event.target.bytesLoaded + : + event.target.bytesTotal; } function onLoaderError(event:Event):void { tError.text = Load Failed: + event.type; } The frame.swf is 31000 bytes. At the moment, the only thing that shows up is: progress 31000:31000 ad...nothing. No init, and when I had a completeHandler before, no complete. For that matter, the fact that it just automatically goes to 31000:31000, with no in between steps has me a bit suspicious. I'm updated to the latest Flash Player 9 with the security settings correctly permitting access. Any ideas/insights into something I've missed? ___ 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] test
Testing Mail please just ignore Surendar Reddy.K Software Developer [EMAIL PROTECTED] Ocimum Biosolutions ...enabling RD 6th Floor, Reliance Classic, Road No.1, Banjara Hills, Hyderabad - 500 034, A.P, India Business Phone: 55262700 | Mobile: 09849969760 | Fax: 556272505 BioIT Solutions | Microarrays | Oligonucleotide Synthesis | Research Services | Live Help Disclaimer: Please note that this e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient, please notify the system manager at [EMAIL PROTECTED] and destroy all copies of the original message. Any unauthorised use, disclosure, review, dissemination, forwarding, printing or copying of this email or any action taken in reliance on this e-mail is strictly prohibited. Any views or opinions presented in this email are solely those of the author and do not necessarily represent those of Ocimum. The recipient should check this email and attachments if any, for the presence of viruses. Ocimum accepts no liability for any damage caused by any virus transmitted by this email. - Original Message - From: Durairaj [EMAIL PROTECTED] To: flashcoders@chattyfig.figleaf.com Sent: Tuesday, September 11, 2007 4:08 PM Subject: [Flashcoders] test This is for test ignore please ___ 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