Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Giving up on VML

Reply
Thread Tools

Giving up on VML

 
 
Aaron Gray
Guest
Posts: n/a
 
      12-31-2006
Unless someone can show me how to use it I am giving up on VML.

Problems

1) I cannot work out how to detect whether it is present.

I tried some VB IsObject( CreateObject( ...)) but that did not work.

2) I cannot seem to get it to draw properly

cannot draw a circle(oval) crossed by a line to two.

Any help welcome,

Aaron


 
Reply With Quote
 
 
 
 
VK
Guest
Posts: n/a
 
      12-31-2006

Aaron Gray wrote:
> Unless someone can show me how to use it I am giving up on VML.
>
> Problems
>
> 1) I cannot work out how to detect whether it is present.


You dnt have to - it is presented by default. VML over ActiveX was on
the testing stage for IE 4, you can happily forget of it. If it's IE -
then you have native VML support

> 2) I cannot seem to get it to draw properly
>
> cannot draw a circle(oval) crossed by a line to two.


<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<style>
v\:* {behavior:url(#default#VML);}
</style>
</head>
<body>
<vval coordsize="21600,21600" style='width:156pt;height:156pt'>
</vval>
<v:line coordsize="21600,21600" from="7.5pt,.75pt" to="123pt,6pt">
</v:line>
</body>
</html>

Just place the line yourself wherever you want. Overall I do not
understand why are you refusing to google for and to read VML and SVG
references? The things do not have to be found in starvations by
yourself, just read the manual.

 
Reply With Quote
 
 
 
 
Aaron Gray
Guest
Posts: n/a
 
      12-31-2006
>> Unless someone can show me how to use it I am giving up on VML.
>>
>> Problems
>>
>> 1) I cannot work out how to detect whether it is present.

>
> You dnt have to - it is presented by default. VML over ActiveX was on
> the testing stage for IE 4, you can happily forget of it. If it's IE -
> then you have native VML support


I have came across a friends machine that does not support it.

>
>> 2) I cannot seem to get it to draw properly
>>
>> cannot draw a circle(oval) crossed by a line to two.

