A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Parsing GetURL2

  1. #1
    Junior Member
    Join Date
    Feb 2001
    Posts
    2

    Lightbulb

    I'm developing a FREE offline browser app (http://www.otway.com/webreaper) which downloads websites and saves 'em locally. SWF files are supported - they are parsed and the internal links fixed up. However, I've based my code on the urlSubst example on the OpenSWF site, which doesn't handle the GetURL2 action.

    I'd like to support GetURL2, but with my limited knowledge of parsing SWF files I want to ask a couple of questions:

    1. Will I need to build a stack to hold the URL/window so that when I come across the tag I can pick up/fix up the URL? Or can I assume that the last 2 pushdata tags before a GetURL2 action will *always* be the ones I'm interested in.

    2. Are there any other stack-based actions which might contain URLs?

    Any help gratefully accepted - and code fragments enthusiastically received. ;-)

    Cheers

    Mark

  2. #2
    Senior Member
    Join Date
    Jul 2000
    Posts
    503

    parsing

    Yes, you will need to parse the push/pop tags in order to get the URL. Also, that will not be enough, because there is always the chance that the URL could be loaded by a LoadVariable command, or that it could be loaded from a DefineConstantPool tag, etc.

    If you can stand to wait a little while, the SWF Source SDK will support importation of Flash 5.0 tags in the near future. It could save you a little time if you don't want to write the parsing code for all the other tags.

    --Jesse

  3. #3
    Junior Member
    Join Date
    Feb 2001
    Posts
    2
    Thanks for the feedback. It's as I thought.

    In fact, I've realised that it's practically impossible to work out precisely, since the value at the top of the stack could have been generated by some operation on two (or more) of the previous stack-top items. :-o

    I guess that if I 'best guess' and look at the top two members of the stack (processing the one that looks like a valid URL) then it'll have a good chance of working in most SWF movies. It'll get some wrong, but that's the best I can do, I reckon, without actually eval'ing a lot of the contents of the movie.

    Cheers for the help,

    Mark

  4. #4
    Junior Member
    Join Date
    Jul 2008
    Posts
    2

    Hi All

    so, there is no other way other than checking for the pushed values on to the stack to get the value of the URL or what? If there is any work around, please let me know.. Iam in need of it..

    Thanks,
    Prabakaran Srinivasan.

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center