Help Needed On Styling And Replicating Text Field
As a new AS3 coder I'm at a little bit of a loss on the most efficient way to replicate a styled text field.
I would like to use the following styled text info and load some text from an array. Do I need to create all this styling for every instance of the text in the array or can I create several new instances of the field in my function?
Thank you in advance for your help.
ActionScript Code: var headlines:TextField = new TextField();var headline:TextFormat = new TextFormat();headline.size = 20;headline.font = new HelvBlack().fontName;headlines.alpha = 0;headlines.setTextFormat(headline);headlines.embedFonts = true;headlines.autoSize = TextFieldAutoSize.LEFT;
KirupaForum > Flash > ActionScript 3.0
Posted on: 11-17-2008, 12:43 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Styling A Text Field With CSS - URL Problem
I'm trying to load an XML file and a CSS file to style some text. So my code works perfectly fine like this:
Code:
var paramObj:String = stage.loaderInfo.parameters.xmldoc;
var textLoader:URLLoader = new URLLoader();
var textReq:URLRequest = new URLRequest(paramObj);
var cssLoader:URLLoader = new URLLoader();
var cssRequest:URLRequest = new URLRequest('alumniconnectionflash.css');
var style:StyleSheet = new StyleSheet();
function cssLoaded(evt:Event):void {
style.parseCSS(evt.target.data);
}
cssLoader.addEventListener(Event.COMPLETE, cssLoaded);
cssLoader.load(cssRequest);
description_txt.styleSheet = style;
textLoader.load(textReq);
As soon as I change the css file name to an absolute URL, which appears fine on the screen when I go to it, the CSS stops working. Any ideas as to why or how I can fix it?
Form Field Styling (Input Text Formatting)
Is there a way to format multiple form fields (input text) at the same time? For instance, I have a form with 10 input text fields and I want all of them to have black borders and gray backgrounds. To do this, I've coded one as:
txtInput1.border = true;
txtInput1.borderColor = 0x000000;
txtInput1.background = true;
txtInput1.backgroundColor = 0xCCCCCC;
Is there a way for me to create a sort of "style" that I could apply all of these values to a text input easily, the way TextFormat can apply text styles?
Components Styling: Guru Needed
I think I need some help in explaining styling components, or otherwise the Flash documentation is just plain wrong
What I'm trying to do is style the checkbox component.
More specifically I want to change the color of the checkbox.
According to the docs I could do it like this:
ActionScript Code:
my_cb.style.setStyle("symbolColor", 0xff0000);
But....it's a no go.
Any ideas?
Input Text Field Help Needed
Hello,
I have an Input text on my form. When ever I try to resize the form in design mode, it changes my characters in the field. So when I test my movie, the font is changed. How can I reset the font once I have resized my Text Field?
Thanks
Combo/text Field Tut Needed
Hi,
Does anyone know where I can find a good from scratch tutorial for setting up a form using the UI components.
I need to set one up using a couple of combo boxes and text fields and haven't got a clue of where to start!
Any suggestions will be a big help.
Thanks
D
Animated Text Field. Help Needed
Animated text from an external text file.
I have tried to combine two tutorials here, one that loads an external text file into a dynamic textfield:
http://www.kirupa.com/developer/mx/m...ynamictext.htm
And another that animates a string of characters:
http://www.kirupa.com/developer/acti..._animation.htm
So far I not got it to work, I've checked most things here a million times such as misspelling of instance names and correct target paths. I'm still a bit stuck at what to try next.
please could someone check my script to see if i'm making an obvious error.
I'm also wondering if there is a tidier way to produce this effect, if so I would be greatful if you could point me in the right direction.
Help Needed Adding Listener To Text Field
I have two text fields, one above the other, which will be pulling in text dynamically.
The second text field should position itself depending on how high the first field is. Normally I would use an empty movieclip and som onClipEvent (enterFrame) to control the second text filed, but this time I want to do it right using a listener.
However I am not sure what to put into the code which will trigger the listener. I want something like "onChange" but that doesn't seem to exsists. I've tried with "onLoadComplete" but no luch there either
This is my code. Can anybody push me in the right direction:
PHP Code:
var introListener:Object;
introListener = new Object();
introListener.onLoadComplete = function ():Void{
pagetext_txt._y = intro_txt._y + intro_txt._height+10;
trace("called listener");
}
intro_txt.autoSize = true;
intro_txt.addListener(introListener);
intro_txt.text = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit., dolor sit amet, consectetuer adipiscing elit. Praesent nisl felis, semper sit amet, mollis condimentum";
pagetext_txt.text="second text";
Styling Text
Hi,
I have attached a file that has problems, such as:
- the bullets are not the same eventhought they all have the same font & size the second line always comes different
- the bullets are left intented 10 pt but once I output that they are aligned the same way.
Please advise.
Regards
Styling Dynamic Text?
Hi,
I have a large MC filled with text that I want to add a scrollbar to, the problem is, you can only add a scrollbar to a dynamic text box! Unfortunately the moment I convert static text to dynamic text it messes up all my carefuly styled copy!
Is there some way I can keep my headings (14px Arial Bold Red) and my body copy (11px Arial Plain Black) looking nice and stylish in a dynamic text box?
When I make it a dynamic text box, it previews everything as 14px Arial Bold Red (aargh!)
-- spiral
Styling Dynamic Text, How?
I have a dynamic text field that I load an external txt file into, and that works just perfectly. The problem occurs when I try to style my text with an external CSS file. I know I have to load the CSS file first or it won't get applied to the text field and I have made sure to do that, but I still can't get it to work. plz could someone tell me what's wrong with my actionscript? I would really appriciate it:
Code:
// ----------------<load CSS>----------------- \
var cssStyles:TextField.StyleSheet = new TextField.StyleSheet();
cssStyles.load("styles/styles.css");
cssStyles.onLoad = function(success) {
if (success) {
loadedInfo.syleSheet = cssStyles;
_level0.myLV.load("vars/mainTxt.txt");
} else {
loadedInfo.text = "There has been an error loading the requested information. Please contact the webmaster and report your error.";
}
}
// ----------------</load CSS>----------------- \
and here's an exerpret from my text file:
Code:
info=<textformat leading="3"><p><span class="hilight">(1) This is found on Mission 2,</span> . . . . </p></textformat>
and lastly here's my CSS file:
Code:
p {
font-family: sans-serif;
font-size: 11px;
}
.hilight {
font-weight: bold;
}
a:link {
color: #A9A9A9;
text-decoration: underline;
}
a:hover {
text-decoration: none;
}
thx in advnace.
Styling Dynamic Text
Hi everyone I have created a dynamic text field which scrolls, my problem is I want to add some style to the text, but when i edit one thing e.g a title the whole text changes, how do i go about just styling single pieces of text? any help is greatly appreciated.
Thanks
Dynamic Text Styling
I am using a dynamic text field with some text inside it. I would like to make some headings within the text BOLD and a different Colour then the rest of the text. Is this possible? I am also scrolling the text field using the generic scroll bar.
Thank You.
Styling Xml Imported Text Via Css
I'm trying to just figure out how to style text imported via xml with css. Here's the code I have. It imports the XML just fine, but there is no style. I've also included the xml + css files.
Any ideas?
Actionscript:
ActionScript Code:
import flash.text.StyleSheet;
import flash.text.TextField;
import flash.text.TextFieldAutoSize;
loadCSS();
function loadCSS() {
trace("loadCSS");
var cssLoader:URLLoader = new URLLoader();
cssLoader.load(new URLRequest("test.css"));
cssLoader.addEventListener(Event.COMPLETE, cssComplete);
}
function cssComplete(e:Event) {
trace("cssComplete");
var sheet:StyleSheet = new StyleSheet();
sheet.parseCSS(e.target.data);
textObj.styleSheet = sheet;
loadXML();
}
function loadXML() {
trace("loadXML");
var xmlLoader:URLLoader = new URLLoader();
xmlLoader.load(new URLRequest("forcss.xml"));
xmlLoader.addEventListener(Event.COMPLETE, xmlComplete);
}
function xmlComplete(e:Event):void {
trace("xmlComplete");
var xml:XML = new XML(e.target.data);
textObj.htmlText = xml.point[0];
}
XML:
Code:
<?xml version="1.0" encoding="iso-8859-1"?>
<data>
<point><=!=[=C=D=A=T=A=[<h1 class="test">Test</h1><br><br><p>test test test test </p><p>test test etst ste</p>]=]=></point>
</data>
CSS:
Code:
.test {
font-size: 20px;
color: #0000ff;
}
Styling Text With Script?
Hi,
I have a text field that reads data in from an array, that is displayed randomly in my flash movie, however id like to style it so that the second part of the array is displayed bold and on a new line.
the array with the text looks like the following:-
Code:
_global.homeInfo = new Array(
"Travel and tourism" + "Visa",
"Leading industry analysts" + "unknown",
"An estimated 12m Britons" + "Interactive Media",
"Online retail is currently worth £19bn." + "BMRB",
to display the text on the screen i use the following (text box is info_text)
Code:
info_txt.text = homeInfo[int(Math.random()*homeInfo.length)];
is it possible to have the second part of the array i.e. visa, or unknown, to be displayed BOLD, on a new line, but in the same info_txt text box?
will i be able to contain it all in one text box and apply style or will i have to break it up, any help would be ace, been puzzled too long and its late...
Hope this makes sense,
cheers
Will
Dynamic Text Styling
I am using a dynamic text field with some text inside it. I would like to make some headings within the text BOLD and a different Colour then the rest of the text. Is this possible? I am also scrolling the text field using the generic scroll bar.
Thank You.
Dynamic Text Styling
I am trying to style my text box with CSS in Flash. I have the following AS.
stop();
var thePath:MovieClip = this.scroller_all.scroller_slider;
thePath.infoScroll.textbox.html = true;
thePath.infoScroll.textbox.autoSize = true;
thePath.infoScroll.textbox.condenseWhite = true;
var cssStyles:TextField.StyleSheet = new TextField.StyleSheet();
cssStyles.setStyle("h1", {fontWeight: "bold", color: "#000000"});
thePath.infoScroll.textbox.styleSheet = cssStyles;
//Text Scroller 01
var lvInfo:LoadVars = new LoadVars();
lvInfo.onData = function(sInfo:String):Void {
thePath.infoScroll.textbox.htmlText = sInfo;
}
lvInfo.load("info.html");
Why is this not working? The text loads, but does not get styled by the css.
Thanks a lot!
Styling Text Box Of A Combobox
Hi --
I have a comboBox that I am styling using this code:
new_style.setStyle("embedFonts",true);
new_style.setStyle("fontFamily", "Gibraltar-Plain");
new_style.setStyle("color", 0x653a71);
new_style.setStyle("fontSize", 12);
new_style.setStyle("rollOverColor", 0x653a71);
new_style.setStyle("textRollOverColor", 0x000000);
new_style.setStyle("selectionColor", 0xDDDDDD);
new_style.setStyle("textSelectedColor", 0x000000);
forminputs_mc.states_cbx.setStyle("styleName","cbxStyle")
When I click on the drop down I see the items in the combo box but whenever
I select an item the item shown in the combo box is empty. If I change the
font to a non-embedded font it works fine. How do I set the "textField" to
have the embedded font so it displays properly?
Thanks
Rich
Styling Text On V2 Buttons
I am using the V2 button component and I have successfully skinned it via an AS script but I can't see how to style the text on my buttons so that the color of the text changes on rollover. I also can't see how to position the text on the button rather than allowing it to center itself on the button. The button is very wide and the text should be close to the left hand side. I'm hoping that someone with a deeper understanding of the component architecture can point me in the right direction.
Styling Dynamic Text
How come I can't bold, italisize, or resize dynamic text? You can see the styles appear when making the movie, but when testing it, it is just plain text.
Styling Text On V2 Buttons
I am using the V2 button component and I have successfully skinned it via an AS script but I can't see how to style the text on my buttons so that the color of the text changes on rollover. I also can't see how to position the text on the button rather than allowing it to center itself on the button. The button is very wide and the text should be close to the left hand side. I'm hoping that someone with a deeper understanding of the component architecture can point me in the right direction.
Styling Text In Dynamic Boxes
hi there
I have a dynamic text box which displays a combination of other input text boxes.
I 've scripted the following to show the information:
ViewScript_mc.script_txt.text = "CHARACTER A:" + a1 + "CHARACTER B:" + b1 +"STAGE DIRECTION" + sd1;
where a1, b1, & sd1 are the variables of the input text boxes
this displays the infomation in a continuous line, I want to be able to separate each section with a paragraph /line spacing.
I've seen the symbol /r in text copied from simpletext but this doesnt seem to be working when typed in.
is there a "tag" i can input into my actionscript to push the next line of text over ?
Is it possible to display it as html instead?
Id appreciate any help on this
Thanks a lot !
Rob
CSS Styling In Dynamic Text Boxes
Does any one know how I would combine these two codes?
CSS in text boxes:
Code:
var format = new TextField.StyleSheet();
var path = "http://www.kirupa.com/developer/mx2004/code/flash.css";
var quick = "<br><p class='one'>The quick Kirupa jumps over the lazy dog.</p><br><p class='two'>The quick Kirupa jumps over the lazy dog.</p><br><p class='three'>The quick Kirupa jumps over the lazy dog.</p><br><p class='four'>The quick Kirupa jumps over the lazy dog.</p>"
format.load(path);
format.onLoad = function(success) {
if (success) {
textbox.styleSheet = format;
textbox.text = quick;
} else {
output.text = "Error loading CSS file!";
}
};
Loading dynamic text:
Code:
loadVarsText = new LoadVars();
loadVarsText.load("about.txt");
loadVarsText.onLoad = function(success) {
if (success) {
trace("done loading");
textbox.htmlText = this.var1;
} else {
trace("not loaded");
}
};
I'd like to load dynamic text with CSS styling into my textbox.
Strange Text Styling Problems
http://www.musoka.ax86.net/flash/test.html
I have included some AS code to load data from a XML file(the left side "blog" area). The titles of the blog entries are styled incorrectly when exported. They come up looking like some strange version of Times New Roman rather than the Arial I set them to.
I dont understand what I did wrong. It has also happened in previous templates that I have added the XML/External data to.
Loading XML-text With Tags And Styling It
Hey! First post here!
I have a weird problem which occurs when I try to load in XML-data with HTML-formatting (links and other tags). I get unwanted row breaks in Flash when I do this. The weird thing is if I don't load it through XML and instead just write it in a string, it doesn't get any unwanted row breaks.
Here is the AS3 code (and then I just created a dynamic text field named theText)
Code:
var cssStyle:StyleSheet = new StyleSheet();
cssStyle.parseCSS("h1{ font-size: 16px; } a {font-weight:bold; text-decoration:underline} a:hover {font-weight:bold; text-decoration:underline;color:#999999}");
var xmlnamn:Number;
var xmlLoader:URLLoader = new URLLoader();
var xmlData:XML = new XML();
xmlLoader.addEventListener(Event.COMPLETE, LoadXML,false,0,true);
xmlLoader.load(new URLRequest("cont4.xml"));
function LoadXML(e:Event):void {
xmlData=new XML(e.target.data);
texten(xmlData);
}
function texten(inladdad:XML):void {
theText.styleSheet=cssStyle;
theText.htmlText=inladdad.text;
}
XML-file (cont4.xml)
HTML Code:
<content>
<text>Ett flitigt <a href='hej'>fingrande</a> på <b>mobilen</b> hör numera julen till. På julafton skickade svenskarna sms som aldrig förr. Noteringen blev över 60 miljoner meddelanden, men troligen slås rekordet redan vid nyår.<h1>Rubrik</h1>Alla de fyra operatörerna Telia Sonera, Tele 2, Tre och Telenor rapporterar nya högsta noteringar från julafton. Jämfört med julen 2007 ligger ökningarna på 20–30 procent. Ännu större är uppgången när det gäller bildmeddelandena mms – men de flesta julhälsningar med mms skickas under december före julafton.
Tydlig trend
</text>
</content>
Thanks in advance! Anyone else had this problem? Tried to google it and search the forum but couldn't find anything..
Loading External Text And Styling
Hi,
I have a couple of questions:
- im loading external text into my flash file. It loads no problem, but it wont render as html (yes i have the button selected. it just includes the <p>etc. tags as part of the text?? Have i missed something really basic? (very likely).
- can anyone suggest a good tutorial for attaching a css to external text? I have tried one, and im not sure whether it works or not because of the problem above!
ive attached my code below... if it helps!
cheers...
/*-loading the first bit of text-----------------------------*/
var dataabout:LoadVars = new LoadVars();
dataAbout.onLoad = function(success){
if (success){
_root.contentAbout_mc.contentAbout_txt.text = this.content;
}else{
_root.contentAbout_mc.contentAbout_txt.text = "error loading enviroguard content text";
}
};
dataAbout.load("text_files/about_enviroguard.xml");
/*-loading the CSS-----------------------------*/
var sheetCSS = new Textfield.Stylesheet();
var sheetLocation = "styles/flash.css";
sheetCSS.load(sheetLocation);
sheetCSS.onLoad = function(success){
if(success){
dataAbout.stylesheet=sheetCSS;
dataAbout.text = this.content;
}
}
stop();
Formatting/styling Dynamically Loaded Text
I'm using Flash MX and I've got text that's loaded externally from a .txt file into a text area set to receive dynamic text. I'd like to be able to format different parts of the text, like underline or colorize specific words or phrases.
I've attempted to have the text area render the loaded text as HTML, then I include text formatting tags in the file, (for instance <p color="blue">) but this only seems to color all of the text. I also tried linking a style sheet from the text file, but this doesn't work either.
Any suggestions?
-Scot
Styling A Combobox Dropdown Text When Highlighted
Hi!
I need to change the rollover color of the combobox's dropdown using AS3.
Code:
var textf:TextFormat = new TextFormat();
textf.font = "Arial";
textf.size = 11;
textf.color = 0xFFFFFF;
textf.bold = false;
drpCars.setStyle('themeColor', HighlightRenderer);
I've tried loads of different solutions, however the closest i got was to change the whole dropdown when rolled over by using a custom cell renderer. Is it possible to identify and modify the rendering of the currently highlighted dropdown option?
Any help would be greatly appriciated,
Cheers
Styling Text In A List Component (or Components In General)
Hey,
I need to style a list to have the following format (it lists a bunch of products)...
A
then a bunch of products that start with the letter A
B
then a bunch of products that start with the letter B
C
then a bunch of products that start with the letter C
and so forth... I think you get the idea
The letters A,B,C, etc need to have their own line as well as their own font size, as well as be centered in the list.
How can I achieve this effect?
BTW all my data will come from a XML file.
Trying To Pass Text From Form Text Field To A Flash Dynamic Text Field
Hi, I was hoping someone might enlighten me as to how/if I can do this...
Currently I'm using javascript which works fine to pass text from textfield A to textfield B:
Code:
window.onload=function()
{
document.forms.form1.shirtText.value=document.forms.form1.KitGroupID_16_TextOption_38.value
}
Is there a way to pass the textfield A text to a dynamic text input (flash) as I'd like to use the font embedding flash offers. I can make it work when loading a value from a txt file but I'm not sure how to access the value identified above as KitGroupID_16_TextOption_38 and make it appear in a dynamic input box. Eventually I might want to have 3 font choices for the user but I'd like to just see if I can get this working properly first.
Your help/advice would be greatly appreciated,
-Scott
Replicating An Effect
say there's one particular "effect" i want to use on several different symbols, what's the best way to go about reproducing it? for example, let's say i find a particular way of affecting color and size with lots of tweens that makes a really nice "shine" effect, and want to use the same settings on 30 or 40 different text and/or image links - how should i go about it?
tyia
Help In Replicating Menu
Hi,
I am working on a website and want to integrate a Flash menu, with the same type layout as the one used here (http://www.islandrecords.com/thekillers/site/home.las). I'd like a menu list where you get sub-menu items when you roll over the buttons. I'm just getting into learning Flash, and could use some help. I've got my main image and my buttons created on seperate layers. But I don't know how I should put the sub-menu items in, or how to get them to appear when you roll over the buttons. Any assistance in how to properly set this up is much appreciated. Thanks in advance. - Eric
Replicating An Applet
Hi,
I saw this applet that basically had heaps of points arrange in columns and rows, that when u clicked and held the left mouse button down they would move towards the mouse, and move away if the right button was clicked.
so the question is how do i make this code 4 making the points arrange on stage simpler I am sure there is a better way.
Code:
a = 0;
j = 1;
for (i=1; i<11; i++) {
peete = [i, j];
_root.attachMovie("point", peete, 1+i);
a = a+60;
b = 60;
_root[peete]._x = a;
_root[peete]._y = b;
}
a = 0;
j = 2;
for (i=1; i<11; i++) {
peete = [i, j];
_root.attachMovie("point", peete, 20+i);
a = a+60;
b = 120;
_root[peete]._x = a;
_root[peete]._y = b;
}
a = 0;
j = 3;
for (i=1; i<11; i++) {
peete = [i, j];
_root.attachMovie("point", peete, 40+i);
a = a+60;
b = 180;
_root[peete]._x = a;
_root[peete]._y = b;
}
a = 0;
j = 4;
for (i=1; i<11; i++) {
peete = [i, j];
_root.attachMovie("point", peete, 60+i);
a = a+60;
b = 240;
_root[peete]._x = a;
_root[peete]._y = b;
}
a = 0;
j = 5;
for (i=1; i<11; i++) {
peete = [i, j];
_root.attachMovie("point", peete, 80+i);
a = a+60;
b = 300;
_root[peete]._x = a;
_root[peete]._y = b;
}
a = 0;
j = 6;
for (i=1; i<11; i++) {
peete = [i, j];
_root.attachMovie("point", peete, 100+i);
a = a+60;
b = 360;
_root[peete]._x = a;
_root[peete]._y = b;
}
a = 0;
j = 7;
for (i=1; i<11; i++) {
peete = [i, j];
_root.attachMovie("point", peete, 120+i);
a = a+60;
b = 420;
_root[peete]._x = a;
_root[peete]._y = b;
}
a = 0;
j = 8;
for (i=1; i<11; i++) {
peete = [i, j];
_root.attachMovie("point", peete, 140+i);
a = a+60;
b = 480;
_root[peete]._x = a;
_root[peete]._y = b;
}
a = 0;
j = 9;
for (i=1; i<11; i++) {
peete = [i, j];
_root.attachMovie("point", peete, 160+i);
a = a+60;
b = 540;
_root[peete]._x = a;
_root[peete]._y = b;
}
a = 0;
j = 10;
for (i=1; i<11; i++) {
peete = [i, j];
_root.attachMovie("point", peete, 180+i);
a = a+60;
b = 600;
_root[peete]._x = a;
_root[peete]._y = b;
}
also i am using a mouse down clip event to make the points move to the mouse how do i make this happen for the whole time the mouse is down not just the click?
Help Replicating Effect
Hi all,
just wondering if anyone could give any help... I am trying to copy the effect on this page.
www.bbc.co.uk/radio1
when you hover over a picture, info pops up from the bottom.
Any clues?
Many thanks :-)
Self Replicating Program
Can anyone use AS3 (or AS2 I suppose) to write a script that can reproduce itself? Successful program should export code (into a TF or the output panel) that can be copied into a new flash file and run to repeat the same output indefinitely.
I've seen this posed for other languages but I'm not sure how to tackle it in AS3...yet.
Replicating A Pattern
This time round i need to get the pattern drawn on the drawing board to be repeated on another area of the stage.I need it to be repeated 4x4 tile. Any idea??
Replicating A Pattern
This time round i need to get the pattern drawn on the drawing board to be repeated on another area of the stage.I need it to be repeated 4x4 tile. Any idea??
Calculating Input Text Field To Dynamic Field (easy Action Script)
hi. i'm trying to learn action script and i need help with this bit. i'm trying to use action script to calculate my brothers ages based on my own.
using flash MX. i have an input field called "my_age" and two dynamic fields called "eli_age" and "jacob_age". eli is 4 years younger and jacob is 6 years younger. i want to be able to enter my age in the "my_age" input field and then click a button that will calculate their respective ages.
here's the fla if i haven't been clear.
thanks for any/all help,
josh
Getting A Text String Value From A Text Field And Duplicating It In Another Text Field
I'm trying to take the text from one text field and duplicate it in another.
I want to display the text that is in the text field _root.MC_Control.tab_title in another text field called _root,video_title.
I have tried this:
_root.video_title.text = _root.MC_Control.tab_title.text;
and this:
_root.video_title.text == _root.MC_Control.tab_title.text;
neither one seems work....am I missing something?
[FMX04] AS - Showing Text Field As HTML Field With XML/CDATA.
Hey all -
Trying to get a text field in my Flash MX movie to pull from and XML file with CDATA tags to show as HTML. I've checked the box to render as HTML for the text data field... but I'm having problems with the Actionscripting.
The field from this line is what I need to recognize as HTML reading CDATA tags:
this.ref["textField"+i].text = subnodes[3].firstChild.toString()
I know I need to do more than just change it to ".html" instead of ".text" and have tried a couple things, but nothing seems to work.
Any help greatly appreciated!
Code:
//Create the XML Object
myXML = new XML ();
myXML.load(newXml);
myXML.ignoreWhite = true;
//Load XML file
myXML.load("PBintro.xml");
//Make a reference to current timeline
myXML.ref = this
// Parse XML and fetch
myXML.onLoad = function(success){
if(success){
var root = this.firstChild ;
nodes = root.childNodes
for(var i=0; i<nodes.length; i++) {
this.ref["Title_txt"+i].text = nodes[i].attributes.name
subnodes = nodes[i].childNodes
this.ref["Comments_txt"+i].text = subnodes[0].firstChild.toString()
this.ref["Link_txt"+i].text = subnodes[0].firstChild.toString()
this.ref["Link_txt"+i] = subnodes[1].firstChild.toString()
this.ref["holder_mc"+i].loadMovie(subnodes[2].firstChild.toString())
this.ref["textField"+i].text = subnodes[3].firstChild.toString()
this.ref["textField"+i] = subnodes[4].firstChild.toString()
}
} else trace("Error loading XML document")
}
Replicating MM Search Input Box
Hi Guys,
I have tried this - only have flash 5
Here is the fla - I have it working except when I roll on and off the textbox it fades in an out.
I only want it to fade when I click on it and click off it.
onClipEvent (load) {
this._alpha = 100;
alpha = no;
}
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true) && (alpha == no)) {
this._alpha -= 13;
// this._alpha++ // very slow
// this._alpha*= 10 //a bit faster
alpha = yes;
} else if (alpha == yes) {
this._alpha += 13;
}
}
onClipEvent (load) {
}
http://www.actionscript.org/forums/a...=&postid=50155
Cheers,
SuzyQ
Replicating Website + Flash
Okay. Here is my predicament. My Father's company (Natural Herbal Prodicts) is paying some people a large sum of money to design a website. The design that they are stuck with is mediocre and not very functional and I could do a much better job, and would like to do so, except for this obstable. They are making a replicating website, that would be plugged into the already existing database system. Let me explain...
The original domain name will be www.entreneteam.com
Say I ordered, then a site would automatically be created after the order at the url
www.entreneteam.com/eric.html
Now say I give my card to someone with my url on it and they will get the same frontpage as anybody else, but when they order, they will be put under me in the distributor line so that their orders benefit me.
So these frontpages would be replicated like a tree and tied into the distributor database. Now, he already has a programmer that can take care of the database part, and tying the database into it, but I would still personally have to do the replicating webbsite part of it myself.
Now I have no idea how to do that, and will gladly research, but is this possible to do in Flash MX or in Flash MX and Cold Fusion, so that I could include the funtionability of a replicating website, with a good flash design?
I would really be helping my father out of a situation if I could do so.
Thanks for your time.
Replicating Website + Flash
Okay. Here is my predicament. My Father's company (Natural Herbal Prodicts) is paying some people a large sum of money to design a website. The design that they are stuck with is mediocre and not very functional and I could do a much better job, and would like to do so, except for this obstable. They are making a replicating website, that would be plugged into the already existing database system. Let me explain...
The original domain name will be www.entreneteam.com
Say I ordered, then a site would automatically be created after the order at the url
www.entreneteam.com/eric.html
Now say I give my card to someone with my url on it and they will get the same frontpage as anybody else, but when they order, they will be put under me in the distributor line so that their orders benefit me.
So these frontpages would be replicated like a tree and tied into the distributor database. Now, he already has a programmer that can take care of the database part, and tying the database into it, but I would still personally have to do the replicating webbsite part of it myself.
Now I have no idea how to do that, and will gladly research, but is this possible to do in Flash MX or in Flash MX and Cold Fusion, so that I could include the funtionability of a replicating website, with a good flash design?
I would really be helping my father out of a situation if I could do so.
Thanks for your time.
Replicating OnDragOver In Flash 5
Hi every1. First post, wondering if you can help me.
The deal is I've got an MC that I am dragging around my scene and I need other MC's to be highlighted as I drag over them, i.e. the mouse is still down. Buttons don't work, onClipEvent only runs once whilst mouseDown (so I can't do a continuous position check) and the only thing I can think of working is the onDragOver and onDragOut events in MX but I am using flash 5?
Any feedback welcome. Can't help feeling like am being very stupid, am sure this is possible, but can't for the life of me think how.
Cheers,
Sir.
Replicating Flash, Am Stuck :(
Hey,
I seen this flash thing. And i want to learn how the computer gets brought into it. Take a look here http://www.clipitsolutions.co.uk/flash/flashmovie.swf .. As soon as it starts, the computer comes in with like a cirle being tweened over it. But i dont understand how to do this?
If anyone could help, would be most greatful. I really wana learn this technique but its fryin my brain lol
Thanks,
Paul
[CS3] Efficient Way Of Replicating MovieClips?
On my main timeline I have two dynamic text boxes and an input box that represent a math problem. I wanted there to be three problems on the screen at a time. Since I don't know much about classes and making packages I just copied and pasted the problem twice so that I have three instances of each text box. Next I basically just tripled my lines of code, one block for each of the three problems.
I'm assuming the proper way to handle something like that is to make the problem a MovieClip and then make a class for it. However, when I attempted to do that I got errors [possible undefined function] because code that still remained on the Main Timeline was referencing functions that had been moved from the Timeline into the mcProblem class. Could I change the code on the Timeline so that I won't be getting these referencing errors? If not, could you please provide some detailed information about what I should do regarding classes? Currently I am not using a document class.
If anyone understands what I'm trying to do, please guide me in the right direction. This is my first attempt at a solo project (for fun) and while I can achieve the desired swf sloppily I prefer to learn to do it the clean and efficient way.
|