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 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 this 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 this game is destined for) and is efficient when loading many small files ?

PS) What i mean by it just quits the call stack is this :

 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 this 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 think 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 things that are not supported by Flash would cause build errors or at least warnings, the fact that that didn't happen made me think 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 something 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.

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

Memory problem. How do I dump a Streaming Asset from memory? 1 Answer

resources not loadable in bulid 1 Answer

Why a 109kb .png file teakes 8mb in unity? 1 Answer

Loading XML asset after build 0 Answers

Implement Apple TV ODR (On Demand Resources)? 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