Flex implements real-time refresh of rolling news in viewstack (on )!

Source: Internet
Author: User

First, describe the work requirements:

As one of the current viewstack pages, rolling news must be refreshed on a regular basis.

I believe it is easy for everyone to implement the simple rolling news effect, but by setting some attributes of move,

 

// Scroll subtitles
Private function moveaction (): void {

If (recordsnum> default_scroll_rownum ){

Move_up.end (); // it is best to add this sentence; otherwise, it will produce other results when the httpservice refreshes data.

Move_up.yfrom = 0;

Move_up.yto = 0-abfltdg.height;
 
Move_up.repeatcount = 0; // Loop
 
Move_up.repeatdelay = 0; // Loop Time
 
Move_up.duration = speed_scroll * recordsnum; // The Time of scroll once in which speed_scroll,

 

Recordsnum are all custom variable number types
 
Move_up.play ();


}

}

 

<! -- Corresponding page element -->

<Mx: Move id = "move_up" target = "{abfltdg}"/>

 

<Mx: canvas x = "310" Y = "265" width = "670" Height = "450" id = "canvas_dg" horizontalscrollpolicy = "off" verticalscrollpolicy = "off" Mouseover = "move_pause () "mouseout =" move_resume () "backgroundcolor =" # 90c3fc ">
<Mx: dataGrid x = "0" Y = "0" width = "670" Height = "500" id = "abfltdg" dataprovider = "{fltdata}" verticalscrollpolicy = "off" showheaders = ""false" verticalgridlines = "true" stylename = "abflt" visible = "false" backgroundcolor = "# 90c3fc" backgroundalpha = "0.9">
<Mx: columns>
<Mx: datagridcolumn headertext = "" datafield = "stationname" textalign = "center" fontfamily = "" fontsize = "12" itemrenderer = "Sim. monitor. asobj. custombackgroundcomp "/>
<Mx: datagridcolumn headertext = "flight no." datafield = "fltnumber" textalign = "center" fontfamily = "" fontsize = "12" itemrenderer = "Sim. monitor. asobj. custombackgroundcomp "/>
<Mx: datagridcolumn headertext = "Delay Time" datafield = "delaytime" textalign = "center" fontfamily = "" fontsize = "12" itemrenderer = "Sim. monitor. asobj. custombackgroundcomp "/>
<Mx: datagridcolumn headertext = "cause of delay" datafield = "delayreason" textalign = "center" fontfamily = "" fontsize = "12" itemrenderer = "Sim. monitor. asobj. custombackgroundcomp "/>
</MX: columns>
</MX: DataGrid>
</MX: canvas>

 

 

However, in order to regularly refresh viewstack, we need to consider the interface effect:

First, if the refresh time is not considered, the data will be refreshed during the rolling process;

2. If you use the rolling news effect page as an independent control, how can you access it in viewstack and set the component refresh according to the refresh policy each time the scrolling ends;

 

These two problems are a bit tricky. Fortunately, after thinking and consulting, I think of countermeasures!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.