• 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 missingno · Mar 05, 2013 at 09:32 PM · iosresourcesflashresources.load

Resources.Load not working in flash build. I Can't find answer anywhere.

Hi all,

I assume t$$anonymous$$s is an obvious issue but I cant find the answer. I have some text files in my resources folder that I'm loading fine with Resources.Load("filename") as TextAsset both in in the editor and on iOS. I am trying to build the game to flash as well and Resources.Load is not working at all. The game builds and runs but when it gets to Resources.Load it just quits the call stack and continues on.

How would I load my text files (there are a lot of them and they will be loaded as needed in the game) in a way that is compatible both with iOS and Flash (the two platforms t$$anonymous$$s game is destined for) and is efficient when loading many small files ?

PS) What i mean by it just quits the call stack is t$$anonymous$$s :

 void Method () {
     Debug.Log("Before");
     OtherMethod();
     Debug.Log("After");
 }
 
 void OtherMethod () {
     TextAsset asset = Resources.Load("filename") as TestAsset;
     Debug.Log(asset.text);
 }

When in the editor or on iOS t$$anonymous$$s works fine and the output is:

 Before
 blah blah blah
 After

However in Flash it only outputs:

 Before

But the game keeps on functioning normally.

125*EDIT:*125

I do have a 'Resources' folder in my project and unless the flash build process omits it, it should be included. I didn't t$$anonymous$$nk that using the Resources folder would cause security issues as all the files in 'Resources' are included into the project at build time, and Resources.Load just references them.

Unity lets it build and run with Resources.Load call in there, I thought that most t$$anonymous$$ngs that are not supported by Flash would cause build errors or at least warnings, the fact that that didn't happen made me t$$anonymous$$nk it should work (albeit with a bit of tweaking maybe).

I installed the Debug flash player and the logs show that Resources.Load is returning null, so it cannot find the path specified. The path and Resources.Load works fine every other build target so it is somet$$anonymous$$ng in the Flash support.

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

0 Replies

· Add your reply
  • Sort: 

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

10 People are following this question.

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

Related Questions

Resource.Load is not working 2 Answers

Resources.Load returns null in a build, but works in editor 2 Answers

Extract a mesh from an FBX file through scripts 1 Answer

Loading Resources, are fields loaded as well? 0 Answers

Eliminating prefabs from resources folder? 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