How to insert dinamically a DirectAnimation control? 
Author Message
 How to insert dinamically a DirectAnimation control?

I'm trying to insert an <OBJECT> in an HTML page via scripting
(window.document.body.insertAdjacentHTML), after the onload event.
But the DirectAnimation control doesn't seem to get initialized in this way,
as it doesn't respond to function calls.
How can I solve this problem?

Thanks



Wed, 25 Aug 2004 22:03:19 GMT  
 How to insert dinamically a DirectAnimation control?
On Sat, 9 Mar 2002 15:03:19 +0100, "Stefano Adamelli"

Quote:

>I'm trying to insert an <OBJECT> in an HTML page via scripting
>(window.document.body.insertAdjacentHTML), after the onload event.
>But the DirectAnimation control doesn't seem to get initialized in this way,
>as it doesn't respond to function calls.
>How can I solve this problem?

It's been a very long time since I've done this (and I'm very
surprised you're still using DA, no-one else is :-(   but I don't
remember having any problems - do you have a url or sample code to
look at?

Jim.



Thu, 26 Aug 2004 18:52:58 GMT  
 How to insert dinamically a DirectAnimation control?


Quote:
> On Sat, 9 Mar 2002 15:03:19 +0100, "Stefano Adamelli"

> It's been a very long time since I've done this (and I'm very
> surprised you're still using DA, no-one else is

Guy, are you joking?
I'm not a hard-core web author, I'm just trying to make better my
application help environment based on MS HTML Help. I defined a graphic
framework that enables to generate a client-side common template for
displaying consistently all the HTML pages of my guide.
After ten days of successful testing, I considered to prove the ability to
support embedded objects. Data bindings worked all-right. But inserting a DA
control in the imported page I discovered (with much sadness!) that simply
it failed to get instanced, leaving a ghosted hole or a red-x symbol.

Quote:
> but I don't
> remember having any problems - do you have a url or sample code to
> look at?

Here it is (for your leisure, baby!):

...

with (document.body)
{

...

    // Define a frame around the contents (replace previous HTML contents
gluing them in the frame).
    innerHTML = '<table id="tblMargin" cellspacing="0"
cellpadding="0"><tr><td><table id="tblContent" cellspacing="10"
width="100%"><tr><td><DIV id=divContent>' + innerHTML +
'</DIV></td></tr></table></td></tr></table>';

    // Insert a DirectAnimation Control (DAControl).
    divContent.innerHTML = '<OBJECT ID="DAControl"
CLASSID="CLSID:B6FFC24C-7E13-11D0-9B47-00C04FC2F51D"
STYLE="position:relative; left:50; top:0;width:600;height:400;"></OBJECT>'

    // Initialize the DAControl.
    // Note that "cube.x" definition template exists surely in the same
source path.
    m = DAControl.MeterLibrary;
    dim = 0.03;
    camera = m.PerspectiveCamera(2*dim, 1.1*dim);
    light = m.PointLight.Transform(m.Translate3(dim/2, dim/4, 1.5*dim));
    cubeGeo =
m.ImportGeometry("cube.x").DiffuseColor(m.Teal).Transform(m.Compose3Array(ne
w Array(m.Scale3Uniform(dim/2),m.Rotate3RateDegrees(m.XVector3,
60),m.Rotate3Degrees(m.YVector3, 60))));
    finalImg = m.UnionGeometry(cubeGeo, light).Render(camera);
    DAControl.Image = finalImg;
    DAControl.Start();

...

Quote:
}

Stefano


Fri, 27 Aug 2004 02:00:06 GMT  
 How to insert dinamically a DirectAnimation control?
On Sun, 10 Mar 2002 19:00:06 +0100, "Stefano Adamelli"

Quote:



>> On Sat, 9 Mar 2002 15:03:19 +0100, "Stefano Adamelli"

>> It's been a very long time since I've done this (and I'm very
>> surprised you're still using DA, no-one else is

>Guy, are you joking?

about what? the lack of people doing DA, not at all, it's a dead
technology MS no longer support it and haven't in effect for years.

Quote:
>Here it is (for your leisure, baby!):

http://jibbering.com/directanimation/stefano.html  works fine for
me...

Quote:
>with (document.body)

don't use with...

Quote:
>    // Define a frame around the contents (replace previous HTML contents
>gluing them in the frame).
>    innerHTML = '<table id="tblMargin" cellspacing="0"
>cellpadding="0"><tr><td><table id="tblContent" cellspacing="10"
>width="100%"><tr><td><DIV id=divContent>' + innerHTML +
>'</DIV></td></tr></table></td></tr></table>';

why do you bother framing the old contents inside divContent to only
then completely overwrite them with the DA control?

a red X in anycase is what the DA control does when it is initialised
but can't find one of your resources, namely your cube.x, it's pretty
much proof that the DA control is being initialised - why import a
cube anyway trimesh cubes are a lot cheaper...

Jim.
--
comp.lang.javascript FAQ - http://jibbering.com/faq/



Fri, 27 Aug 2004 18:45:44 GMT  
 How to insert dinamically a DirectAnimation control?

Quote:
> >> It's been a very long time since I've done this (and I'm very
> >> surprised you're still using DA, no-one else is

> >Guy, are you joking?

> about what? the lack of people doing DA, not at all, it's a dead
> technology MS no longer support it and haven't in effect for years.

Excuse me! I'll remedy promptly putting corn grains under my knees in order
to clean all my ignorance sins...

Quote:
> >Here it is (for your leisure, baby!):

> http://jibbering.com/directanimation/stefano.html  works fine for
> me...

I feel very fool: you're perfectly right, fellow!

Quote:
> >with (document.body)

> don't use with...

Maybe, is that my bug?

Quote:
> >    // Define a frame around the contents (replace previous HTML contents
> >gluing them in the frame).
> >    innerHTML = '<table id="tblMargin" cellspacing="0"
> >cellpadding="0"><tr><td><table id="tblContent" cellspacing="10"
> >width="100%"><tr><td><DIV id=divContent>' + innerHTML +
> >'</DIV></td></tr></table></td></tr></table>';

> why do you bother framing the old contents inside divContent to only
> then completely overwrite them with the DA control?

Sorry, it's just a transcribe error I realized just after sending the mail
to the group.
All the shame on me!

Quote:
> a red X in anycase is what the DA control does when it is initialised
> but can't find one of your resources, namely your cube.x, it's pretty
> much proof that the DA control is being initialised - why import a
> cube anyway trimesh cubes are a lot cheaper...

OK, it will be done.

Thanks for all, Jim!

Stefano



Sat, 28 Aug 2004 04:47:08 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Insert string into data control

2. 3D DirectAnimation Graphics with JScript in IE

3. Dinamically change notepad's default page setup

4. NewBies:Changing Cell table text dinamically

5. How to set hrefs dinamically?

6. Create Object At RunTime (Error) adding news propertys dinamically

7. DirectAnimation Please Help

8. JScript and Directanimation

9. insert into or insert

10. Creating Controls at runtime & Control Arrays

11. Automation Error from Web Browser Control in VB5 Control

12. controlling Calendar Control 9.0 in a web page?

 

 
Powered by phpBB® Forum Software