Christian answered the underlying question better than I was able to...
preloader is easily customized via application tag attributes.  However, as
to reading AS...

Flex includes a bytecode decompiler.  I just realized it's not documented
and not set up but here's instructions.


Add the following code to your web.xml file:

   <servlet>
     <servlet-name>SWFViewerServlet</servlet-name>
     <display-name>SWF Viewer (Decompiler) Servlet</display-name>
     <servlet-class>flex.bootstrap.BootstrapServlet</servlet-class>
     <init-param>
         <param-name>servlet.class</param-name>
         <param-value>flex.tools.SWFViewerServlet</param-value>
     </init-param>
   </servlet>
   
    <servlet-mapping>
      <servlet-name>SWFViewerServlet</servlet-name>
      <url-pattern>/SWFViewer</url-pattern>
    </servlet-mapping>

Then you can decompile a SWF that resides on the server using a URL like
this:

http://127.0.0.1:8100/flex/SWFViewer?file=/tst/ShowVersion.swf

and it will give you output like this:

<!-- ?xml version="1.0" encoding="UTF-8"? -->
<swf xmlns='http://macromedia/2003/swfx' version='7' framerate='24'
size='10000x7500' compressed='true' >
  <!-- framecount=2 length=390584 -->
  <ScriptLimits scriptRecursionLimit='1000' scriptTimeLimit='60'/>
  <SetBackgroundColor color='#FFFFFF'/>
  <ProductInfo product='Macromedia Flex for J2EE' edition='Developer
Edition' version='1.0' build='0' compileDate='3/4/04 6:16 PM'/>
  <DefineSprite id='1'>
    <!-- sprite framecount=1 -->
    <ShowFrame/>
  </DefineSprite>

  <DefineSprite id='2'>
    <!-- sprite framecount=0 -->
  </DefineSprite>
  <ExportAssets>
    <Export idref='1' name='mx.preloaders.DownloadProgressBar' />
  </ExportAssets>
  <DoInitAction idref='2'>
    <![CDATA[
      cpool [206]
      push '_global'
      get
      push 'mx'
      getmem
      if L0
      push '_global'
      get
      push 'mx'
      push 0.0
      push 'Object'
      newobj
      setmem
      L0:
      pop

and on and on and on.  :-)

Of course you never ever want to do this on a server that's publically
accessible.  Maybe that's why it's not documented.

Best regards,

Sam

----------------------------------------
Blog http://www.rewindlife.com
TeamMM http://www.macromedia.com/go/team
----------------------------------------

> -----Original Message-----
> From: Dick Applebaum [mailto:[EMAIL PROTECTED]
> Sent: Friday, April 09, 2004 7:00 AM
> To: CF-Talk
> Subject: Re: ...just took 60+ seconds to load "Hello World" in Flex!
>
> On Apr 9, 2004, at 1:04 AM, Samuel R. Neff wrote:
>
> >  I don't know of any way to get rid of the loading message.  If you
> > look at
> >  the AS code generated by a Flex app, the loading thing is
> generated
> > by the
> >  compiler on the _root timeline of the generated SWF.  It
> doesn't even
> > come
> >  from one of the components (it is a component, but it's kicked off
> > from the
> >  timeline).  Maybe there's an option somewhere though.
> >
> >
>
> How do you look at the AS code generated by a Flex app?
>
> TIA
>
> Dick
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to