Skip to main content
Participant
February 6, 2018
Answered

Can I steal code from Muse?

  • February 6, 2018
  • 3 replies
  • 266 views

I just don't understand why Animate's text input function in HTML canvas has essentially no editable parameters, yet in muse I can change font, color, size, etc. Can I make a muse file that has nothing but some input text with the parameters I want, export it as HTML, then find and steal the code with the input box and throw it in the actions panel?

Thanks in advance!
-Joey W

This topic has been closed for replies.
Correct answer ClayUUID

I'm more a fan of creating a div, then populating it as needed, but if literally all you need is an input element, I'd iterate the above as follows:

var e = document.createElement("input");

e.style.cssText = "position:absolute; left:0px; top:0px; color:#FF0000; font-family:'Times New Roman'; font-style:italic; font-size:xx-large";

e.value = "Here is some red text";

canvas.parentNode.appendChild(e);

Attaching the element as a child of the canvas element ensures it's visually anchored to the canvas.

3 replies

Participant
February 7, 2018

Oh sweet! I'm still new to coding but both your answers were real easy to follow. Thanks a million!

Colin Holgate
Inspiring
February 6, 2018

You could do that, or just go to HTML tutorial pages, like I just did for an hour!

Here's what I figured out:

var t = document.createElement("input");

document.body.appendChild(t);

var s = t.style;

s.color = "#ff0000";

s.fontFamily = "Times New Roman";

s.fontStyle = "italic";

s.fontSize = "xx-large";

t.value = "Here is some red text";

Try that in frame 1 of an empty HTML5 Canvas FLA.

Muse is just doing what it's doing with HTML, Javascript, and CSS. Anything the Muse code can get the window to do, Animate should be able to as well.

ClayUUIDCorrect answer
Legend
February 6, 2018

I'm more a fan of creating a div, then populating it as needed, but if literally all you need is an input element, I'd iterate the above as follows:

var e = document.createElement("input");

e.style.cssText = "position:absolute; left:0px; top:0px; color:#FF0000; font-family:'Times New Roman'; font-style:italic; font-size:xx-large";

e.value = "Here is some red text";

canvas.parentNode.appendChild(e);

Attaching the element as a child of the canvas element ensures it's visually anchored to the canvas.

Legend
February 6, 2018

Muse is probably just making a div layer with a styled input box in it. There's hardly any point in copying that, you could roll it yourself with a few lines of JavaScript.