Have now solved the problem! Used the following...

{
        var sphere = new Sphere({radius:10, segmentsH:3, segmentsW:3,
material:"orange#orange"});
        view.scene.addChild(sphere);
        view.render();
        sphere.z = 330;
        var outlineMaterial:WireframeMaterial = new WireframeMaterial
(0x000000);
    outlineMaterial.width = 2;
    sphere.outline = outlineMaterial;
        sphere.addOnMouseDown(onMouseDownOnObject);
    function onMouseDownOnObject(event:MouseEvent3D):void{
        var request:URLRequest = new URLRequest("http://google.com";);
        navigateToURL(request);}
        }


Thanks for the help :)

Josh
On Feb 3, 12:33 pm, Josh27 <[email protected]> wrote:
> Sorry, have now changed
>
>  sphere.addEventListener(MouseEvent.MOUSE_DOWN, MouseDown1);
>
> to
>
>  stage.addEventListener(MouseEvent.MOUSE_DOWN, MouseDown1);
>
> however, this just results in any click anywhere with the URL popping
> up. I'm trying to get it so that it just pops up when the button is
> clicked...
>
> On Feb 3, 12:19 pm, Josh27 <[email protected]> wrote:
>
> > Am now using the following code...
>
> > {
> >         var sphere = new Sphere({radius:3, segmentsH:3, segmentsW:3,
> > material:"orange#orange"});
> >         view.scene.addChild(sphere);
> >         sphere.z = 303;
> >         sphere.addEventListener(MouseEvent.MOUSE_DOWN, MouseDown1);
> >         function MouseDown1(event:MouseEvent):void{
> >         var request:URLRequest = new URLRequest("http://google.com";);
> >         navigateToURL(request);}
>
> > }
>
> > ...and am still having no success. Cant figure out where I'm going
> > wrong...
>
> > On Feb 2, 2:32 pm, Peter Kapelyan <[email protected]> wrote:
>
> > > In your code you call a "MouseDown" function but it doesn't exist...
> > > You do however have a "MouseDown1" function...
> > > So if you change
>
> > > stage.addEventListener(MouseEvent.MOUSE_DOWN, MouseDown)
>
> > > to
>
> > > stage.addEventListener(MouseEvent.MOUSE_DOWN, MouseDown1)
>
> > > it should work.
>
> > > -Pete
>
> > > On Mon, Feb 2, 2009 at 7:56 AM, Josh27 <[email protected]> wrote:
>
> > > > Hello again all
>
> > > > Have progressed along quite nicely with the creation and positioning
> > > > of the buttons on my 3D globe. However, I'm now having an issue with
> > > > the code and actually linking the buttons to a URL. I am currently
> > > > using the below code...
>
> > > > {
> > > > var sphere = new Sphere({radius:3, segmentsH:3, segmentsW:3,
> > > > material:"orange#orange"});
> > > > view.scene.addChild(sphere);
> > > > sphere.z = 303;
> > > > stage.addEventListener(MouseEvent.MOUSE_DOWN, MouseDown);
> > > > function MouseDown1(event:MouseEvent):void
> > > > {
> > > > var request:URLRequest = new URLRequest("http://groups.google.com/
> > > > group/away3d-dev/");
> > > > navigateToURL(request);
> > > > }
> > > > }
>
> > > > But this isn't working at all....
>
> > > > Any help you guys could give would be greatly appreciated.
>
> > > > Many Thanks
>
> > > > Josh
>
> > > --
> > > ___________________
>
> > > Actionscript 3.0 Flash 3D Graphics Engine
>
> > > HTTP://AWAY3D.COM

Reply via email to