x


customize a unity texture from within flash/flex

hi i'd like to have a flash/flex app coexist with a unity app on one web page and have the flash/flex app to style a texture according to user input. then have the customized texture being applied to a unity model at runtime. how can that be done?

more ▼

asked Nov 18, 2009 at 08:50 AM

flexrails gravatar image

flexrails
766 74 65 83

(comments are locked)
10|3000 characters needed characters left

4 answers: sort newest

As Unity supports interaction with the JavaScript on the web site, you could in theory encode your texture as a string, and then pass that to a function in Unity from the Flash content using a JavaScript call. See docs for details.

Either that, or upload the texture to a server, and download it from Unity (which would be a waste of bandwidth, of course).

more ▼

answered Nov 18, 2009 at 10:44 AM

jonas echterhoff gravatar image

jonas echterhoff ♦♦
10.4k 8 31 114

jonas, thanks for the hint. you say "in theory". do you consider this approach to be a practical approach as well?

Nov 18, 2009 at 11:10 AM flexrails

Yes, it should be practical, unless you require some high texture bandwidth - ie, it would certainly be to slow to stream a movie from flash to unity, because of all the overhead involved. Plus, I never tried it myself, so you never know what kind of fun challenges you run into :)

Nov 18, 2009 at 01:29 PM jonas echterhoff ♦♦
(comments are locked)
10|3000 characters needed characters left

You might check out what the folks at Aquiris have done with u3dobject. It's a swfobject like set of scripts for communicating with Javascript on a page or to flash content. Any communication you do is going to have to happen through the Javascript on the page, this framework just simplifies some tasks. Be aware, though, that to load a file directly from Unity, you'd have to serialize it as a string and recreate it in Unity or have your Flash/Flex store the image somewhere accessible and pull it down in Unity using the www class.

more ▼

answered Jan 28, 2010 at 09:14 PM

burnumd gravatar image

burnumd
3.7k 51 57 95

(comments are locked)
10|3000 characters needed characters left

This is something that I want to find out, but never got the time and need to do it. I think the way to go is to use Base64 encoding and decoding.

A simplistic solution that is guaranteed to work is to upload the bitmapdata from Flash to a server and load that same image from Unity after completing the upload. It's not efficient, but it could serve as an alternative solution if it will not work through javascript.

[update] Just saw that my last suggestion was already given.

more ▼

answered Nov 18, 2009 at 09:33 PM

PaulT gravatar image

PaulT
95 6 4 8

(comments are locked)
10|3000 characters needed characters left

Guys from Frenzoo are doing exactly what you want. Unfortunately I don't remember the details fully, but as Jonas suggested, the interaction was made through JavaScript. If you contact them and get an answer - please post it back :)

more ▼

answered Nov 18, 2009 at 01:19 PM

Kuba gravatar image

Kuba
721 1 5 11

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

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

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1150
x813

asked: Nov 18, 2009 at 08:50 AM

Seen: 2296 times

Last Updated: Nov 18, 2009 at 08:50 AM