473,387 Members | 1,476 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How can I write superscript font to input text in Flash 8 .

Mgsan
1
How can I write superscript font to input text in Flash 8 .

The problem is the equation must be enter in normal text.

( to enter 4 y 3 key sequence use are 4 y 3 the character must be formatted as it is being type )


eg .if we wrote (4 y 3 +2 y 2 - y )to input text ...

it must change formatted to
4y3 +2y2 -y

{4"y power 3"('3' is superscript font )+2"y power 2"('2'is superscript font)- y}.

I wrote this program....but it can't change superscript font .

Expand|Select|Wrap|Line Numbers
  1. var keyListener:Object = new Object();
  2. var str:String = " ";
  3. var userInput:String = "";
  4. keyListener.onKeyUp = function() {
  5.     var output:String="";
  6.     var aText:Array = equation.text.split("");
  7.  
  8.     var isFollowLetter:Boolean;
  9.     for(var i:Number=0; i<aText.length;i++){
  10.         switch(aText[i]){
  11.             case "0":
  12.             case "1":
  13.             case "2":
  14.             case "3":
  15.             case "4":
  16.             case "5":
  17.             case "6":
  18.             case "7":
  19.             case "8":
  20.             case "9": {
  21.                     if(isFollowLetter)
  22.                         output+="<font face='GG Superscript'>"+aText[i]+"</font>";// what is wrong ?I already embed GG superscript in flash
  23.  
  24.                     else
  25.                         output+= aText[i];
  26.                     isFollowLetter = false;
  27.                     break;
  28.                   }
  29.             case "+":
  30.             case "-":
  31.             case "*":
  32.             case "/":
  33.                 output+= aText[i];
  34.                 isFollowLetter = false;
  35.                 break;
  36.             default : {
  37.                 output+= aText[i];
  38.                 isFollowLetter = true;
  39.                 }      
  40.         }
  41.     }
  42.     trace(output);
  43.     //trace(aText);
  44.     equation.htmlText = output;
  45. };
  46.  
  47.    Key.addListener(keyListener);
Thanks for your time !!


Best regards,

Mgsan
Aug 2 '10 #1
0 1294

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Paul M | last post by:
Hi there, i hope someone can help me out here.. I have a input screen where i want the user to enter text in 2 different languages, english and macedonian. How is it possible to make the...
2
by: magix | last post by:
Hi, I'm using Access Database with ASP. There is one particular thing that I have issue with. My purpose is for user to update their own profile. Their existing profile information will be...
1
by: sonicsoul | last post by:
Hi, i wanted to define default global styles that would be used by 90% of controls. I would like to differentiate input text controls from input button controls. is there a way to specify this in...
2
kamill
by: kamill | last post by:
i need to write content of one text file into another text file. My code is working ,if i choose both files from same directory where my program reside..BUT,its not working if i select files from...
2
by: amit | last post by:
Hello group, I'm having a problem with an HTML element performance. When I use focus() method to jump to an input text. I realize the cursor is on waiting on the 2nd column waiting for user to...
2
by: esteban | last post by:
I gonna try to make me understand but my English is very bad and I don't know how is the English name that I want. When I write some text in a input text and I submit it the browser (I think) save...
3
by: esteban | last post by:
When I write some text in a input text and I submit it the browser (I think) save the text and will show it in a list the next time you write the same text in the same input text, in the same page....
2
idsanjeev
by: idsanjeev | last post by:
hello how can retrive the input text after submit button pressed and report a error message. i wants to post topic and if any error message is occured then retrive the inputed text but it forget its...
0
by: vinodkus | last post by:
dear sir/madam I have flash file there are two input text named user_name and password just i have to access these value of this text box in another asp page suppose an asp page index.asp and...
0
by: prince23 | last post by:
hi, i am trying to develop an flash application. where they have designed the entire front end by flash. now i need to doing the functionality part like taking the data from...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.