Information Filled Under ‘Utility’ Category

returning elements without duplicates, based on an XML schema and using an attribute as context node

Michael, Oh, yes…I forgot to mention earlier: I’d like no two <xf:bind> element tags to be the same; that’s why I was using the distinct-values() function. ~PJC On Thu, Mar 26, 2009 at 1:51 PM, Michael Kay <http://x-query.com/mailman/listinfo/talk> wrote: > > I want the XQuery to determine if the @maxOccurs attribute exists in > an < xs:element > tag somewhere in the schema , and its value isn’t 1. If this > is true, then, for all elements that have a @ref attribute in the schema > (because we now know there’s at least one), the XQuery should get the > string > value of the element’s @ref attribute (what I wanted $name to be), along > with the value of element’s @maxOccurs attribute (what i wanted $max to > be), > and lastly the string value of $max (what I wanted $index_max to be)

Read the original here:
returning elements without duplicates, based on an
XML schema and using an attribute as context node


Removing a child from a parent by passing instance name as string

Following is a code to remove a child from a parent by passing it’s instance name as a string and parent as a display object import fl.controls.Button; //———– Draw a graphics on the stage ———- var t:Sprite = new Sprite(); t.name = “testSprite”; t.graphics.lineStyle(1,0×0000ff); t.graphics.beginFill(0xff0000); t.graphics.drawCircle(0,0,50); t.graphics.endFill(); addChild(t); t.x =100; t.y = 100; //———– Remove Child Function ————– function removeChildWithRef(spriteName:String, parentObj:*){ var t:DisplayObject = parentObj.getChildByName(spriteName); parentObj.removeChild(t); } //————- Add  a Button to Stage ———— var tBtn:Button = new Button(); tBtn.label = “Remove Circle”; tBtn.x = 50; tBtn.y = 170; tBtn.addEventListener(MouseEvent.CLICK,onClick); addChild(tBtn); //———— Capture Click Event ————- function onClick(evt:MouseEvent){ removeChildWithRef(”testSprite”,this); } Posted in Actionscript 3.0, AIR, Flash CS3, Flash Player, Flex Tagged: remove child by passing instance name as string, remove child from parent, remove child from stage

Visit link:
Removing a child from a parent by passing instance name as string


Replicating click Event on a MouseOver event in Flex Accordion

The following code is solution to a problem where you need to make the accordion component’s MouseOver event to behave like a click event. The code will work only in the case if you have not given the names to the AccordionHeader explicitly. Check the solution out here <?xml version=”1.0″?> <mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml”> <mx:Script> <![CDATA[ public function onMouseOver(evt:MouseEvent):void{ var strName:String = evt.target.name; var strLen:int = String("_header").length; if(strName.indexOf("_header") > -1){ accordion.selectedIndex = int(strName.substr(strLen,strName.length)); } } ]]> </mx:Script> <mx:Panel title=”Accordion Container Example” height=”90%” width=”90%” paddingTop=”10″ paddingLeft=”10″ paddingRight=”10″ paddingBottom=”10″> <mx:Label width=”100%” color=”blue” text=”Select an Accordion navigator button to change the panel.”/> <mx:Accordion id=”accordion” width=”100%” height=”100%” mouseOver=”onMouseOver(event)” > <!– Define each panel using a VBox container

Read the original:
Replicating click Event on a MouseOver event in Flex Accordion


Enabling Handcursor on a MovieClip having dynamic TextField in AS3

You can enable the hand cursor on a MovieClip by defining the following statement MovieClip.buttonMode = true; However the solution does not work in-case you have a dynamic textField in that movieclip. To enable hand in this case you have to additionally write the following statement MovieClip.mouseChildren = false; The reason is that the mouseChildren property determines whether or not the children of the object are mouse enabled. If an object is mouse enabled, a user can interact with it by using a mouse.

More:
Enabling Handcursor on a MovieClip having dynamic TextField in AS3


AS3 XML Loader Utility Class

I have developed this XMLUtility class in conjunction with a CustomEvent Class which returns me the loaded XML/String Data along with the complete event firing. You can download the sources from here . Following is the code you need to write when you want to load this class //———— Import Classes import com.flexcomps.utils.CustomEvent; import com.flexcomps.utils.XMLLoaderUtil; //——– Create instance of loader class var xmlLoader:XMLLoaderUtil = new XMLLoaderUtil(); xmlLoader.addEventListener(CustomEvent.ONLOADED, onXMLLoaded); xmlLoader.load(xmlPath); //—– Method to handle the returned data private function onXMLLoaded(evt:CustomEvent) { xmlData = evt.data as XML; trace(xmlData); } Posted in Actionscript 3.0, AIR, Flash CS3, Flex, Flex Components, Xpath Tagged: As3 XML loading utility, Custom Event xml loading

Visit link:
AS3 XML Loader Utility Class


Page 13 of 13« First...910111213


The news,articles,images etc. on XML Developer India  are selected automatically through a software process, please follow each article's attributed link to see the original content. This news site is powered by Wordpress. Incase of any objection or question please Contact Us...

Our Sevices

News