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 Ghisallo · Oct 02, 2012 at 10:44 PM · texturewwwflash

Flash WWW.texture problem

I need to apply texture files from an online location (same server as the swf) to objects in the scene, but I've had no luck at all with WWW class. Here is the code I'm testing:

 #pragma strict
 
 var url = "http://myserver.com/texture.jpg";
 var plane : GameObject;
 plane = GameObject.Find( "Plane" );
 
 var www : WWW;
 var isDone = "Texture Loading . . .";

 function Start ()
 {
     www = new WWW (url);
 }
 
 function OnGUI () 
 {
     if (!www.isDone)
     {
         GUI.Label ( Rect (23, 23, 100, 30), isDone );
     }    
     else
     {
         if (GUI.Button (Rect (10,10, 100, 50), "Apply Texture")) 
         {
             plane.renderer.material.mainTexture = www.texture;            
         }
     }
 
 }

It works in the editor. When I place a test build online, the Apply Texture button has no effect.

Am I doing something wrong? If not, is there a workaround? Thanks.

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
Best Answer

Answer by Ghisallo · Oct 04, 2012 at 02:46 AM

Solved! Turns out it's my server. I have no idea why I can't load an image from my server, but at least I've narrowed it down. Anybody have any ideas what it might be?

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 RalphH · Oct 04, 2012 at 08:20 AM

A guess; your server needs a Flash crossdomain.xml for Flash to be able to access it.

Comment
Add comment · Show 1 · 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 Ghisallo · Oct 04, 2012 at 05:55 PM 0
Share

I shall look into it. Interestingly, it had no trouble bringing up images from another server. It's only images on my server it doesn't like. Thanks.

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

How to load an image in flash build? 1 Answer

www-Class for loading local texture is very slow 2 Answers

Getting Fatal Error 2030 using WWW in Flash 7 Answers

how to change the maintexture from another scene? 1 Answer

Assigning UV Map to model at runtime 0 Answers


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