Re: [flexcoders] Quickest way to test whether something is an Object not a subclass?
You could use the top level operator provided by Flex. The 'is' operator. Say I have a object of class ArrayCollection like below: var tmp:ArrayCollection = new ArrayCollection(); Now I can use the 'tmp' variable in following way: if (tmp is ArrayCollection) the result of the above if statement would be true. Same goes with the Object. If I have a class derived from Object and use the above if statement to see if the class object is Object, it would return me false. It would return me true for the class type which extends the object. Else you have a getQualifiedClassName ()method in the utils package as mentioned by Alex, to do the same thing. I hope this might help you. Regards, Amol. - Original Message From: Alex Harui [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Tuesday, November 6, 2007 1:19:05 PM Subject: RE: [flexcoders] Quickest way to test whether something is an Object not a subclass? getQualifiedClassNa me? From: [EMAIL PROTECTED] ups.com [mailto:flexcoders@ yahoogroups. com] On Behalf Of reflexactions Sent: Monday, November 05, 2007 11:44 PM To: [EMAIL PROTECTED] ups.com Subject: [flexcoders] Quickest way to test whether something is an Object not a subclass? What is the quickest/most effecient way to test whether something is a generic Object ie created using new Object or {...} as opposed to a class which extends Object. i.e I am trying to avoid using flash.utils. describeType tks !-- #ygrp-mkp{ border:1px solid #d8d8d8;font-family:Arial;margin:14px 0px;padding:0px 14px;} #ygrp-mkp hr{ border:1px solid #d8d8d8;} #ygrp-mkp #hd{ color:#628c2a;font-size:85%;font-weight:bold;line-height:122%;margin:10px 0px;} #ygrp-mkp #ads{ margin-bottom:10px;} #ygrp-mkp .ad{ padding:0 0;} #ygrp-mkp .ad a{ color:#ff;text-decoration:none;} -- !-- #ygrp-sponsor #ygrp-lc{ font-family:Arial;} #ygrp-sponsor #ygrp-lc #hd{ margin:10px 0px;font-weight:bold;font-size:78%;line-height:122%;} #ygrp-sponsor #ygrp-lc .ad{ margin-bottom:10px;padding:0 0;} -- !-- #ygrp-mlmsg {font-size:13px;font-family:arial, helvetica, clean, sans-serif;} #ygrp-mlmsg table {font-size:inherit;font:100%;} #ygrp-mlmsg select, input, textarea {font:99% arial, helvetica, clean, sans-serif;} #ygrp-mlmsg pre, code {font:115% monospace;} #ygrp-mlmsg * {line-height:1.22em;} #ygrp-text{ font-family:Georgia; } #ygrp-text p{ margin:0 0 1em 0;} #ygrp-tpmsgs{ font-family:Arial; clear:both;} #ygrp-vitnav{ padding-top:10px;font-family:Verdana;font-size:77%;margin:0;} #ygrp-vitnav a{ padding:0 1px;} #ygrp-actbar{ clear:both;margin:25px 0;white-space:nowrap;color:#666;text-align:right;} #ygrp-actbar .left{ float:left;white-space:nowrap;} .bld{font-weight:bold;} #ygrp-grft{ font-family:Verdana;font-size:77%;padding:15px 0;} #ygrp-ft{ font-family:verdana;font-size:77%;border-top:1px solid #666; padding:5px 0; } #ygrp-mlmsg #logo{ padding-bottom:10px;} #ygrp-vital{ background-color:#e0ecee;margin-bottom:20px;padding:2px 0 8px 8px;} #ygrp-vital #vithd{ font-size:77%;font-family:Verdana;font-weight:bold;color:#333;text-transform:uppercase;} #ygrp-vital ul{ padding:0;margin:2px 0;} #ygrp-vital ul li{ list-style-type:none;clear:both;border:1px solid #e0ecee; } #ygrp-vital ul li .ct{ font-weight:bold;color:#ff7900;float:right;width:2em;text-align:right;padding-right:.5em;} #ygrp-vital ul li .cat{ font-weight:bold;} #ygrp-vital a{ text-decoration:none;} #ygrp-vital a:hover{ text-decoration:underline;} #ygrp-sponsor #hd{ color:#999;font-size:77%;} #ygrp-sponsor #ov{ padding:6px 13px;background-color:#e0ecee;margin-bottom:20px;} #ygrp-sponsor #ov ul{ padding:0 0 0 8px;margin:0;} #ygrp-sponsor #ov li{ list-style-type:square;padding:6px 0;font-size:77%;} #ygrp-sponsor #ov li a{ text-decoration:none;font-size:130%;} #ygrp-sponsor #nc{ background-color:#eee;margin-bottom:20px;padding:0 8px;} #ygrp-sponsor .ad{ padding:8px 0;} #ygrp-sponsor .ad #hd1{ font-family:Arial;font-weight:bold;color:#628c2a;font-size:100%;line-height:122%;} #ygrp-sponsor .ad a{ text-decoration:none;} #ygrp-sponsor .ad a:hover{ text-decoration:underline;} #ygrp-sponsor .ad p{ margin:0;} o{font-size:0;} .MsoNormal{ margin:0 0 0 0;} #ygrp-text tt{ font-size:120%;} blockquote{margin:0 0 0 4px;} .replbq{margin:4;} -- __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Re: [flexcoders] Re: Quickest way to test whether something is an Object not a subclass?
Thnks for the correction. Will be a lot of help. thnx again. Amol. - Original Message From: reflexactions [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Tuesday, November 6, 2007 2:12:57 PM Subject: [flexcoders] Re: Quickest way to test whether something is an Object not a subclass? Nope, not for Object is returns true for every parent class type Button is UIComponent == true Button is Object == true and in your example you will actually find tmp is Object == true So no that wont work when its Object were talking about.. but getQualifiedClassNa me works just fine tks --- In [EMAIL PROTECTED] ups.com, Amol Pandhare genius_gen2k@ ... wrote: You could use the top level operator provided by Flex. The 'is' operator. Say I have a object of class ArrayCollection like below: var tmp:ArrayCollection = new ArrayCollection( ); Now I can use the 'tmp' variable in following way: if (tmp is ArrayCollection) the result of the above if statement would be true. Same goes with the Object. If I have a class derived from Object and use the above if statement to see if the class object is Object, it would return me false. It would return me true for the class type which extends the object. Else you have a getQualifiedClassNa me ()method in the utils package as mentioned by Alex, to do the same thing. I hope this might help you. Regards, Amol. - Original Message From: Alex Harui [EMAIL PROTECTED] To: [EMAIL PROTECTED] ups.com Sent: Tuesday, November 6, 2007 1:19:05 PM Subject: RE: [flexcoders] Quickest way to test whether something is an Object not a subclass? getQualifiedClassNa me? From: [EMAIL PROTECTED] ups.com [mailto:flexcoders@ yahoogroups. com] On Behalf Of reflexactions Sent: Monday, November 05, 2007 11:44 PM To: [EMAIL PROTECTED] ups.com Subject: [flexcoders] Quickest way to test whether something is an Object not a subclass? What is the quickest/most effecient way to test whether something is a generic Object ie created using new Object or {...} as opposed to a class which extends Object. i.e I am trying to avoid using flash.utils. describeType tks !-- #ygrp-mkp{ border:1px solid #d8d8d8;font- family:Arial; margin:14px 0px;padding: 0px 14px;} #ygrp-mkp hr{ border:1px solid #d8d8d8;} #ygrp-mkp #hd{ color:#628c2a; font-size: 85%;font- weight:bold; line- height:122%; margin:10px 0px;} #ygrp-mkp #ads{ margin-bottom: 10px;} #ygrp-mkp .ad{ padding:0 0;} #ygrp-mkp .ad a{ color:#ff; text-decoration: none;} -- !-- #ygrp-sponsor #ygrp-lc{ font-family: Arial;} #ygrp-sponsor #ygrp-lc #hd{ margin:10px 0px;font-weight: bold;font- size:78%; line-height: 122%;} #ygrp-sponsor #ygrp-lc .ad{ margin-bottom: 10px;padding: 0 0;} -- !-- #ygrp-mlmsg {font-size:13px; font-family: arial, helvetica, clean, sans-serif;} #ygrp-mlmsg table {font-size:inherit; font:100% ;} #ygrp-mlmsg select, input, textarea {font:99% arial, helvetica, clean, sans-serif;} #ygrp-mlmsg pre, code {font:115% monospace;} #ygrp-mlmsg * {line-height: 1.22em;} #ygrp-text{ font-family: Georgia; } #ygrp-text p{ margin:0 0 1em 0;} #ygrp-tpmsgs{ font-family: Arial; clear:both;} #ygrp-vitnav{ padding-top: 10px;font- family:Verdana; font-size: 77%;margin: 0;} #ygrp-vitnav a{ padding:0 1px;} #ygrp-actbar{ clear:both;margin: 25px 0;white-space: nowrap;color: #666;text- align:right; } #ygrp-actbar .left{ float:left;white- space:nowrap; } .bld{font-weight: bold;} #ygrp-grft{ font-family: Verdana;font- size:77%; padding:15px 0;} #ygrp-ft{ font-family: verdana;font- size:77%; border-top: 1px solid #666; padding:5px 0; } #ygrp-mlmsg #logo{ padding-bottom: 10px;} #ygrp-vital{ background-color: #e0ecee;margin- bottom:20px; padding:2px 0 8px 8px;} #ygrp-vital #vithd{ font-size:77% ;font-family: Verdana;font- weight:bold; color:#333; text- transform:uppercase ;} #ygrp-vital ul{ padding:0;margin: 2px 0;} #ygrp-vital ul li{ list-style-type: none;clear: both;border: 1px solid #e0ecee; } #ygrp-vital ul li .ct{ font-weight: bold;color: #ff7900;float: right;width: 2em;text- align:right; padding-right: .5em;} #ygrp-vital ul li .cat{ font-weight: bold;} #ygrp-vital a{ text-decoration: none;} #ygrp-vital a:hover{ text-decoration: underline; } #ygrp-sponsor #hd{ color:#999;font- size:77%; } #ygrp-sponsor #ov{ padding:6px 13px;background- color:#e0ecee; margin-bottom: 20px;} #ygrp-sponsor #ov ul
Re: [flexcoders] Scroll Position
Hi, You may use the following properties which all the containers in Flex have to do the set the scroll position. Check out the conainer properties which you would see in the Flex Help. Some of them are below : horizontalLineScrollSize : Number Number of pixels to move when the left- or right-arrow button in the horizontal scroll bar is pressed. horizontalPageScrollSize : Number Number of pixels to move when the track in the horizontal scroll bar is pressed. horizontalScrollPosition : Number The current position of the horizontal scroll bar. The same goes well replacing horizontal with vertical for the vertical scroll control. You can set the scroll value for the verticalScrollPosition property of the Canvas to get the desired output. like... canvasInstance.verticalScrollPosition = 30, where '30' could be your calculated value. Regards, Amol. - Original Message From: jmfillman [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Sunday, February 11, 2007 1:15:49 AM Subject: [flexcoders] Scroll Position I have canvas whose content scrolls verticaly about 3 pages. However, I don't want this to always start at the top, but is dependant on the user. The question is, how do I set the vertical scroll position to something other than the top, while still allowing the user to scroll up or down as needed? Get your own web address. Have a HUGE year through Yahoo! Small Business. http://smallbusiness.yahoo.com/domains/?p=BESTDEAL
Re: [flexcoders] Flex Coding Guidelines
Hi Fabio, The effort of bringing the coding guidelines in public is highly appreciated. Was looking for a compact guidelines stringent to actionscript coding from long time. Thanks, Amol. - Original Message From: Fabio Terracini [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Saturday, February 10, 2007 10:13:02 PM Subject: [flexcoders] Flex Coding Guidelines Folks, As my commitment to community I'm releasing, with DClick support, our Adobe Flex Coding Guidelines, a document about Flex (MXML and ActionScript) coding conventions that we use on a regular basis. The objective is clear: provide a common and consistent language to help code comprehension between developers. The practices established in this document are based on Java conventions, Flex 2 SDK and DClick team experience (including myself). By releasing this document, the idea is to help the community improve their Flex code by using coding conventions as well and hear feedback from community to continuously improve this document, that by now is a community asset. I'll be happy to have volunteers to form a committee or something to evolve this project further. This way, comments on this document (including the best practices) are very welcome! Involve yourself in this flexcoders thread, at the flexdev (listaflexdev. org - portuguese list on Flex) or at DClick weblog (http://blog. dclick.com. br/2007/02/ 10/adobe- flex-coding- guidelines/) English version: http://blog. dclick.com. br/wp-content/ uploads/adobe- flex-coding- guidelines- v12-english. pdf Portuguese version: http://blog. dclick.com. br/wp-content/ uploads/adobe- flex-coding- guidelines- v12-portugues. pdf Thanks, Fabio Terracini Do you Yahoo!? Everyone is raving about the all-new Yahoo! Mail beta. http://new.mail.yahoo.com
Re: [flexcoders] properties in components..
Hey Paul, Cool down men. See whenever we write a script in an mxml file you need write that script in a function. For example: Your code was: mx:Script ![CDATA[ x.label=jim ; ]] /mx:Script Put the same thing this way: mx:Script ![CDATA[ function init() { x.label=jim ; } ]] /mx:Script and call this function when you load the the mxml on the creationcomplete event like this:. this will solve your purpose. Amol. - Original Message From: Paul Andrews [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Thursday, February 8, 2007 3:10:27 PM Subject: [flexcoders] properties in components.. OK, this is driving me nuts. I'm using Flex Builder 2.01 on a PC. I have a very simple component (say test.mxml), code below, where I set a label value on a button using actionscript. I can get this to compile very simply and we're all happy. As soon as I edit the main application( main.mxml) to include this component: comp:test /comp:test main.mxml is happy but now I get a compile error (access of undefined property) in test.mxml saying that the button id is an undefined property. When I edit the test.mxml code, flexbuilder will happily give me code hints about the properties after I've put in the button id. What's going on? Maybe I just need more coffee? Paul ?xml version=1.0 encoding=utf- 8? mx:Canvas xmlns:mx=http://www.adobe. com/2006/ mxml width=400 height=300 mx:Script ![CDATA[ x.label=jim ; ]] /mx:Script mx:Button id=x label=fred / /mx:Canvas !-- #ygrp-mlmsg {font-size:13px;font-family:arial,helvetica,clean,sans-serif;} #ygrp-mlmsg table {font-size:inherit;font:100%;} #ygrp-mlmsg select, input, textarea {font:99% arial,helvetica,clean,sans-serif;} #ygrp-mlmsg pre, code {font:115% monospace;} #ygrp-mlmsg * {line-height:1.22em;} #ygrp-text{ font-family:Georgia; } #ygrp-text p{ margin:0 0 1em 0; } #ygrp-tpmsgs{ font-family:Arial; clear:both; } #ygrp-vitnav{ padding-top:10px; font-family:Verdana; font-size:77%; margin:0; } #ygrp-vitnav a{ padding:0 1px; } #ygrp-actbar{ clear:both; margin:25px 0; white-space:nowrap; color:#666; text-align:right; } #ygrp-actbar .left{ float:left; white-space:nowrap; } .bld{font-weight:bold;} #ygrp-grft{ font-family:Verdana; font-size:77%; padding:15px 0; } #ygrp-ft{ font-family:verdana; font-size:77%; border-top:1px solid #666; padding:5px 0; } #ygrp-mlmsg #logo{ padding-bottom:10px; } #ygrp-vital{ background-color:#e0ecee; margin-bottom:20px; padding:2px 0 8px 8px; } #ygrp-vital #vithd{ font-size:77%; font-family:Verdana; font-weight:bold; color:#333; text-transform:uppercase; } #ygrp-vital ul{ padding:0; margin:2px 0; } #ygrp-vital ul li{ list-style-type:none; clear:both; border:1px solid #e0ecee; } #ygrp-vital ul li .ct{ font-weight:bold; color:#ff7900; float:right; width:2em; text-align:right; padding-right:.5em; } #ygrp-vital ul li .cat{ font-weight:bold; } #ygrp-vital a { text-decoration:none; } #ygrp-vital a:hover{ text-decoration:underline; } #ygrp-sponsor #hd{ color:#999; font-size:77%; } #ygrp-sponsor #ov{ padding:6px 13px; background-color:#e0ecee; margin-bottom:20px; } #ygrp-sponsor #ov ul{ padding:0 0 0 8px; margin:0; } #ygrp-sponsor #ov li{ list-style-type:square; padding:6px 0; font-size:77%; } #ygrp-sponsor #ov li a{ text-decoration:none; font-size:130%; } #ygrp-sponsor #nc { background-color:#eee; margin-bottom:20px; padding:0 8px; } #ygrp-sponsor .ad{ padding:8px 0; } #ygrp-sponsor .ad #hd1{ font-family:Arial; font-weight:bold; color:#628c2a; font-size:100%; line-height:122%; } #ygrp-sponsor .ad a{ text-decoration:none; } #ygrp-sponsor .ad a:hover{ text-decoration:underline; } #ygrp-sponsor .ad p{ margin:0; } o {font-size:0;} .MsoNormal { margin:0 0 0 0; } #ygrp-text tt{ font-size:120%; } blockquote{margin:0 0 0 4px;} .replbq {margin:4;} -- 8:00? 8:25? 8:40? Find a flick in no time with the Yahoo! Search movie showtime shortcut. http://tools.search.yahoo.com/shortcuts/#news
Re: [flexcoders] Getting a Sprite into a Flex Container?
Hey Sascha, I hope this is what you were looking for. I have a class which extends Sprite as below: package { public class myShape extends Sprite { . . . . . } } Now I have my owns custom component class file which I have added as follows: First in the Application tag of your mxml file, mention a additional attribute as 'xmlns:greet=com.*'. Here refer to the package where your custom component class is. Now use following to add the component to the Flex mxml file: greet:test id=apiref / Here 'greet' is the xmlns which we added in the application tag and 'test' is my custom component class. You have to be careful to extend your custom component class with the UIComponent class like: package com { //import myShape class if not in same package. public class test extends UIComponent { .. public function test() { var shapeObj:myShape = new myShape(); addChild(shapeObj); } . } } Now in the test class you can add the earlier Sprite extended class by creating its object as above. This should solve your purpose. Now the above mentioned test class can extend any of the Classes like Canvas, or any container class. But UIComponent happens to be the base class to all the container classes n so UIComponent could be best opted choice. Regards, Amol. - Original Message From: Sascha [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Saturday, December 30, 2006 3:40:33 PM Subject: [flexcoders] Getting a Sprite into a Flex Container? Hi, I got a class that extends Sprite that I want to put into a Flex DisplayObject container (Canvas or any similar custom made component). My question is: Is implementing the IUIComponent interface the only way to get this working or Are there any other ways around it? A SWFLoader is not what can use in this situation. Any hints would be appreciated. Thanks in advance, Sascha !-- #ygrp-mlmsg {font-size:13px;font-family:arial,helvetica,clean,sans-serif;} #ygrp-mlmsg table {font-size:inherit;font:100%;} #ygrp-mlmsg select, input, textarea {font:99% arial,helvetica,clean,sans-serif;} #ygrp-mlmsg pre, code {font:115% monospace;} #ygrp-mlmsg * {line-height:1.22em;} #ygrp-text{ font-family:Georgia; } #ygrp-text p{ margin:0 0 1em 0; } #ygrp-tpmsgs{ font-family:Arial; clear:both; } #ygrp-vitnav{ padding-top:10px; font-family:Verdana; font-size:77%; margin:0; } #ygrp-vitnav a{ padding:0 1px; } #ygrp-actbar{ clear:both; margin:25px 0; white-space:nowrap; color:#666; text-align:right; } #ygrp-actbar .left{ float:left; white-space:nowrap; } .bld{font-weight:bold;} #ygrp-grft{ font-family:Verdana; font-size:77%; padding:15px 0; } #ygrp-ft{ font-family:verdana; font-size:77%; border-top:1px solid #666; padding:5px 0; } #ygrp-mlmsg #logo{ padding-bottom:10px; } #ygrp-vital{ background-color:#e0ecee; margin-bottom:20px; padding:2px 0 8px 8px; } #ygrp-vital #vithd{ font-size:77%; font-family:Verdana; font-weight:bold; color:#333; text-transform:uppercase; } #ygrp-vital ul{ padding:0; margin:2px 0; } #ygrp-vital ul li{ list-style-type:none; clear:both; border:1px solid #e0ecee; } #ygrp-vital ul li .ct{ font-weight:bold; color:#ff7900; float:right; width:2em; text-align:right; padding-right:.5em; } #ygrp-vital ul li .cat{ font-weight:bold; } #ygrp-vital a { text-decoration:none; } #ygrp-vital a:hover{ text-decoration:underline; } #ygrp-sponsor #hd{ color:#999; font-size:77%; } #ygrp-sponsor #ov{ padding:6px 13px; background-color:#e0ecee; margin-bottom:20px; } #ygrp-sponsor #ov ul{ padding:0 0 0 8px; margin:0; } #ygrp-sponsor #ov li{ list-style-type:square; padding:6px 0; font-size:77%; } #ygrp-sponsor #ov li a{ text-decoration:none; font-size:130%; } #ygrp-sponsor #nc { background-color:#eee; margin-bottom:20px; padding:0 8px; } #ygrp-sponsor .ad{ padding:8px 0; } #ygrp-sponsor .ad #hd1{ font-family:Arial; font-weight:bold; color:#628c2a; font-size:100%; line-height:122%; } #ygrp-sponsor .ad a{ text-decoration:none; } #ygrp-sponsor .ad a:hover{ text-decoration:underline; } #ygrp-sponsor .ad p{ margin:0; } o {font-size:0;} .MsoNormal { margin:0 0 0 0; } #ygrp-text tt{ font-size:120%; } blockquote{margin:0 0 0 4px;} .replbq {margin:4;} -- __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Re: [flexcoders] editable combobox
Hey Paul, Are you talking about, how to get the value entered in the editable combobox. If yes, the use the combobox instance's value property. Amol. - Original Message From: Daniel Freiman [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Friday, December 15, 2006 8:20:17 PM Subject: Re: [flexcoders] editable combobox text property. This property is read-write in and editable combobox. I think it's read only with non-editable comboboxes. - Dan On 12/15/06, Paul Hastings paul.hastings@ gmail.com wrote: i can't seem to catch hold of where user input data is going for editable comboboxes. i've tried selectedLabel, selectedItem, cruising the data provider, etc. i guess i'm missing something. do i need an event listener for this? thanks. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com