×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    Registered User
    Join Date
    Mar 2008
    Posts
    3

    Smile Flash Lite - Classes or timeline?

    What is the best way to develop a Flash Lite application?

    Obviously there is the OOP way of developing flash purely using classes, but I have seen lots of example flash lite applications with the AS embedded within the tmeline.

    I wonder if by putting it on the timeline it ensures that the code runs at a steady pace, whereas classes could just run too fast for the device?

    Any ideas? Thanks!

  2. #2
    Regular Contributor
    Join Date
    Apr 2003
    Location
    Akron Ohio USA
    Posts
    229

    Re: Flash Lite - Classes or timeline?

    in some cases you might get better performance from the device if you use timeline tweens compared to actionscript tweens. I am not able to give specifics.

  3. #3
    Registered User
    Join Date
    Mar 2008
    Posts
    3

    Re: Flash Lite - Classes or timeline?

    Ok, I was thinking more along the lines of the core code. Functions for Handling XMl data, creating arrays, etc..

  4. #4
    Regular Contributor
    Join Date
    Apr 2003
    Location
    Akron Ohio USA
    Posts
    229

    Re: Flash Lite - Classes or timeline?

    if you create content with the Flash CS3 software then you must put your code in a frame, whether it is class based or not.

    Flex builder, as I understand it, is more of a traditional IDE and does not use the Frame metaphor. However, I dont think it is possible to create Flash Lite specific SWF using Flex at this time. You might be able to use Flex 2 to create Flash 8 compatible swf that run in Flash Lite 3, but I dont think Flex 2 supported compiling of fscommand2() functions required for Flash Lite device integration.

    So for current Flash Lite creation, you will get the broadest capability if you code in CS3 which requires putting code in frames.

    But perhaps I am misunderstanding your question.

  5. #5
    Registered User
    Join Date
    Mar 2008
    Posts
    3

    Re: Flash Lite - Classes or timeline?

    Yeah sorry. I don't think I am being clear.

    Essentially I can develop an application that is entirely class based with only 1 frame to call the initialization of the classes within the movie.

    So for example I could have 3 classes:

    Class 1:Initialise class- loads the some core variables then sends them to class 2
    class 2:Webservice class- requests and receives some data using the data from step 1, then sends the result to class 3.
    Class 3:Webservice handling class- handles the response from he webservice in step 2.

    If I do it this way I assume the code executes as fast as the device can handle it, but could it crash the device if too much happens at once? Does putting the code directly within frames help the device to handle complex code buy slowing things down to its native frame rate?

  6. #6
    Regular Contributor
    Join Date
    Apr 2003
    Location
    Akron Ohio USA
    Posts
    229

    Re: Flash Lite - Classes or timeline?

    thats a good question.

    As an example, I have read comments by other people who find that parsing xml is better handled by doing groups of parses per frame rather than trying to parse the whole xml structure within 1 frame, which could generate Flash Lite error 4 "ActionScript stuck", if it takes longer than one frame to execute the code.

    This may also require that you load the xml in pieces that flash lite can "digest" rather than a single larger xml.

  7. #7
    Product Specialist
    Join Date
    Jun 2003
    Location
    UK
    Posts
    191

    Re: Flash Lite - Classes or timeline?

    Hi,

    AS2 is a wrapper for AS1, the end swfs for both languages look the same :-)

    Therefore by creating classes and using them in simple projects all you are doing is adding more weight to the end swf. If you have performance problems then try removing the classes and stick with functions in keyframes.

    Use variables sparingly, try not to use global variables. Accessing variables will make your code significantly slower, strange I know but thats the way it works!

    I have compiled a series of internal articles from Adobe developers. Its exactly the same guidelines that we use internally to create high performance applications.

    Mark

    http://flashmobileblog.com/?page_id=7
    Mark Doherty
    Developer Evangelist
    Adobe Systems, Mobile and Devices EMEA

  8. #8
    Product Specialist
    Join Date
    Jun 2003
    Location
    UK
    Posts
    191

    Re: Flash Lite - Classes or timeline?

    Quote Originally Posted by jt_01 View Post
    Yeah sorry. I don't think I am being clear.

    Essentially I can develop an application that is entirely class based with only 1 frame to call the initialization of the classes within the movie.

    So for example I could have 3 classes:

    Class 1:Initialise class- loads the some core variables then sends them to class 2
    class 2:Webservice class- requests and receives some data using the data from step 1, then sends the result to class 3.
    Class 3:Webservice handling class- handles the response from he webservice in step 2.

    If I do it this way I assume the code executes as fast as the device can handle it, but could it crash the device if too much happens at once? Does putting the code directly within frames help the device to handle complex code buy slowing things down to its native frame rate?
    The answer is no, the use of classes only affects the performance of the code when it runs. Actionscript Stuck happens normally in two use cases. It happens sometimes if you are out of memory, its still quite rare to see it.

    Most likely this is caused by AS slicing interrupting the script because its taking too long and it's time to do some rendering.

    A quite simple way to get around this is to use setInterval and process the work items in batches. You'll have to experiment to find out the upper limit of the batch size. On S60 slicing occurs roughly every second.

    This is also the point at which the garbage collector will fire, or if the number of scripting objects increases by more than 30%. The player checks this at the start of a new frame.
    Mark Doherty
    Developer Evangelist
    Adobe Systems, Mobile and Devices EMEA

  9. #9
    Registered User
    Join Date
    Jun 2008
    Posts
    5

    Re: Flash Lite - Classes or timeline?

    Hi to everyone,
    I have several questions about flash lite application optimization methods (since i am new developer .
    I have developed an application for WM6. It seems that when I run it with flash lite 2.1 on my device I always get an Actionscript stuck error. But when I use an Flash Player Mobile (PocketOne soft) it runs but the performance is very low (not acceptable).
    The main application consist of (5) XML connectors which load/send data from/to php server, 3 of them connects to combobox, 4th and 5th connects to datagrid.
    The application is organized in movies to every which I assigned actionscripts. All movies are loaded in FIRST frame and I am using an visible true or false to show or hide each movie....
    So my question is : How can I avoid an Actionscript stuck error? Should I upload non vital data in txt files to device so it can be read without xml connection? Will it improve the speed? Could someone advise me how I should optimize my code??????

  10. #10
    Product Specialist
    Join Date
    Jun 2003
    Location
    UK
    Posts
    191

    Re: Flash Lite - Classes or timeline?

    Hi,

    In the post above I pointed to a URL with various performance tips and tricks. I encourage you to look at those as they relate directly to extremely complex and data driven UIs.

    On the whole though it's advisable to only loadMovies and therefore process actionscript an XML when it is required. Using frames will help the application to not get stuck, getting stuck means that you are trying to do too much in a single frame.

    Mark
    Mark Doherty
    Developer Evangelist
    Adobe Systems, Mobile and Devices EMEA

  11. #11
    Registered User
    Join Date
    Jun 2008
    Posts
    5

    Re: Flash Lite - Classes or timeline?

    Quote Originally Posted by markadoherty View Post
    Hi,

    In the post above I pointed to a URL with various performance tips and tricks. I encourage you to look at those as they relate directly to extremely complex and data driven UIs.

    On the whole though it's advisable to only loadMovies and therefore process actionscript an XML when it is required. Using frames will help the application to not get stuck, getting stuck means that you are trying to do too much in a single frame.

    Mark
    Thanks for so short notice responce.
    the problem is that I need to load 4 xml files in one screen, in order to dislplay 3 combobox and 1 datagrid. So my question is ...if I use shared objects to load data and then reuse it later will it increase the performans? Also I read that flash lite do not support well its components and it is better to use shurikencomponents .. do you agree?

  12. #12
    Product Specialist
    Join Date
    Jun 2003
    Location
    UK
    Posts
    191

    Re: Flash Lite - Classes or timeline?

    Hi,

    Flash Lite does not current have any components, the shurikencomponents sound good and they have been well constructed.

    I presume that you mean a Remote Shared Object? My personal preference is to re-use the same object where i can, however in some cases it's better to move from frame to frame and create new objects. That's because each time you move frame the garbage collector might run.

    Mark
    Mark Doherty
    Developer Evangelist
    Adobe Systems, Mobile and Devices EMEA

  13. #13
    Registered User
    Join Date
    Jul 2005
    Location
    italy
    Posts
    72

    Re: Flash Lite - Classes or timeline?

    Hi all,

    from my personal experience I can say that if I'm working to simple project I generally try to avoid an extensive use of classes...

    Anyway for certain project it's impossible to work only on the timeline. Just remember that using, for example, complex design patterns will moslty result in affecting a lot performances.

    I think that the developer should (or try to!) chose the best way for every project.

    Leonardo
    [url]http://www.leonardorisuleo.info/blog/[/url]

  14. #14
    Registered User
    Join Date
    Jun 2008
    Posts
    5

    Re: Flash Lite - Classes or timeline?

    Quote Originally Posted by markadoherty View Post
    Hi,

    Flash Lite does not current have any components, the shurikencomponents sound good and they have been well constructed.

    Mark
    Sorry for silly question... you mean that components provided in Flash CS3 toolbar .... combobox, datagrid etc. are not supposed to be used in Flash Lite apps?.... By the way, I removed all but one xml connections from my application and left only 1 combobox which shows the results... and performance still succs. (I am using new HP214 with ~600mHz CPU).

  15. #15
    Registered User
    Join Date
    Jun 2008
    Posts
    5

    Re: Flash Lite - Classes or timeline?

    Quote Originally Posted by bigN View Post
    Sorry for silly question... you mean that components provided in Flash CS3 toolbar .... combobox, datagrid etc. are not supposed to be used in Flash Lite apps?.... By the way, I removed all but one xml connections from my application and left only 1 combobox which shows the results... and performance still succs. (I am using new HP214 with ~600mHz CPU).
    Sorry that was really dome question (since flashlite does not support flashe component
    but I find really frustrating to reinvent a wheel (creating UI components) every time I develop an application. I think I am going back to J2ME.

Similar Threads

  1. Flash Lite applications
    By zhenhan82 in forum [Archived] Flash Lite on Nokia Devices
    Replies: 5
    Last Post: 2008-02-22, 04:42
  2. Nokia N95 8GB adds Flash Lite 3 support
    By biskero in forum [Archived] Flash Lite on Nokia Devices
    Replies: 17
    Last Post: 2008-02-15, 21:59
  3. Replies: 2
    Last Post: 2007-04-17, 13:32
  4. Flash Lite handsets poll
    By ilyadanilov in forum Series 40 & S60 Platform Feedback Archive
    Replies: 11
    Last Post: 2006-07-04, 23:17
  5. S60 2nd FP3 and 3rd - Flash Lite frustration
    By ilyadanilov in forum General Development Questions
    Replies: 7
    Last Post: 2006-02-08, 19:07

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×