>
> <html xmlns:v="urn:schemas-microsoft-com:vml"
> xmlns="http://www.w3.org/TR/REC-html40">
> <head>
> <style>
> v\:* {behavior:url(#default#VML);}
> </style>
> </head>
> <body>
> <vval coordsize="21600,21600" style='width:156pt;height:156pt'>
> </vval>
> <v:line coordsize="21600,21600" from="7.5pt,.75pt" to="123pt,6pt">
> </v:line>
> </body>
> </html>
>
> Just place the line yourself wherever you want.


AND now in JavaScript ?

> Overall I do not
> understand why are you refusing to google for and to read VML and SVG
> references? The things do not have to be found in starvations by
> yourself, just read the manual.


I have read both W3C and MS'es documentation.

MS seems not to follow W3C documentation AFAICT.

Aaron


 
Reply With Quote
 
Aaron Gray
Guest
Posts: n/a
 
      12-31-2006
>> 2) I cannot seem to get it to draw properly
>>
>> cannot draw a circle(oval) crossed by a line to two.

>
> <html xmlns:v="urn:schemas-microsoft-com:vml"
> xmlns="http://www.w3.org/TR/REC-html40">
> <head>
> <style>
> v\:* {behavior:url(#default#VML);}
> </style>
> </head>
> <body>
> <vval coordsize="21600,21600" style='width:156pt;height:156pt'>
> </vval>
> <v:line coordsize="21600,21600" from="7.5pt,.75pt" to="123pt,6pt">
> </v:line>
> </body>
> </html>


They appear as separate elements not as one. As if they were in two separate
DIV's.

Also why the style rather than the position attribute as in W3C
documentation ?

Aaron


 
Reply With Quote
 
Randy Webb
Guest
Posts: n/a
 
      12-31-2006
Aaron Gray said the following on 12/31/2006 3:57 PM:
>>> 2) I cannot seem to get it to draw properly
>>>
>>> cannot draw a circle(oval) crossed by a line to two.

>> <html xmlns:v="urn:schemas-microsoft-com:vml"
>> xmlns="http://www.w3.org/TR/REC-html40">
>> <head>
>> <style>
>> v\:* {behavior:url(#default#VML);}
>> </style>
>> </head>
>> <body>
>> <vval coordsize="21600,21600" style='width:156pt;height:156pt'>
>> </vval>
>> <v:line coordsize="21600,21600" from="7.5pt,.75pt" to="123pt,6pt">
>> </v:line>
>> </body>
>> </html>

>
> They appear as separate elements not as one.


Because they *are* two separate elements.

> As if they were in two separate DIV's.


span elements maybe, div tags - unless told otherwise - fill an entire line.

Use CSS to "stack" them:

<vval coordsize="21600,21600"
style='width:156pt;height:156pt;position:absolute; top:0px;left:0px'>
</vval>
<v:line style="position:absolute;top:0px;left:0px"
coordsize="21600,21600" from="0pt,0pt" to="156pt,156pt">
</v:line>

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
 
Reply With Quote
 
Aaron Gray
Guest
Posts: n/a
 
      12-31-2006
>> They appear as separate elements not as one.
>
> Because they *are* two separate elements.
>
>> As if they were in two separate DIV's.

>
> span elements maybe, div tags - unless told otherwise - fill an entire
> line.
>
> Use CSS to "stack" them:
>
> <vval coordsize="21600,21600"
> style='width:156pt;height:156pt;position:absolute; top:0px;left:0px'>
> </vval>
> <v:line style="position:absolute;top:0px;left:0px"
> coordsize="21600,21600" from="0pt,0pt" to="156pt,156pt">
> </v:line>


Thats crazy if you look at the W3C spec.

And how do you put them in a <group> element without them disappearing ?

Aaron


 
Reply With Quote
 
Aaron Gray
Guest
Posts: n/a
 
      12-31-2006
I just cannot seem to get the following to work :-

<html xmlns:vml="urn:schemas-microsoft-com:vml">
<head>
<style>
vml\:* { behavior: url(#default#VML) }
</style>
</head>
<body>

<vml:group coordsize="1000,1000" coordorigin="0, 0">
<vmlval style="width:500; height:500" position="500, 500" size="450,
450" />
<vml:line from="0, 0" to="500, 500" />
</vml:group>

</body>
</html>

Totally stumped...

Aaron


 
Reply With Quote
 
Aaron Gray
Guest
Posts: n/a
 
      12-31-2006
> And how do you put them in a <group> element without them disappearing ?

Okay add a 'style' statement. This is horrible !

Aaron


 
Reply With Quote
 
RobG
Guest
Posts: n/a
 
      12-31-2006
Aaron Gray wrote:
> Unless someone can show me how to use it I am giving up on VML.
>
> Problems
>
> 1) I cannot work out how to detect whether it is present.


If the browser isn't IE 5+, it's not present.


> I tried some VB IsObject( CreateObject( ...)) but that did not work.
>
> 2) I cannot seem to get it to draw properly
>
> cannot draw a circle(oval) crossed by a line to two.
>
> Any help welcome,


Why are you pursuing VML? It is a proprietary IE technology that is
not well supported (if at all) in other browsers. It will likely be
more useful to get into SVG or maybe XAML, try this post from Laurent
Bugnion:

<URL:
http://groups.google.com.au/group/co...d8b317f3896154
>


The canvas element:
<URL: http://www.whatwg.org/specs/web-apps...t-work/#canvas >

Check out this article which discusses implementing SVG in IE using
VML:
<URL: http://me.eae.net/archive/2005/12/29/canvas-in-ie/ >

The Mozilla canvas tutorial:
<URL: http://developer.mozilla.org/en/docs/Canvas_tutorial >

Regarding vector drawing in browsers:
<URL: http://wiki.svg.org/Vector_Format_Comparisons >


--
Rob

 
Reply With Quote
 
VK
Guest
Posts: n/a
 
      12-31-2006
> > You dnt have to - it is presented by default. VML over ActiveX was on
> > the testing stage for IE 4, you can happily forget of it. If it's IE -
> > then you have native VML support

>
> I have came across a friends machine that does not support it.
>


Tell your friend to reinstall immediately - the machine is badly broken
or (s)he's using very obsolete IE version wide open for all
vulnerabilities found in IE over the last 6 years.

> > <html xmlns:v="urn:schemas-microsoft-com:vml"
> > xmlns="http://www.w3.org/TR/REC-html40">
> > <head>
> > <style>
> > v\:* {behavior:url(#default#VML);}
> > </style>
> > </head>
> > <body>
> > <vval coordsize="21600,21600" style='width:156pt;height:156pt'>
> > </vval>
> > <v:line coordsize="21600,21600" from="7.5pt,.75pt" to="123pt,6pt">
> > </v:line>
> > </body>
> > </html>
> >
> > Just place the line yourself wherever you want.

>
> AND now in JavaScript ?


Think! Learn! Then think again!

SVL is not Prototype/Scriptaculous crap linking: you have to _think_
and be ready to work over differences in SVG and VML. It also presume a
good understanding of the involved entities: finit viewport, infinit
Descartes space, their relations, geometrical shape vs. physical body.
Briefly if you wanted to surprise your girl by the next week-end you've
chosen a wrong matter to deal with

As an inside info: VML is noticeable more powerful and _much_ more easy
to script than SVG. You cannot do it with VML - you have little chances
with SVG.

<http://www.dynamicdrive.com/dynamicindex11/editor.htm> is not an ideal
sample to copy - not at all, it is just a proof of concept that behind
the knowledge you'll obtain the things will be much more easy than they
are right now.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
javascript + vml - help w/ getAttribute on vml node attached to DOM Walton Javascript 0 02-15-2008 03:46 PM
The giving that keeps on giving sixteenmillion C Programming 0 11-19-2007 10:59 PM
VML - Help Macroman XML 0 02-16-2004 06:03 PM
XML and VML Job Prashant XML 0 01-09-2004 09:08 PM
VML Anti-aliasing woes Jason XML 0 09-26-2003 10:23 PM



Advertisments