Re: [flexcoders] Re: AMFPHP and Value Objects
On 11/11/2008, at 2:03 PM, Amy wrote: --- In flexcoders@yahoogroups.com, Rich Rodecker [EMAIL PROTECTED] wrote: you definitely need the $_explicitType property in the php VOs. Yes, I'm trying to figure out ways to pry verification that that has been done out of the client ;-). That, and that the VO objects are in the services/vo/ folder. There is nothing you can do on the client side to make it return typed objects, so long as you actually have that type compiled into your application. Cheers, Nik
Re: [flexcoders] Panel as an itemrenderer in List ?
On 05/11/2008, at 1:02 AM, Jon Bradley wrote: On Nov 4, 2008, at 8:48 AM, Nik Derewianka wrote: 1) The Panel does not display it's title bar or drop shadow bordering, but seem to be displaying more as standard Box elements. 2) Trying to drag select text on a TextInput child in the panel item renderer causes the containing List dragMove to trigger causing it to try and drag the entire panel in the list, rather than just stay with selecting the text. For #1, I'm not sure what your code looks like so I don't know if I could offer any suggestions. I've stripped it right back of extraneous stuff and posted it: http://artofmultimedia.com.au/flex/test.html Click add a few times, no Panel chrome. On top of that, move your mouse over the list and only the last item added gets highlighted, dragging an item shows the drag proxy from the bottom item and the dropping is completely screwy. For #2, it sounds like you might need to add an event listener to dragMove and use preventDefault on the event, then use the Selection classes to set focus on the text instance and select it. Or, if possible, set dragMoveEnabled = false ? I need the dragMoveEnabled functionality of the list so that the user can re-order the panels. Going to have a crack at the preventDefault, I am assuming you mean listen on the dragMove event of the List, detect if the drag target is the panel and allow the drag, otherwise if it is one of the child display objects then call preventDefault on the event ?? Thanks, Nik
[flexcoders] Panel as an itemrenderer in List ?
Hi, I am trying to create a list of re-orderable panels, I have set it up so that the Panel is the itemrenderer, but seem to be running into a few issues: 1) The Panel does not display it's title bar or drop shadow bordering, but seem to be displaying more as standard Box elements. 2) Trying to drag select text on a TextInput child in the panel item renderer causes the containing List dragMove to trigger causing it to try and drag the entire panel in the list, rather than just stay with selecting the text. Any thoughts or suggestions ? Thanks, Nik
Re: [flexcoders] Re: Panel as an itemrenderer in List ?
On 05/11/2008, at 4:20 AM, Amy wrote: Try this: http://flexdiary.blogspot.com/2008/06/using-css-typeselector-with.html Heh, I don't care that my brain is slightly retarded from working on this most of the night - but there is no way I would have found that one any time soon. Many thanks Amy, Nik
Re: [flexcoders] Sound issues in Player 10
On 23/10/2008, at 9:59 AM, Matt Chotin wrote: Oh, and as a note to everyone. If you have a site that worked in FP9 and not in FP10, that's generally a bug (unless it's due to security changes) and should be filed in JIRA ASAP :-) If the url is public, that's good enough. Does the flash player auto update clients, or only when they encounter content that requires the user to upgrade their plugin (i don't actually know as we always install as soon as we can :P) Generally, what is Adobe's course of action here ? A bug fix update in the next few months, possibly sooner ?? I've got quite a few users that will have their browsers crashing on all platforms when they come to our site and I am not looking forward to the support issues. (Yes its already logged in JIRA). Cheers, Nik
Re: [flexcoders] Re: Every second time I debug my app, Flex closes Safari :(
Yep or close the window with the app before re-launching the debug session also works as well. FB on OSX has a lot of drawbacks - on win, the help gets its own window (so it doesn't get killed by the debugging), syntax colouring works better, images actually appear in design mode all the time, it builds a lot faster (iMac in BC spanks my mac pro in OSX), the text editor doesn't lag when doing fundamental things like selecting text. Oh and I love it when FB seems to get confused and tries to launch a debug session but in reality it's just sitting there and waiting to time out. At least embedded fonts still disappear on both platforms in between compiles for no apparent reason so I don't feel completely screwed over. If it was edge case stuff, it wouldn't be a problem, but this is stuff you have to put up with every couple of minutes. Nik
[flexcoders] FP10 final released
And it crashes IE7 and safari when closing the window on my main site. Fun. Nik
Re: [flexcoders] Changing the Default Colour and Preloader
On 16/10/2008, at 1:03 AM, John wrote: I would like to change the preloader and the default colour that a Flex application has when it is downloading into the browser. Where is the best place to find out more about this? The Application object in the docs, namely the backgroundColor and preloader properties. Regards, Nik
[flexcoders] Tilelist scrolling issues
Hi, I have a 1 row, 6 column tilelist that i want to scroll left and right via two buttons, but not via the skin (its not appropriate for a bunch of reasons). What should I be calling from the buttons to scroll the tilelist forward and backwards through the dataprovider items ?? I have tried tlDisp.horizontalScrollPosition-- and tlDisp.horizontalScrollPosition++ which works for moving forward through the items, but when going backwards, only updates the first item being displayed in the tilelist. Is there some other way to do the scrolling ? Is this a bug in the tilelist ? Thanks, Nik
[flexcoders] Production inefficiency
Hi All, For those of you that are using lots of flash CS3 swf's, what is your folder organisation and publishing process ?? Right now we have everything including project folder ~/Documents/Flex Builder 3/Proj/ under subversion control. Everything that we want to publish (to localhost MAMP in this case) is under src/. The fla files are kept out of that src/ folder and have their publish settings set to publish into the src/swf/ folder. fla/ assets.fla src/ Application.mxml amfphp/ components/ AIRenderer.mxml crossdomain.xml remoting-config.xml services-config.xml swf/ assets.swf html-template/ However... the only reliable process to view a change in your CS3 swf's becomes: shift+F12 from flash (Publish), switch to eclipse, right click in Flex Navigator-refresh, cmd+B, switch to safari, close any window/tab with flex app in it, cmd+opt+e to empty cache, switch to eclipse, cmd+F11 to run your app with new content displaying. without the refresh, eclipse will not pick up the changed swf files. F11 will run the app, not copy across changed files. without emptying the cache in safari you will often get cached content (even though we are pulling in our swf's with a querystring parameter). without closing the window in safari, on F11 the applescript will close your freshly launched app window (along with all your help docs/ blogs/research). using firefox instead of safari means that you can't launch help as it errors out saying that firefox is already in use. eclipse will also not copy across empty folders (even though you need them in our output folder). Someone kindly point out a better way of doing this. Regards, Nik
Re: [flexcoders] Flex Builder Help on Mac falls a bit short
On 12/09/2008, at 3:08 AM, Troy Gilbert wrote: Now, I'm using FB on Mac (v3). The help is far less useful. When I hit F2, the help goes to the class's page, but doesn't jump to the function/property/style. Worse, the help uses my default web browser, so if I'm in the middle of debugging (a common time to need help!) nothing happens as FB has paused my browser's process (thus new windows don't pop up). Finally, if I search for something from within the help I get dozens of results before getting the actual class (e.g., search for DisplayObject doesn't show the DisplayObject class until many, many, many pages of results later (I assume... I actually gave up looking for it in the list). Experienced the exact same thing and was even going to write up about that exact same class. As Amy suggested the filtering does help, but mine now searches more intelligently even when the scope is changed back to all. Although it says it does it's indexing first up, I am still inclined to think that it still modifies or alters it's index later on, as DisplayObject now returns the class definition as 4th item and Properties and Methods of DisplayObject as the first item. I created a search scope that had just the refs, perhaps that forced it to clean up some ? Still doesn't resolve the browser window closing and browser blocking issues related to launching help and googling is far less useful considering the amount of cross over between flex 2/3 and flash and general AS3. Can't believe that i miss CHM files from VS.Net development. Regards, Nik
[flexcoders] Profiler
Hi, Does the profiler only report memory usage for the swf it is profiling and not the total memory for all swfs that my app loads in ?? Right now it is profiling myapp.swf which is loading in other media etc and it seemed to be flatlining on the memory report whereas a System.totalMemory call that i added to the application is reporting a much higher number that also increases correctly with the additional media that i load in. Perhaps there is some other option i can turn on to show cumulative memory use ?? Thanks, Nik
Re: [flexcoders] AMFPHP and date/datetime data from MySQL
Sajid, Still under a tight deadline atm, but this is what i have working for me so far: To write it to DB: public function create($obj) { $query = INSERT INTO Event ( DateStart, ) VALUES ( '.date(Y-m-d,mysql_real_escape_string($obj[DateStart])/1000).' To read it back out - the query: public function getOne($id) { $query = SELECT date_format(DateStart, '%a %b %e %T GMT+1000 %Y') as DateStart, Which will format the string exactly as new Date() outputs for me (couldn't quickly find a way to get the timezone + offset so it's hard coded). Then in my VO which is sent back via amf: ?php class EventsVO { var $_explicitType=vo.EventsVO; public $_DateStart; public function EventsVO() { } public function mapObject($data) { $this-_DateStart = $data[DateStart]; } } ? Take note that I have prepended the VO DateStart field with an underscore, the reason for this is apparent in the .as VO below: package com.aom.mfl.vo { [RemoteClass(alias=vo.EventsVO)] [Bindable] public class SEvent { public var _DateStart:String; public function SEvent() { } public function set DateStart(val:Date):void{ _DateStart = val.toString(); } public function get DateStart():Date{ if (_DateStart == null){ return new Date(); } return new Date(_DateStart); } } } Effectively the remoting will set the string of _DateStart but all other code throughout my flex app will refer to DateStart which returns the true Date object, you could create another private field to hold the Date object instead of parsing the string version on each request. Cheers, Nik
[flexcoders] AMFPHP and date/datetime data from MySQL
Hi All, Could anyone enlighten me as to how i should send and retrieve date and datetime data for inserting into MySQL via amfphp (1.9) with value objects ? If i edit the data directly in MySQL and then retrieve a vo with a Date datatype i get the following message: TypeError: Error #1034: Type Coercion failed: cannot convert 1970-01-01 to Date. So, I need to format the date in someway so that flex can deserialize it properly. Any insight would be greatly appreciated (am coming from .net land so new to both PHP and as3). Cheers, Nik
Re: [flexcoders] Re: Bindable Classes
On 03/09/2008, at 9:30 PM, Johannes Nel wrote: it does depend on the scale of your application. first off, to use custom events you do not need getters and setters, but it does depend on how you want to use it. my personal feeling around models are that they should always be generated, its such a waste of time to code 'em by hand. Are there any generators that you recommend ?? I am currently using FCG (which has just gone open source) after initially using the one from crazedcoders, but would love to know of any other ones out there. Regards, Nik
Re: [flexcoders] AMFPHP and date/datetime data from MySQL
On 04/09/2008, at 12:01 AM, Jason Reynolds wrote: Adobe has some date parsing methods in the as3corelib library -- http://code.google.com/p/as3corelib/ I suppose it depends on the format your storing the date, the way I've been handling it is using as3 to parse the date string that AMF returns. Not sure if this is the best way, I'd be open to a better one! Yeah, I am at the point where i will try populating the string of the date (php side) in a throw away prop and then on successful load coerce it into a true date object in the real prop that is then used for binding. But was hoping that if i got it in the right format serverside then the amf deserialization would just take care of it without having to write the converter code. The MySQL columns are date and datetime so there shouldn't be anything funky going on with the storage. Hope that helps, I can attempt to help more if it doesn't. I've been using AMFPHP for awhile now... would be nice to make any contacts that use it! Heh - i'll just say that it has been an... adventurous... experience getting upto speed on amfphp (or remoting of any kind for that matter). But now that it is mostly working, it is pretty sweet. I just hope to get the time to write up a comprehensive overview of all the pitfalls and assorted tidbits i found all over the net. Cheers, Nik
Re: [flexcoders] Where are the Scroll Bars on the Web Page At ?
In the html-template/index.template.html file change line ~77 to read body scroll=auto instead of the default which turns it off explicitly. And if someone tries to tell me again that he never creates a Flex application with the Application tag as the main container, then I encourage him to re-read what Out of the Box means. Hint: you can't create an application out of the box without an Application tag as the root. This default is wrong. It needs to change. Regards, Nik
[flexcoders] Scrolling in a TileList
TileList scrolling isn't making any sense to me. I have a TileList with an explicit height, row height and the itemRenderer also has an explicit height, yet when adding more items than can fit in the tilelist, it doesn't auto scroll (despite verticalScrollPolicy being auto or true). The Panel also doesn't display with the title bar chrome. What am I missing here ? Application ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=vertical mx:Script ![CDATA[ import mx.collections.ArrayCollection; [Bindable] public var myData:ArrayCollection = new ArrayCollection([{foo:blah},{foo:blah},{foo:blah},{foo:blah}, {foo:blah},{foo:blah}]); ]] /mx:Script mx:TileList height=700 columnWidth=400 rowHeight=300 columnCount=1 direction=vertical dataProvider={myData} id=emailItems itemRenderer=components.TestPanel verticalScrollPolicy=on/mx:TileList /mx:Application components/TestPanel = ?xml version=1.0 encoding=utf-8? mx:Panel xmlns:mx=http://www.adobe.com/2006/mxml; width=400 height=300 mx:Text text={data.foo}/ /mx:Panel Regards, Nik
[flexcoders] Get all class definitions in a loaded swf ?
Hi, Is there a way to load all the class definitions in a swf that load into my flex app ?? On a sample swf with 4 mc's named mc1,mc2,mc3,mc4, i have got it to: private function onSWFLoaded(event:Event):void{ var col:ArrayCollection = new ArrayCollection(); for (var i:Number = 1;i = 4;i++){ col.addItem(event.target.applicationDomain.getDefinition(mc + i) as Class); } var mc:MovieClip = new (col.getItemAt(0)) as MovieClip; trace(mc); } Which works with instantiating the loaded mc, but i want to get rid of the dependancy on getDefinition() and having to pre-know the class names. Be incredibly handy to be able to utilise my external swf's as asset containers if i can do this. Cheers, Nik
Re: [flexcoders] Re: No Scroll Bar in Browser
Out of the box Flex defaults to content being unviewable if the content is larger than the content window. There is no use case where this is desirable. If you have figured out how to turn on scrollbars for your flex app, have managed to style them, then you should be able to figure out how to turn off the browser scroll bars. Regards, Nik On 27/08/2008, at 4:55 AM, Tim Hoff wrote: However, if you have flex scrollbars that are skinned, you would then have a mix of scrollbar styles. Personally, I'd rather have the flex app consume the available browser space and manage all scrolling internally. - .02. -TH
[flexcoders] Stop Flex closing whole browser
Hi, So you have a whole bunch of pages open for your docs and samples, you compile your app, it launches and then hits an error and throws you back into debug mode in Flex. Sometimes when you press interrupt it will close the browser window instead of your flex app tab and you lose all your docs and references. Every time, without fail, if you do not close the previously launched flexapp tab, Flex will launch the newly compiled version and then half second later close the entire browser window. This is with Safari on OS X. This is such a productivity killer - is there some patch, hack, setting that i can change to stop this from happening ?? Regards, Nik
Re: [flexcoders] Help with binding (flex 3)
I have run into the same issue. My RemoteObject calls are already set to makeObjectsBindable so that doesn't seem to be the issue. Basically, if i have a view that is already displaying the bound object, then do a remoteobject call that replaces the existing bound object with a new one, the bindings do not update. Which makes sense as the replacement instance would not have the bindings of the current model object set on it. Instead, I have resorted to copying the props over to the existing model object so that the bindings and references stay intact, using this script: public class ObjUtil { import flash.utils.*; public function ObjUtil() { } public static function CopyProps(source:*,destination:*):void{ var def:XML = describeType(source); var properties:XMLList = [EMAIL PROTECTED] + [EMAIL PROTECTED]; for each (var property:String in properties ) { destination[property] = source[property]; } } } And is used like this: ObjUtil.CopyProps(e.result,userModel.currentUser); It is not immensely robust and still feels like i am missing something in regards to binding - but this works without a whole bunch of extra typing for each and every property that needs to be updated. Regards, Nik
[flexcoders] Intriguing AMFPHP sample
Hi, Was just looking through some blogs on AMFPHP and came across a php snippet that showed: function getSwf() { return new ByteArray(file_get_contents(my.swf)); } But no sample of what to do on the Flex side to turn it back into something useable. How would you convert that ByteArray of the swf file back to a MovieClip/SWFLoader/something displayable ?? Thanks, Nik
Re: [flexcoders] Problem with Subclipse...
The ignore option operates on a file/folder level in your working copy. Right click on an item in the Flex Navigator pane, go down to the Team menu and then select Add to svn:ignore. With regards to why something should be excluded - mainly because there is no point. When you commit a source revision, it should contain everything needed to create the output binaries (source files, resources, compiler/project settings etc). The only thing you gain by putting your output folders under version control is to have more stuff bloating up your repository. Even more annoyingly, you will end up with a dirty working copy that gets committed where nothing has changed except that someone rebuilt the project - this clutters your history and forces other team members to do an update where non was needed. This is not specific advice for Flex, this is pretty much given for any development environment under version control. Regards, Nik
Re: [flexcoders] getChildByName using it to get the value of a textbox
You need to cast it to the type of object you want to operate on: var test:TextBox = this.getChildByName(inputtext + 1) as TextBox; or var test:TextBox = TextBox(this.getChildByName(inputtext + 1)); The first form will return null if it cannot cast the displayObject to that type as opposed to the second which will cause an error. Of course the Eclipse help system is so utterly useless that searching for 'as' will return nothing and displayObject will not be in the first 3 items you search for. Regards, Nik
Re: [flexcoders] Re: getChildByName using it to get the value of a textbox
That #1009 error means that it returned a null from the first line because it couldn't find the child with that name. getChildByName is not recursive so you need to be mindful of the nesting of your requested object. The following app has the functionality working as you need it, but it also has a really handy listing function that displays all of the current children recursively (outputs to the console window in Flex, if you have the debug player) so that you can see the children that are present and how they are nested. Regards, Nik ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=vertical horizontalAlign=left mx:Script ![CDATA[ import mx.controls.Alert; private function showText(evt:MouseEvent):void{ var test:TextInput = this.getChildByName(test + 1) as TextInput; Alert.show(test.text); traceDisplayList(this); } public function traceDisplayList(container:DisplayObjectContainer, indentString:String = -):void{ var child:DisplayObject; for (var i:uint=0; i container.numChildren; i++) { child = container.getChildAt(i); trace(indentString, child, child.name); if (container.getChildAt(i) is DisplayObjectContainer) { traceDisplayList(DisplayObjectContainer(child), + indentString) } } } ]] /mx:Script mx:TextInput id=test1/ mx:Button label=Button click=showText(event)/ /mx:Application
[flexcoders] Project Clean/Build All
Ok, someone let me in on the secret. I do a project clean, verify that yes it empties out the directory except for the folders. Build All... for some reason it doesn't copy across ALL of the swf's. It used to. There is only one option on the Flex Compiler properties page to 'Copy all non-embedded files to output folder'. It is checked, and has been since the beginning of the project. Machine reboot etc doesn't fix this. Is Flex trying to be smart about what it copies ? Is there someway that I can force a copy of all files ? Secondly - We have fonts, with exported classes sitting in swc's that are then referenced by css on components. Compile first time, no problems text appears in the components, compile again after making no changes whatsoever to any source files. Text disappears from all components that reference it. Why would this happen ?, How can I stop it from doing that ? Regards, Nik
Re: [flexcoders] Re: How long to build a Flex app....
On 30/07/2008, at 12:52 AM, Jason B wrote: It really depends on the flex coder since each coder could take longer depending on thier understanding of the project and database functions etc...and whether or not they are building the middleware code too? We have an app with about 30 tabs and over 600 objects total on the flex code, and about 1400 lines in mxml and 3500 lines in action script. It took me about 1 month and im the only developer and im also developing the middleware and database writes with php too. The more you do the more you learn and faster too. --- In flexcoders@yahoogroups.com, Alan [EMAIL PROTECTED] wrote: I'm new to Flex, and having fun with it, but I'd like to get an idea how long these things take to make. It is also highly dependant on the scope of the project. For instance we are building an online kids portal with 4 mini games, avatar builder, news system, user/accnt management, educational animations, custom AS components, skins etc and we have 4 designers and 1 programmer (me) going at it pretty solidly for 2.5 months. This is also our first Flex project so learning curves are all over the place along with banging into things that Flex doesn't seem too crash hot with - but also discovering things that really make Flex shine over Flash. Regards, Nik
[flexcoders] Importing lots of symbols from swf for TileList
Hi All, I have a swf file that has 150+ symbols defined in it that i need to use in various TileLists in flex 3, so far all of the intro samples suggest that i use something like the following: [Embed(source='../swf/my.swf#mysymbol')] private var icon0:Class; Obviously there has to be a better way to import them all without declaring each separate symbol as a var in my mxml file. All of the symbols follow a naming convention so if someone could show me how i can embed the swf file once and then how i could build the symbols from that swf into an array, I should then be able to apply those arrays as dataproviders to my tileLists. Thanks in advance, Nik
[flexcoders] FMS3 sys reqs
Hi, Sorry for the slightly tangential post but Adobe support wants to charge me $12,595 AUD to tell me whether FMS3 will run on a certain linux kernel without issues. I have a few choice words in response that I don't need to repeat here. If there is a better forum for this question then kindly point me to it. Basically - there is a tech note: http://kb.adobe.com/selfservice/viewContent.do?externalId=kb402839sliceId=2 That says that on RHEL4 with kernel 2.6.9-42 FMS3 is restricted to 500 connections, rather than the ~1200 connections it could support and recommends that the kernel be downgraded to 2.6.9-22. What i want to know is - what about subsequent versions of the kernel, does the problem still exist ? Is anyone else here running FMS3 on RHEL 5 with no upper connection limitations ?? Thanks, Nik Derewianka
[flexcoders] Searching for a component
Hi All, Anyone have/seen a component w/ source that implements the functionality of OS X's finder column view ?? Cheers, Nik
Re: [flexcoders] Re: AIR vs DLL vs. External code?
On 8/28/07, dorkie dork from dorktown [EMAIL PROTECTED] wrote: this is just my opinion but i don't think adobe wants you to code outside of the box. i don't think they'll give you that much more access to the system. for one, security. any security issues would slow down adoption. two, cross compatibility. cross compatibility is one of the enticing features for developing for flash. you can write something that runs anywhere the flash player is available. any browser, any os it will look the same and run the same (so is the goal). Yes and no. Director is cross platform, third party extendable, network integrated and secure (for Verisigned shockwave xtras) and has been for nearly a decade. So no - allowing access to the host OS does not implicitly imply security or cross platform issues. Cross platform could be restricted by the developer using a single platform Xtra, however that was purely at the discretion of the developer, the key point being that the developer had a choice. It was also the developers choice to stay platform neutral and publish to mac/pc/web from the single project. But i do agree with you that they probably wont offer too much more than they already have partly because they already have a product that does it and secondly there are so many other things that would give them a greater benefit than platform integration which is already provided in some form by wrapper apps etc. Regards, Nik