Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Datagrid Fonts & Characters

Posted on 2005-04-29
27
Medium Priority
?
331 Views
Last Modified: 2013-12-03
Hi All,

I have a question in regard to embedding characters.  I have a datagrid that works except it will not display the characters such as a : or , .  It will display the fonts as long as the script below embedds the fonts but I can not get it to list ANY charcter aside froma  regular font.  Now characters will appear if I remove make the true to false on embeed font.  However, this would be great but  when this movie loads into another movie no text will appear at all.  Does anyone know what this could be?  The formatting code is below.  Thanks for any iinsight.

Thanks Again,

Justice
....................................................................................
import mx.styles.CSSStyleDeclaration;
import mx.transitions.easing.Back;

_global.style.setStyle("color", 0x000066);
//_global.style.setStyle("themeColor", 0xffbf07);
_global.style.setStyle("themeColor", 0xea0000);
_global.style.setStyle("embedFonts", true);
_global.style.setStyle("textSelectedColor", 0x666666);
_global.style.setStyle("fontSize", 10);
_global.style.setStyle("fontFamily", "verdana");
0
Comment
Question by:Justice75
  • 15
  • 7
  • 5
27 Comments
 
LVL 27

Expert Comment

by:negatyve
ID: 13898183
To me it works fine. Try to spot the difference with my sample:

sample: http://www.negatyve.com/EE/EmbedFontsGrid/EmbedFontsGrid.html
source: http://www.negatyve.com/EE/EmbedFontsGrid/EmbedFontsGrid.zip
0
 

Author Comment

by:Justice75
ID: 13898586
Hi Negatyve,

I am still having the problem.  I listed the code below.  It started from your great code months ago.  Can you please try to help me.

........................................................................................................
//import mx.styles.CSSStyleDeclaration;
//import mx.transitions.easing.Back;

_global.style.setStyle("color", 0x000066);
//_global.style.setStyle("themeColor", 0xffbf07);
_global.style.setStyle("themeColor", 0xea0000);
_global.style.setStyle("embedFonts", true);
_global.style.setStyle("textSelectedColor", 0x666666);
_global.style.setStyle("fontSize", 10);
_global.style.setStyle("fontFamily", "verdana");
//PAGE VARIABLES//////////////////////////////////////////////////////////
//iPhoto.scaleContent = true;
info.selectable = false;
var pageNumber =1;
copyInfo="";
var dataProv:Array = new Array();
//LOAD DATAGRID//////////////////////////////////////////////////////////
data_var = new LoadVars();
var vars:Array = new Array();

data_var.pageNumber = pageNumber;
data_var.path = this;
data_var.onLoad = function(success)
{
     if(success){
         
          for(var i = 0; i < Number(this.tot); i++){
               var item = {};
               item.Date = this["CBDate" + i];
               item.Copy     = this["Article" + i];
               item.Title     = this["Title" + i];
               item.Funder     = this["Funder" + i];
               item.Amount     = this["Amount" + i];
               item.Contact     = this["Contact" + i];
               item.Total = this["tot"];
               item.TCounter = this["tCounter"];
               item.PCounter = this["pCounter"];

               //insert variables into array    
               dataProv.push(item);
                  vars[i] = new LoadVars();
                  vars[i].ind = i;
                  vars[i].onLoad = function(success)
                  {
                       if (success)
{
dataProv[this.ind].textFile = this.copyInfo;
if (this.ind == 0)
  info.text += "Article: " + this.copyInfo;
}
                  }
                  vars[i].load("http://localhost/TPS/Articles/CB/Scholarship/"+ this["Article" + i]);
                         
          }
           
          //counter
          iMCounter.text = item.TCounter;
          info.text = "Chatterbox Scholarships" +
          "\n\n" + "Date:  " + this["CBDate" + 0] +
          "\n" + "Title:  " + this["Title" + 0] +  
          "\n" + "Amount:  " + this["Amount" + 0] +
          "\n" + "Funder:  " + this["Funder" + 0] +
          "\n" + "Contact:  " + this["Contact" + 0] +              
              "\n\n"
         
          //column names, column info and dataProvider
          pageCout = item.PCounter;
          this.path.data_dg.columnNames = ["Funder", "Amount"];
          //set data provider
          this.path.data_dg.dataProvider = dataProv;
          //set columns width
          this.path.data_dg.getColumnAt(0).width = 279;
          this.path.data_dg.getColumnAt(1).width = 100;
     

     }
}          
data_var.sendAndLoad("http://localhost/TPS/Pages/CB/scholarshipView.asp", data_var, "POST");          
//BUTTONS////////////////////////////////////////////////////////////////
// BUTTON-next

