Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Azis · Aug 01, 2012 at 09:05 PM · errorflashembedding

Embedding a unity-generated swf in another one

Hello. I have two silly unity generated swfs and I want one to be loaded and displayed within the other. I've tryed:

 ActionScript.Import("flash.display.Loader");
 ActionScript.Import("com.unity.UnityNative");
 ActionScript.Import("flash.net.URLRequest");
 
 ActionScript.Statement("var myLoader : Loader = new Loader;");
 ActionScript.Statement("var url : URLRequest = new URLRequest(\"Cena2Loader.swf\");");
 ActionScript.Statement("myLoader.load(url);");
 ActionScript.Statement("UnityNative.stage.addChild(myLoader);");

But I get the following error:

 Fatal Error : RangeError: Error #1506:  
 The specified range is invalid.
 at com.unity::UnityNative$/NativeExt_PlayerLoop()
 at com.unity::UnityContentInternal/playerLoop()
 at com.unity::UnityContent/onEnterFrame()
 Native_Init called while already initialized

I have also tryed creating a custom preloader swf for the second one, but no success so far. Any ideas?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by catburton · Aug 02, 2012 at 10:36 AM

Loading one Unity SWF and adding it to the stage of another Unity SWF in this way is not supported.

If you wish to load Unity content from external SWFs, you could use asset bundles for this. This would allow you to load scenes/assets etc at runtime. Using asset bundles for Flash export works the same way as other asset bundles, you just need to ensure the target is set to FlashPlayer.

If, on the other hand, you simply want to embed your Unity SWF within a standard SWF, there is an example of how to do this on the forums: http://forum.unity3d.com/threads/145294-Flash-Custom-Splash-Screen-Single-SWF

If neither of those options are viable for your project, please provide more details on the effect you're trying to achieve and why those projects need to be separate SWFs.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Azis · Aug 03, 2012 at 04:43 PM

Thanks for the answer. I'm building a unity system flash-targeted composed of independent SWF modules (some are 3rd party). Some of these modules are unity-made, but not all of them.

Therefore, it is necessary to load SWF modules inside my Unity project, unity-made or not.

About the use of AssetBundles, I wonder if I will be able to load content directly from the SWF, something like:

 WWW("http://myserver/moduleX.swf").assetBundle.assetX

The second option will not suit me since I'm working with two unity-based SWFs.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

flash preloader in unity web player 0 Answers

Unity3d 3.5 Build to flash error dump debug 0 Answers

Error #2044 in flash build 2 Answers

Exported SWF no longer loads 1 Answer

Screen Flash When Hit -- Error Help From Pervious Question's Answer 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges