Hi Harbs,

Some time ago there were discussion on Flex Dev which makes me realize that
we should add event tags as long as they are reflecting some native HTML
api, unless we are in express. For example we are using in many places
"change" event which is I believe quite common in JS world, but I would
avoid any additional custom one. In the other world Let's answer to the
question in following case - Does "img" in HTML world have "load" event ?

Piotr


2017-10-30 18:47 GMT+01:00 Harbs <[email protected]>:

> This does raise a good question:
>
> Should we be adding MXML meta tags for all supported events? It seems like
> a desirable thing to have, and there are currently very few event tags. I’m
> not clear on whether the meta-tags effect the end result of code size.
>
> Harbs
>
> > On Oct 30, 2017, at 7:38 PM, GitBox <[email protected]> wrote:
> >
> > justinmclean commented on issue #60: Image not removed when src set to
> null
> > URL: https://github.com/apache/royale-asjs/issues/60#
> issuecomment-340524197
> >
> >
> >   This code fails to compile:
> >   ```
> >   <?xml version="1.0" encoding="utf-8"?>
> >   <js:Application xmlns:fx="http://ns.adobe.com/mxml/2009";
> >                   xmlns:js="library://ns.apache.org/royale/basic">
> >
> >       <fx:Script><![CDATA[
> >           import org.apache.flex.events.IEventDispatcher;
> >
> >           public function blankimage():void {
> >               image.visible = false;
> >               image.src =  "https://www.apache.org/foundation/press/kit/
> poweredBy/Apache_PoweredBy.png";
> >           }
> >           public function showImage():void {
> >               image.visible = true;
> >           }
> >           ]]></fx:Script>
> >
> >       <js:valuesImpl>
> >           <js:SimpleCSSValuesImpl/>
> >       </js:valuesImpl>
> >
> >       <js:initialView>
> >
> >           <js:View>
> >               <js:Container id="startPage" visible="true" width="100%">
> >                   <js:beads>
> >                       <js:VerticalLayout />
> >                   </js:beads>
> >                   <js:Image id="image" src="https://www.apache.org/
> foundation/press/kit/asf_logo_url.png" width="50%" height="50%"
> layoutNeeded="showImage()" />
> >                   <js:TextButton text="Blank" click="blankimage()" />
> >               </js:Container>
> >           </js:View>
> >       </js:initialView>
> >
> >   </js:Application>
> >   ```
> >
> >   With this error:
> >   ```
> >   /Users/justinmclean/IdeaProjects/FlexJSTest/src/ImageBlank.mxml(26):
> col: 130 This attribute is unexpected. It will be ignored.
> >
> >                   <js:Image id="image" src="https://www.apache.org/
> foundation/press/kit/asf_logo_url.png" width="50%" height="50%"
> layoutNeeded="showImage()" />
> >   ```
> >
> >   I assume the only way to do this would be to add a hard coded event
> listener manually like so?
> >
> >   ```
> >       <fx:Script><![CDATA[
> >           public function blankimage():void {
> >               image.visible = false;
> >               image.src =  "https://www.apache.org/foundation/press/kit/
> poweredBy/Apache_PoweredBy.png";
> >               image.addEventListener("layoutNeeded", showImage);
> >           }
> >
> >           public function showImage(event:Event):void {
> >               image.visible = true;
> >           }
> >           ]]></fx:Script>
> >   ```
> >
> >
> > ----------------------------------------------------------------
> > This is an automated message from the Apache Git Service.
> > To respond to the message, please log on GitHub and use the
> > URL above to go to the specific comment.
> >
> > For queries about this service, please contact Infrastructure at:
> > [email protected]
> >
> >
> > With regards,
> > Apache Git Services
>
>


-- 

Piotr Zarzycki

mobile: +48 880 859 557
skype: zarzycki10

LinkedIn: http://www.linkedin.com/piotrzarzycki
<https://pl.linkedin.com/in/piotr-zarzycki-92a53552>

GitHub: https://github.com/piotrzarzycki21

Reply via email to