iNext.onRelease = function(){
     if (pageCout > pageNumber){
     data_dg.removeAllColumns();
     pageNumber++;
    data_var.pageNumber = pageNumber;
     data_var.sendAndLoad("http://localhost/TPS/Pages/CB/scholarshipView.asp", data_var, "POST");
     }
}

// BUTTON-back
iBack.onRelease = function(){
     if(pageNumber > 1){
          data_dg.removeAllColumns();
          pageNumber--;
          data_var.pageNumber = pageNumber;
          data_var.sendAndLoad("http://localhost/TPS/Pages/CB/scholarshipView.asp", data_var, "POST");
     }
}
                                   
//GRID LISTENER/////////////////////////////////////////////////////////
myGridListener = new Object();
myGridListener.change = function (eventObj)
{
var theSelectedItem = data_dg.getItemAt(eventObj.target.selectedIndex);

     var theSelectedItemDate = theSelectedItem.Date;
     var theSelectedItemTitle = theSelectedItem.Title;
       var theSelectedItemAmount = theSelectedItem.Amount;
       var theSelectedItemFunder = theSelectedItem.Funder;
       var theSelectedItemContact = theSelectedItem.Contact;
     var theSelectedItemCopyInfo = theSelectedItem.copyInfo;
     info.text = "Chatterbox Scholarships" +
     "\n\n"  +  "Date:  " + theSelectedItemDate +
       "\n" + "Title:  " + theSelectedItemTitle +
     "\n"  +  "Amount:  " + theSelectedItemAmount +
       "\n" + "Funder:  " + theSelectedItemFunder +
       "\n\n" + "Contact:  " + theSelectedItemContact +
     "\n" + "Article: " + theSelectedItem.textFile;
     };
data_dg.addEventListener("change", myGridListener);
stop();
0
 
LVL 27

Expert Comment

by:negatyve
ID: 13898760
It's a long code. What should  I look for?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:Justice75
ID: 13901797
Hi Negatyve,

I dont know.  I am so confused.  I have never had this problem before.  I think that the characters have to be embedded as well.  I just dont know how.  I have another swf in another site (the one you helped me with first).  I am so confused, I looked over the code last night and I still cant figure it out.  If you can take a look, it would be great.  Thanks for all of your help.


Justice
0
 
LVL 27

Assisted Solution

by:negatyve
negatyve earned 1000 total points
ID: 13901894
ok, as I am missing call asp code and components clips, let's try another way:

1. have you embedded your font via library or via an empty textfield?
0
 

Author Comment

by:Justice75
ID: 13901960
Hi Negatyve,

I embeded the font in a empty text field.  Also, the (.) periods are showing up but no other characters are.  The text boxes are showing up fine.  The datagrid is what is not showing.  The Lowercase, uppercase and numbers are showing up in the datagrid.  However, the characters other than the period (.) are not.  No commas, semi colans or dollar sgns are.  Can you add any light on this.  The only embedded code that I have used is below:
_global.style.setStyle("embedFonts", true);

I also tried the library trick and it didnt work.  Maybe I did it wrong.  Thanks for your help.  As usual, I really appreciate it and need it!

Thanks,

Justice
0
 
LVL 27

Expert Comment

by:negatyve
ID: 13902500
ok, what chars ranges have you selected in the "Character Options" mini panel from the Properties panel?
0
 

Author Comment

by:Justice75
ID: 13910440
all characters were selected..
0
 

Author Comment

by:Justice75
ID: 13910466
Hi again Negatyve,

to be exact, uppercarse, lowercase, numerals and punctuation were selected.

Justice
0
 

Author Comment

by:Justice75
ID: 13933683
Why is that I hardly EVER get my questions answered here?  

Justice
0
 
LVL 27

Expert Comment

by:negatyve
ID: 13933702
hehee, in this case it's not that I have forgotten you, but that I do not know what to suggest. You can see from my sample a common datagrid embedding fonts and showing the needed chars. To see what's wrong with *your* movie, I should have your fla and your asp files to test what's going on.. :)
0
 
LVL 18

Expert Comment

by:Billystyx
ID: 13933764
I would agree with negatyve - there is a point reached where we need the files to be able to help further - (although on this particular subject I may not be able to help). (This is in reposnse to your post this morning).

And BTW, it is only one question that you have not had help with - in flash at least. I would even offer to help in your access question except it relates to asp, and I don't know asp - maybe a question in asp would help you get your open access q answered.

