Ashvin Savani “arckid” – Flash Platform Expert

All about RIA development using Flash, Flex, Flash Media Server (Flashcom) with various middleware and backends.

Archive for the ‘Flash’ Category

AS3 Nightmare: Unload loader content

We are working on a complex product line for one of our client. The key issue was to load different products / SWF applications into a single html page. It was causing increment in memory used by the browser in the system even if one unloads the loaded SWF from loader. Technical reason behind this was Garbage Collector (GC) was not cleaning its content from it while you unload the SWF from loader. This stuff was working fine previously with AS2.

As AS3 is more powerful in terms of performance and all, it also has some strict rules to follow to gain all the new AVM benefits. Loader will not unload the loaded SWF unless it completely stops doing any activities or listening / broadcasting events. In AS3 there is also changed mechanism of receiving mouse move events on any movieclip. Now we require to obtain such events from stage instead of particular movieclip.

The only workaround to this issue is a trick mentioned by Grant Skinner, which is to initiate new LocalConnections with same name twice. As it will generate error, we require to use catch.
[AS]
try {
new LocalConnection().connect(‘foo’);
new LocalConnection().connect(‘foo’);
} catch (e:*) {}
// the GC will perform a full mark/sweep on the second call.
[/AS]

Thanks Grant, for finding the catch and Adobe should do something about this issue J

  • 11 Comments
  • Filed under: Flash
  • Blog is in sync with MXNA :) Welcome new readers.

    I just got an email from MXNA that my site is not in sync with Adobe MXNA.

    So I welcome all of you new readers from MXNA.

  • 1 Comment
  • Filed under: Adobe, Flash, General
  • Download – Flash Media Server 3 is shipping

    Finally, Flash Media Server 3 is shipping.

    Flash Media Server 3 is available into two editions.

    Flash Media Interactive Server 3:

    This edition is traditional media server edition like we had in version 2. i.e. you can use this edition to do realtime audio, video and data sharing application. It includes all the features that is require to make collaboration applications.

    Price:

    Price for this edition is US$ 4,500 if you are buying it as a new product. If you want to upgrade it from previous version of flash media server, than it will cost you US$ 1,995. Ofcourse, 10 connection limited Developer edition is free.

    What’s New:

    • Support For H.264 and HE-AAC for Flash Player, AIR, Adobe Media Player and FlashLite 3
    • Performance Gain – According to Adobe, its 2x than FMS 2.
    • Secured content delivery through RTMPE with 128-bit encryption
    • New plug-in architecture
    • AMF3 Support – Now all binary data transportation is through AMF3 protocol
    • Multipoint Publishing – Publish live stream from different network locations for time-sensitive content.
    • Stream redirection handling – You can redirect streams like HTTP 302 for missing / alternative contents.
    • Stream data access – Dynamic creation of thumbnails or video previews / snapshots
    • W3C compliant ASCII logs
    • Native bandwidth detection – Detect the bandwidth and serve accordingly
    • Advanced seeking – Seek anywhere regardless of length of video or download status

    Flash Media Streaming Server 3:

    This edition is a special edition if you just want to have flash platform’s streaming power for audio and video but not the data related features or any other interactive features of FMS. So you can say that it’s limited edition of Flash Media Interactive Server. If we compare this edition with FMS2, than the major feature of this edition is no connections or bandwidth limits. I am sure all the CDNs and Flash Media Server hosting companies must be very happy of this. Personally I also see this as strict step against Wowza Media Server by Adobe.

    Price:

    Price for this edition is US$ 995. Due to this pricing Wowza had to reduce its price to 80%. Unfortunately there is no upgrade option for this edition if you own any previous version of flash media server.

    What’s New:

    • Unlimited Bandwidth and Users – No limits :) Serve as much your hardware can
    • Performance Gain – According to Adobe, its 2x than FMS 2.
    • Secured content delivery through RTMPE with 128-bit encryption
    • Support For H.264 and HE-AAC for Flash Player, AIR, Adobe Media Player and FlashLite 3
    • W3C compliant ASCII logs
    • Native bandwidth detection – Detect the bandwidth and serve accordingly
    • Advanced seeking – Seek anywhere regardless of length of video or download status

    Download Link:

    Flash Media Interactive Server 3 – Developer Edition

    So that’s good news for flash media server developers. But unfortunately no Screensharing support yet from Adobe to create great collaborative applications like Acrobat Connect Pro.

    Adobe recently update the flash player version to 9.0.115.0 to fix some serious security issues found in last version of flash player 9.0.48.

    So what are the changes in new version of flash player for flash developer perspective? Here are the issues that personally affect me and my team.

    Stricter method to interpret crossdomain policy files:

    1. Policy files formatting are now stricter. Here are the cases, which can cause rejection of your crossdomain policy files:
      1. Any extra content before or after the start and closing tag cross-domain-policy.
      2. Top level XML tag is not cross-domain-policy.
      3. Any text other than comments found inside any tag of the policy file.
    2. Adobe published new schemas for various cases of crossdomain policies as following:
      1. Generic Schema: http://www.adobe.com/xml/schemas/PolicyFile.xsd
      2. Schema for FTP: http://www.adobe.com/xml/schemas/PolicyFileFtp.xsd
      3. Schema for HTTP: http://www.adobe.com/xml/schemas/PolicyFileHttp.xsd
      4. Schema for HTTPS: http://www.adobe.com/xml/schemas/PolicyFileHttps.xsd
      5. Schema for Socket communication: http://www.adobe.com/xml/schemas/PolicyFileSocket.xsd
    3. Same domain redirection of policy files
      1. Redirection inside same domain is still allowed in new flash player version.
      2. If policy file located at domain/a/crossdomainpolicy.xml is set to redirect at domain/b/crossdomainpolicy.xml, in that case it would treated policy file for folder domain/b not domain/a.
    4. Content-type whitelist
      1. Policy file’s content-type must be either text/* or application/xml or application/xhtml+xml
      2. Flash player will ignore any HTTP policy file that is not sent with a Content-Type value.
      3. Intention of whitelist is to give some assurance that the file is intended to be a text file.
    5. Stronger socket communication rules
      1. From this player version onwards, it’s required to define socket communication port number in the socket policy file.
    6. New: Meta-policies
      1. Meta-policies are defining which policy files are permitted to exist on a server.
      2. Meta-policies normally defines, which kind of flash player related services are hosted on this server and it’s sub folders.
      3. Scope for Meta-policies is for HTTP, HTTPS, FTP and Sockets.
      4. Currently, its not too important unless and until you are super administrator of lot many flash player services like Yahoo! and Google.
    7. Policy file logging
      1. It requires debug version of flash player.
      2. To enable logging, you need to edit mm.cfg which is normally located inside your home folder depending on your operating system.
      3. Default locations for mm.cfg are as following:
        1. Windows: C:\Documents and Settings\username
        2. Windows Vista: C:\Users\username
        3. Macintosh and Linux: /home/username
      4. Create mm.cfg if it does not exist.
      5. It should have following settings:
        1. PolicyFileLog=1
        2. PolicyFileLogAppend=1
      6. Line (i) will enable logging of policy files and line (ii) will continue appending logs instead of clearing log file if root-level SWF is used.
      7. After doing this, if you load any SWF file in your debug version of flash player, it should create policyfiles.txt in following folders according the operating system:
        1. Windows: C:\Documents and Settings\username\Application Data\Macromedia\Flash Player\Logs
        2. Windows Vista: C:\Users\username\AppData\Roaming\Macromedia\Flash Player\Logs
        3. Macintosh: /Users/username/Library/Preferences/Macromedia/Flash Player/Logs
        4. Linux: /home/username/.macromedia/Flash_Player/Logs
      8. Main message which is added in this log file is “Root-level SWF loaded“. This indicates that policy file logging is working fine.
    8. Complete article on Adobe Devnet can be found here.

    Restriction on unsupported function asfunction:

    This was the main protocol to address potential cross-site scripting issues with some SWF files. As it was updated after Flash Player 8, it has nothing to do with Flash Player 7.

    Downloading the update:

    To download latest update please point your browser to here.

    Interesting Links:

     

  • 7 Comments
  • Filed under: Adobe, Flash, News, Reviews
  • Adobe

    I just noticed that Macromedia changed a new homepage which confirms completion of acquisition on 3rd December.

    New Top navigation with Adobe logo and the page style is now completely according to the Adobe Homepage. I am waiting to hear how the community related issues come up with this acquisition.

    Congratulations to Macromedia and Adobe. :)