Flex-Content in a Away3D-Scene - How does this works??

77 views
Skip to first unread message

Deepsoul

unread,
Aug 18, 2008, 12:29:05 PM8/18/08
to away3d.dev
Hi,
i'm trying to get some flex-Content in my Away3D-Scene and doing
something like that:

private function createComboBox():void
{
cb = new ComboBox();
cb.dataProvider = ["S", "M", "L", "XL", "XXL"];
cb.prompt = "Ihre Grösse";
cb.width = 200;
cb.y = 200;
addChild(cb);

}

but no ComboBox appears. When I tried to refer to a MXML-Component the
result is the same - my scene is rendered without any FlexContent -
How do i get Flex-Content on my Scene ?

Greets Boris

Jensa

unread,
Aug 18, 2008, 4:13:49 PM8/18/08
to away3d.dev
You have of course done this as a Flex Project and have imported the
proper class?

import mx.controls.ComboBox;

You didn't say this, so I just wanted to check that you're not trying
to use the Flex framework in an Actionscript project :)

J

Li

unread,
Aug 18, 2008, 6:06:43 PM8/18/08
to away3...@googlegroups.com
Anyone has an example?

Boris Horn

unread,
Aug 19, 2008, 2:54:06 AM8/19/08
to away3...@googlegroups.com
Li schrieb:
> Yes its a Flex-Project. All the AwayStuff is inside Flex-Application,
> but when i try to have some Flex-Content inside a AWAY3D-Plane i cant
> see nothing, only non-Flex-Content is visible. But there is no
> Error-Message, so thats why im so surprised.

atb Boris

Message has been deleted

joebass

unread,
Aug 19, 2008, 7:55:35 AM8/19/08
to away3d.dev
The only control I've added at runtime is a label so, I'm not sure it
will help but, if you add a flash control to a flash sprite and use
the sprite as material for an away object, it will display. Not
sure
about how user-interaction would work.

var _textField:TextField = new TextField();
var _textSprite:Sprite = new Sprite();
_textSprite.addChild(_textField);
YourAwayObject.material = Cast.material(_textSprite);

On Aug 19, 2:54 am, Boris Horn <b.h...@ministry.bbs.de> wrote:
> Li schrieb:
>
>
>
>
>
> > Anyone has an example?
>
> > On Mon, Aug 18, 2008 at 5:13 PM, Jensa <jens...@gmail.com
> > <mailto:jens...@gmail.com>> wrote:
>
> >     You have of course done this as a Flex Project and have imported the
> >     proper class?
>
> >     import mx.controls.ComboBox;
>
> >     You didn't say this, so I just wanted to check that you're not trying
> >     to use the Flex framework in an Actionscript project :)
>
> >     J
>
> > Yes its a Flex-Project. All the AwayStuff is inside Flex-Application,
> > but when i try to have some Flex-Content inside a AWAY3D-Plane i cant
> > see nothing, only non-Flex-Content is visible. But there is no
> > Error-Message, so thats why im  so surprised.
>
> atb Boris- Hide quoted text -
>
> - Show quoted text -

Boris Horn