Billystyx
0
 

Author Comment

by:Justice75
ID: 13934433
Hi All,

I am not suggestig that one prson is not hekping me.  Not  at all.  But to be honest yes, I have answered qustions myself. To my question with th emebeded issue, it has NOTHING to do with ASP but to the code that I am supplying in AS.  I know that this is my issue.  I am trying to fugure it out.  I dont have an adsress to forward anything to or post a file.

Thanks,

Justice
0
 
LVL 18

Expert Comment

by:Billystyx
ID: 13935072
You can email me - my email is in my profile - but I can't promise I can help - I will look though.
I think it may be a problem with the data coming into flash...

Billystyx
0
 

Author Comment

by:Justice75
ID: 13938884
Thanks,
do you need the database and asp file?

Justice
0
 

Author Comment

by:Justice75
ID: 13940485
Negatyve,

I dont have an email address to email the files to you at.

Justice
0
 
LVL 18

Expert Comment

by:Billystyx
ID: 13940575
yeah, that might be an idea - as I said I don't know asp but I do know vb/vba so it may be an idea to send both.

Billystyx
0
 

Author Comment

by:Justice75
ID: 13940699
Billystyx,

Thank you so much for your help.

Justice
0
 

Author Comment

by:Justice75
ID: 13940948
Billystyx,

I emailed the files.  Thanks again.

Justice
0
 

Author Comment

by:Justice75
ID: 13940967
Negatyve,

I studied the files and I think that one difference is that the code that you have populates the data_grid by AddItem.  The code that I have is loading the datagrid from the info in the database.  That is all that I see that is different.

Justice
0
 
LVL 18

Accepted Solution

by:
Billystyx earned 1000 total points
ID: 13943358
I doubt I can be of much assistance here Justice75. Firstly, it looks like you forgot to send me the fla that has the grid in it - but secondly, I took a look at one of the asp files you sent. I don't know asp, but (I think) I know what it looks like, and although you have enclosed everything in jscript tags, (most of) it doesn't look like jscript, but like vb.. You have jscript commenting (with // rather than '), of course, I could be confused - I know only rudimentary jscript - basically for form validation - but can I ask you, do you know for sure the info gets pulled correctly from the db?
In any case, I would wait for negatyves response.

Sorry I can't help...

Billystyx

0
 

Author Comment

by:Justice75
ID: 13944540
Billystyx,
Thanks for trying.  It really helps at least when someone tries.  As far as the asp file, yes all of the info is comming from the asp file.  YOu can run the asp file alone and see the results.  If you change the dns (aftering adding one with your system), you will see the string.  As far as the flash file.  I could have sworn that I sent it (rats).  I will send it again.  The asp files are fine.  All of the characters are in the text box below.  The grid has everything except the characters.  

Again, thanks a buch for trying.  I really appreciate it!  I still dont know how to get the files to negatyve:(

Justice
0
 

Author Comment

by:Justice75
ID: 13948190
HI All,

I solved the probelm.  The charcters will show up if you put two text boxes off stage with the characters emdeded and the font face that is in the grid, one bold and one not.  Thanks for any help that everyone offered.

Thanks Again,

Justice
0
 
LVL 18

Expert Comment

by:Billystyx
ID: 13948488
Oh, I see your problem - try this too then ...
1. Go to the library and click on the small menu in the top right hand corner. Up the top of that there is a menu item called 'new font'.
It should automatically name it Font 1, and give you a choice of selection of all the font types. Choose the font you want and OK.
The new font should then appear in your library, right click it, choose linkage and export for action script.
then add this code before your dynamically created text.

var myformat = new TextFormat();
with (myformat) {
      font = "Font 1";
      bold = true;
      color = 0x333333;
}
dep = this.getNextHighestDepth();
this.createTextField("mytext", dep5, -135, -54, 200, 110);
this.mytext.textHeight = 36;
this.mytext.text = //whatever your text variable is called ...
this.mytext.setTextFormat(myformat);
this.mytext.embedFonts = true;

and it should embed all the characters you need... ( this has worked for me in the past anyway)

Good luck with it:)

Billystyx
0
 
LVL 18

Expert Comment

by:Billystyx
ID: 13948491
...or of course using your solution does the same thing - as soon as you said that it triggered something in my tired brain, becuase I have used that solution before too...
0
 

Author Comment

by:Justice75
ID: 13948634
Thanks again!

Justice
0
 
LVL 18

Expert Comment

by:Billystyx
ID: 13949702
no worries:)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question