How can you determine if swf is played standalone or loaded in other swf?

后端 未结 3 689
遇见更好的自我
遇见更好的自我 2021-01-25 20:23

I have two swf\'s. One \"show\" of some sort, and one \"menu\" that acts as a loader for \"shows\". The \"show\" swf can run in its own respect, or by being loaded via the \"men

相关标签:
3条回答
  • 2021-01-25 20:35
    if (root.name == "root1") //standalone
    
    0 讨论(0)
  • 2021-01-25 20:38

    In the constructor of loaded swf:

    if (stage && parent == stage) {/*I'm standalone*/}

    Or maybe if (parent is Loader) will also work (vice versa logic)

    0 讨论(0)
  • 2021-01-25 20:49
    if (root.parent && root.parent == stage) {
      // Standalone
    }
    
    0 讨论(0)
提交回复
热议问题