Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9232715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:22:47+00:00 2026-06-18T06:22:47+00:00

I have an app build with Flex AIR that supports desktop and mobile devices.

  • 0

I have an app build with Flex AIR that supports desktop and mobile devices.

Using an Item Renderer for a List components. Have some very common features, the only difference between desktop and mobile clients are the delete button gets triggered differently.

On Mobile I’m listening to a TransformGestureEvent.GESTURE_SWIPE event

On Desktop, I will show a delete X mark when mouse hover over the item.

Everything else are the same, it just the way it handle those two actions differently. I don’t want to have one Item Rendered for both desktop and mobile, that will cause unnecessary overhead for mobile devices. Hence if have item renderer for each platform then it will cause extra overhead for redundant code in both item renderers.

Any way to avoid the redundant code ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T06:22:48+00:00Added an answer on June 18, 2026 at 6:22 am

    This is untested, but it should work. This just uses a ternary to choose between the two classes using the Capabilities class.

    <s:List itemRenderer="{ ( Capabilitiles.os.toLowerCase().indexOf( 'ios' ) != -1 || Capabilities.os.toLowerCase().indexOf( 'android' ) != -1 ) ? MOBILECLASS : DESKTOPCLASS }" />
    

    Alternatively, you could set it in AS3.

    private function creationCompleteHandler( e:Event ):void {
        if ( Capabilitiles.os.toLowerCase().indexOf( 'ios' ) != -1 || Capabilities.os.toLowerCase().indexOf( 'android' ) != -1 ) {
            list.itemRenderer = MobileClass;
        }
        else {
            list.itemRenderer = DesktopClass;
        }
    }
    

    Again, that is untested. I know I have experienced some odd issues when trying to set the itemRenderer property, so it may not like this. Worth a shot, though.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a requirement to build a flex mobile app (iOS/Android) which is capable
I have a Flex App that allows you to dynamically build an animation. It
I am working with sencha to build mobile app. I have created one page
I'm using CodeIgniter (a PHP framework) to build an app, and I have an
I'm trying to build my Flex/Java web app from within IntelliJ rather than have
I have some experience of developing in Flex/Actionscript using Cairngorm framework. At that time
I have a flex 4.5 php app that runs perfectly on localhost. When I
I have an app that's ready for enterprise testing, but if I build an
I currently have an app displaying the build number in its title window. That's
I have a project where I need to create a desktop app that acts

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.