A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: ?Access the name of a swf from within the swf itself?

  1. #1
    Senior Member
    Join Date
    Jan 2001
    Location
    Barcelona
    Posts
    129

    ?Access the name of a swf from within the swf itself?

    Hello,

    Was wondering whether it is possible to access the name of a swf from within the swf itself?

    Thanks,

    Fery

  2. #2
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,876
    var url:String = _root._url;

    var firstIndex:Number = url.lastIndexOf("/");
    var lastIndex:Number = url.lastIndexOf(".swf");

    trace(url.substring(firstIndex+1,lastIndex)); //this will trace ur answer
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  3. #3
    Senior Member
    Join Date
    Jan 2001
    Location
    Barcelona
    Posts
    129
    Silentweed,

    Thank a lot

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