unread,
Aug 21, 2008, 10:36:46 AM8/21/08
to away3...@googlegroups.com
Sorry but i have to bump that thread again in your away3d-brains - Did
no one ever tried to display true Flex-Content in a Away3D-Scene - The
sample from joebass ist not that valid, because it uses the flash.text
package that isn't a flex-package - when i try to extend a material by
UIComponent ( a must to display the content in a MXML-Component, no
output, no errormessages, nothing. When i show a Alert outside a
Away3d-Material the Alert is popping up, so there must be way to display
true Flex-Content, because the Alert-Class is a Flex-Class.

Im confused
atb
b.
joebass schrieb:


--
-----------------------------------
Boris Horn
-----------------------------------
MINISTRY.BBS
Interactive Communication GmbH
-----------------------------------
mailto: b.h...@ministry.bbs.de
http://www.ministry.bbs.de
-----------------------------------
Dorotheenstrasse 60 | 22301 Hamburg
t: +49. (0) 40.27 15 15 48
f: +49. (0) 40.27 15 15 40
-----------------------------------


Geschäftsführer: Marco Luschnat, Nis Niemeier, Andreas Ollmann
Steuer-Nummer: 71/846/02 096
Umsatzsteuer-Ident-Nummer: DE 209 661 788
Handelsregister: Amtsgericht Hamburg HR B 75707

-----------------------------------------------------------------------------------
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet. Vielen Dank.

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. Thank you.


joebass

unread,
Aug 21, 2008, 2:28:45 PM8/21/08
to away3d.dev
The flex - away marriage was confusing to me too. I ended up
encapsulating all the away code within a class that extends UI
component and adding it to the mxml file with <classes:AwayStuff
id="theAwayStuff" left="795" top="375"/>

To access design-time controls specified in the mxml - not at runtime,
I use this type of syntax from the AwayStuff class:
with (mx.core.Application.application) {

Can you describe what you are going to do? I'm no expert but, maybe I
could help.
> mailto: b.h...@ministry.bbs.dehttp://www.ministry.bbs.de
> -----------------------------------
> Dorotheenstrasse 60 | 22301 Hamburg
> t: +49. (0) 40.27 15 15 48
> f: +49. (0) 40.27 15 15 40
> -----------------------------------
>
> Geschäftsführer: Marco Luschnat, Nis Niemeier, Andreas Ollmann
> Steuer-Nummer: 71/846/02 096
> Umsatzsteuer-Ident-Nummer: DE 209 661 788
> Handelsregister: Amtsgericht Hamburg HR B 75707
>
> ---------------------------------------------------------------------------­--------
> Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet. Vielen Dank.
>
> This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. Thank you.- Hide quoted text -

Jensa

unread,
Aug 21, 2008, 4:31:10 PM8/21/08
to away3d.dev
Did you mean something like this?
http://www.flashgamer.com/a/flextest/Away3D_in_flex.html

Here you have Away3D playing in a custom component and using a List
control as a texture for a Sphere. I couldn't find a way to make the
material interactive as that throws a lot of errors, but clicking the
List will update the texture here.

J

Li

unread,
Aug 21, 2008, 5:31:51 PM8/21/08
to away3...@googlegroups.com
Are you taking into consideration that flex components might not work well inside an actionscript project? Ive found that to use flex components without running into problems you must work within a flex project instead of an actionscript project. You should try this if you havent... You can use a canvas component as your stage and use myCanvas.rawChildren.addChild(child) instead of the regular addChild. There should be some other usage differences, but its way better that making all your away code extend flex interfaces.

Boris Horn

unread,
Aug 22, 2008, 6:24:35 AM8/22/08
to away3...@googlegroups.com
Yes - its a true Flex-Project - and the away scene is located inside an
<mx:Application>. When i try to map a sprite-texture to a moviematerial
every content is visible but not the flex-content. This is what i doing

package container
{
import flash.display.Bitmap;
import flash.display.Sprite;
import assets.Images;
import flash.events.*;

import mx.core.UIComponent;


/**
* ...
* @author Boris Horn
*/
public class SpielSpass extends Sprite
{
private var container:Sprite;
private var myBmp:Bitmap;
private var anotherBmp:Bitmap;

private var uiref:UIComponent;


public function SpielSpass()
{
createContent();
}

private function createContent():void
{
container = new Sprite();
addChild(container);

//WORKS
mybmp = new Images.img1();
container.addChild(klappe);

anotherBmp= new Images.img2();
anotherBmp.x = 10;
anotherBmp.y = 20;

//WORKS NOT
uiref = new UIComponent();
container.addChild(uiref);
uiref.addChild(anotherBmp);


}

}

cheers B.

Li schrieb:

--
-----------------------------------
Boris Horn
-----------------------------------
MINISTRY.BBS
Interactive Communication GmbH
-----------------------------------
mailto: b.h...@ministry.bbs.de
http://www.ministry.bbs.de
-----------------------------------
Dorotheenstrasse 60 | 22301 Hamburg
t: +49. (0) 40.27 15 15 48
f: +49. (0) 40.27 15 15 40
-----------------------------------


Geschäftsführer: Marco Luschnat, Nis Niemeier, Andreas Ollmann
Steuer-Nummer: 71/846/02 096
Umsatzsteuer-Ident-Nummer: DE 209 661 788
Handelsregister: Amtsgericht Hamburg HR B 75707

-----------------------------------------------------------------------------------

Boris Horn

unread,
Aug 22, 2008, 6:25:41 AM8/22/08
to away3...@googlegroups.com
Yes - thats what i wanna do - but only with custom components

Jensa schrieb:

Jensa

unread,
Aug 22, 2008, 7:34:08 AM8/22/08
to away3d.dev
Boris - try to use the code from my example?

J

Boris Horn

unread,
Aug 22, 2008, 8:11:11 AM8/22/08
to away3...@googlegroups.com
Jensa schrieb:

> Boris - try to use the code from my example?
>
> J
>
>
Allright - that works - but unfortunetly no interactivity - like you
said - if interactivity = true; it drops errors..... :-(

atb b

Mikhail Shevchuk

unread,
Dec 23, 2008, 9:04:56 AM12/23/08
to away3...@googlegroups.com
Hello, group!

I have the same issue. There is a Plane with MovieMaterial:

var mm : MovieMaterial = new MovieMaterial(c, { smooth:true, precision:1 } );
mm.interactive = true;
p1.material = mm;

'c' is a Flex canvas with Image and Button. The result is a canvas
which is rendered correctly but the button is not active. It doesn't
react on mouse at all.
How can this be fixed ? I've tried to set interactivity in init object
too - but that doesn't work.

Thanks in advance.

2008/8/22 Boris Horn <b.h...@ministry.bbs.de>:

--
m. | http://creationcomplete.com

Mikhail Shevchuk

unread,
Dec 25, 2008, 3:29:06 AM12/25/08
to away3...@googlegroups.com
After investigating this thing with Fabrice it was figured out that
source for this material should be inherited from MovieClip. When the
source is Canvas (that will be probably if you want to put some Flex
content into the material) then it is not interactive. It is rendererd
correctly but is not active.

2008/12/23 Mikhail Shevchuk <mikhail....@gmail.com>:

--
m. | http://creationcomplete.com

Mikhail Shevchuk

unread,
Dec 25, 2008, 3:52:42 AM12/25/08
to away3...@googlegroups.com
PaperVision3D has this feature using similar Material as far as I can
understand. Here is a coold demo of this
http://dev.getoutsmart.com/os3d/demos/videoroom/

2008/12/25 Mikhail Shevchuk <mikhail....@gmail.com>:

--
m. | http://creationcomplete.com

Rob Bateman

unread,
Jan 1, 2009, 8:22:51 AM1/1/09
to away3...@googlegroups.com
This demo was done for a commercial project and as such there is not source available. Although i'm unsure why making interactive flex panels would cause huge problems in Away3d - Jensa, can you let us know what sort of errors your getting?

Rob
--
Rob Bateman
Flash Development & Consultancy

rob.b...@gmail.com
www.infiniteturtles.co.uk
www.away3d.com

Jensa

unread,
Jan 1, 2009, 5:06:54 PM1/1/09
to away3d.dev
Hi Rob,
Just tested and it now works with the material set to interactive. No
errors thrown using the latest version.

However - Mouse clicks are not really woking. I made a new demo file
to illustrate this. Click the sphere to change state. Sometimes you'll
need to click the same state up to three times until the component
shows the proper state.

Example: http://www.flashgamer.com/f/awayinflex/
Source:
http://www.flashgamer.com/f/awayinflex/Away3D_in_flex_take2.mxml
http://www.flashgamer.com/f/awayinflex/Viewport.mxml

There are also a couple other bugs:
- The original component is removed from the DisplayList when applied
as material
- Applying same material to multiple instances is kind of buggy

J
Reply all
Reply to author
Forward
0 new messages