Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Scrolling Textfield With Swf Inside



scrolling textfield with swf inside

hey there

i'm modding a file for a friend, and he'd like the ability to have a scrollbar that scrolls a big long interactive menu in the same way a regular textfield scrolls, using an mx scrollbar component that i skinned.

i just figured i'd load an html file with the following code:


code:<p class="body"><img src="sammidge.swf" vspace="0" hspace="0" width="380" height="1977"/></p>


where the 'body' class is defined in a stylesheet object in the swf. the movie loads into the textfield fine, but the problem is, it's about four times longer than the textfield and we want it to scroll, but the scrollbar remains dimmed, as though it doesn't register the length of the swf.

i tried it with a regular jpeg, and it does exactly the same thing. here's the code that loads the html file into flash:


ActionScript:PRE {font : normal normal normal 13 "Courier New", Courier, Arial;;}loaderate = new LoadVars();loaderate.load("sammidge.html");loadera te.onData = function(r) { sandwich.styleSheet = _root.stylizimo; sandwich.html = true; sandwich.htmlText = r;};


so, does anyone have any ideas? t'would be much appreciated.



FlashKit > Flash Help > Flash ActionScript
Posted on: 12-12-2004, 12:29 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Scrolling Textfield With Swf Inside
hey there

i'm modding a file for a friend, and he'd like the ability to have a scrollbar that scrolls a big long interactive menu in the same way a regular textfield scrolls, using an mx scrollbar component that i skinned.

i just figured i'd load an html file with the following code:


Code:
<p class="body">
<img src="sammidge.swf" vspace="0" hspace="0" width="380" height="1977"/>
</p>
where the 'body' class is defined in a stylesheet object in the swf. the movie loads into the textfield fine, but the problem is, it's about four times longer than the textfield and we want it to scroll, but the scrollbar remains dimmed, as though it doesn't register the length of the swf.

i tried it with a regular jpeg, and it does exactly the same thing. here's the code that loads the html file into flash:

code:
loaderate = new LoadVars();
loaderate.load("sammidge.html");
loaderate.onData = function(r) {
sandwich.styleSheet = _root.stylizimo;
sandwich.html = true;
sandwich.htmlText = r;
};


so, does anyone have any ideas? t'would be much appreciated.

Scrolling Textfield With Swf Inside
scrolling textfield with swf inside



hey there

i'm modding a file for a friend, and he'd like the ability to have a scrollbar that scrolls a big long interactive menu in the same way a regular textfield scrolls, using an mx scrollbar component that i skinned.

i just figured i'd load an html file with the following code:

code:<p class="body"><img src="sammidge.swf" vspace="0" hspace="0" width="380" height="1977"/></p>

where the 'body' class is defined in a stylesheet object in the swf. the movie loads into the textfield fine, but the problem is, it's about four times longer than the textfield and we want it to scroll, but the scrollbar remains dimmed, as though it doesn't register the length of the swf.

i tried it with a regular jpeg, and it does exactly the same thing. here's the code that loads the html file into flash:


ActionScript:PRE {font : normal normal normal 13 "Courier New", Courier, Arial;;}loaderate = new LoadVars();loaderate.load("sammidge.html");loaderate.onData = function(r) { sandwich.styleSheet = _root.stylizimo; sandwich.html = true; sandwich.htmlText = r;};

so, does anyone have any ideas? t'would be much appreciated.

Scrolling Textfield With Swf Inside
scrolling textfield with swf inside



hey there

i'm modding a file for a friend, and he'd like the ability to have a scrollbar that scrolls a big long interactive menu in the same way a regular textfield scrolls, using an mx scrollbar component that i skinned.

i just figured i'd load an html file with the following code:

code:<p class="body"><img src="sammidge.swf" vspace="0" hspace="0" width="380" height="1977"/></p>

where the 'body' class is defined in a stylesheet object in the swf. the movie loads into the textfield fine, but the problem is, it's about four times longer than the textfield and we want it to scroll, but the scrollbar remains dimmed, as though it doesn't register the length of the swf.

i tried it with a regular jpeg, and it does exactly the same thing. here's the code that loads the html file into flash:

ActionScript:PRE {font : normal normal normal 13 "Courier New", Courier, Arial;;}loaderate = new LoadVars();loaderate.load("sammidge.html");loaderate.onData = function(r) { sandwich.styleSheet = _root.stylizimo; sandwich.html = true; sandwich.htmlText = r;};

so, does anyone have any ideas? t'would be much appreciated.

Scrolling Textfield With Swf Inside
scrolling textfield with swf inside



hey there

i'm modding a file for a friend, and he'd like the ability to have a scrollbar that scrolls a big long interactive menu in the same way a regular textfield scrolls, using an mx scrollbar component that i skinned.

i just figured i'd load an html file with the following code:

code:<p class="body"><img src="sammidge.swf" vspace="0" hspace="0" width="380" height="1977"/></p>

where the 'body' class is defined in a stylesheet object in the swf. the movie loads into the textfield fine, but the problem is, it's about four times longer than the textfield and we want it to scroll, but the scrollbar remains dimmed, as though it doesn't register the length of the swf.

i tried it with a regular jpeg, and it does exactly the same thing. here's the code that loads the html file into flash:


ActionScript:PRE {font : normal normal normal 13 "Courier New", Courier, Arial;;}loaderate = new LoadVars();loaderate.load("sammidge.html");loaderate.onData = function(r) { sandwich.styleSheet = _root.stylizimo; sandwich.html = true; sandwich.htmlText = r;};

so, does anyone have any ideas? t'would be much appreciated.

Scrolling Textfield With Swf Inside
scrolling textfield with swf inside



hey there

i'm modding a file for a friend, and he'd like the ability to have a scrollbar that scrolls a big long interactive menu in the same way a regular textfield scrolls, using an mx scrollbar component that i skinned.

i just figured i'd load an html file with the following code:

code:<p class="body"><img src="sammidge.swf" vspace="0" hspace="0" width="380" height="1977"/></p>

where the 'body' class is defined in a stylesheet object in the swf. the movie loads into the textfield fine, but the problem is, it's about four times longer than the textfield and we want it to scroll, but the scrollbar remains dimmed, as though it doesn't register the length of the swf.

i tried it with a regular jpeg, and it does exactly the same thing. here's the code that loads the html file into flash:

ActionScript:PRE {font : normal normal normal 13 "Courier New", Courier, Arial;;}loaderate = new LoadVars();loaderate.load("sammidge.html");loaderate.onData = function(r) { sandwich.styleSheet = _root.stylizimo; sandwich.html = true; sandwich.htmlText = r;};

so, does anyone have any ideas? t'would be much appreciated.

Continuous Scrolling Inside Textfield
down_btn.onPress = function() {
textField_txt.scroll += 1;
};

I'm using this to scroll a textField but it means continuously clicking... Does anyone know a workaround for this so that it continuously scrolls while the button is pressed?

Thanks

[F8] Input Textfield Inside A Dynamic Textfield?
Hi,

Is it possible to place an input textfield inside a dynamic textfield?

I'd like to replace the variable, this.nTotal, below with an input textfield.
Is there some way to do this?

this.txtComplete.text = "There are " + this.nTotal + " pages in " + this.sGirlName + "'s book.";

Thanks!

Rotating Movieclip Inside A Button, Inside A Scrolling Menu Bar
Hi all,

I'm pretty new to actionscript, and I'm kinda moving along; up until now.

I've used the the infinite scrolling menu tute at kirupa.com, created my own button graphics, and have a nice scrolling menu. On the buttons, I'm adding an image (which seems to need to be a movie clip to work), so when you rollover the button, the image will spin.

The code for the spinning works. I've tested it on the root frame of a new movie, and in the button of the infinite scrolling menu movie. I've added the code to spin the image on the "over" frame of the button timeline. With the button scene open, I run "test scene", stop it, and move between the frames. When I advance to the rolloever frame, the image spins like a top, but when I test it from the root of the movie, the image does not spin. I've also added a color change "that works" from the root when you rollover the button, but the not the spinning image.

I've added the image by editing the button from the library. I select the image, and add the code inside an onClipEvent(enterFrame) action.

I've also tried adding the code to the keyframe of the root scene in layer 1, and tried calling the image by the full path (_root.one_button.buttons.button1.spin1._rotation= blah) thinking it needs to know exacty where the image(movie clip) is at in the heirarchy to no avail. I've even went back and gave everything an instance name up unto the button I'm trying all this on.


Any help would be appreciated, since I'm about ready to shed tears over this.



Thanks!

-Sam

Rotating Movieclip Inside A Button, Inside A Scrolling Menu Bar
Hi all,

This question is going ignored in some other boards, so I thought I'd try here....

I'm pretty new to actionscript, and I'm kinda moving along; up until now.

I've used the the infinite scrolling menu tute at kirupa.com, created my own button graphics, and have a nice scrolling menu. On the buttons, I'm adding an image (which seems to need to be a movie clip to work), so when you rollover the button, the image will spin.

The code for the spinning works. I've tested it on the root frame of a new movie, and in the button of the infinite scrolling menu movie. I've added the code to spin the image on the "over" frame of the button timeline. With the button scene open, I run "test scene", stop it, and move between the frames. When I advance to the rolloever frame, the image spins like a top, but when I test it from the root of the movie, the image does not spin. I've also added a color change "that works" from the root when you rollover the button, but the not the spinning image.

I've added the image by editing the button from the library. I select the image, and add the code inside an onClipEvent(enterFrame) action.

I've also tried adding the code to the keyframe of the root scene in layer 1, and tried calling the image by the full path (_root.one_button.buttons.button1.spin1._rotation= blah) thinking it needs to know exacty where the image(movie clip) is at in the heirarchy to no avail. I've even went back and gave everything an instance name up unto the button I'm trying all this on.


Any help would be appreciated, since I'm about ready to shed tears over this.

Attached is the zipped fla file



Thanks!

-Sam

Difference Between Scrolling A MC And Scrolling A Textfield?
Hi there,

What is the difference from scrolling a textfield and scrolling a movieclip?
My scrollbar resizes automatically with textfields,
and I don't know how to scroll movieclips within the same scroller. Do I only have to change some names or something?

Thanks Already

Textfield Inside A Mc?
Well, I have this code for my asp mailform. What I want is to be able to set onRollover on my textfields. It doesn't work directly on the textfields so I have to convert to mc and so on. That I know, what I cant figure out is how to write in this code when the textfields are inside an mc? Anyone?


Code:
this.send_mc.onRelease = function() {
if (!adress.length || adress.indexOf("@") == -1 || adress.indexOf(".") == -1) {
emailStatus = "Your e-mail, please";
}
else if (!name.length) {
emailStatus = "Your name, please";
}
else if (!message.length) {
emailStatus = "Say something";
}
else
{
loadVariablesNum ("ASPMail.asp", "0", "POST");
emailStatus = "Message sent";
}
}

Problem With A TextField Inside A MC
Hello everybody,

I have a little problem with a Dynamic textField.

I am including it into a MovieClip that is a preloader. The textField is to show the text: ....% to show the percent loaded.

When it finishes loading a MC or a JPG, the preloader movieClip fades out...but the textField remains in screen for few seconds showing "100%" and THEN fades out, or just dissapear.

Is it this how it is suppose to happen?

I want it to fadeout as the rest of the movieClip.

Thank you very much for your help,

Peace,

Cayo Hueso

Textfield Inside MovieClip
Hi all,
I'm trying to create a group of buttons that show images, all loaded from an XML file with 3 attributes Title (displayed together with photo), main (image path), button (text to display in button).
Everything seems to work correctly, but text will not show.
I can click on invisible link...to show images.
Here is my script.
What is wrong?

myPhoto = new XML();
myPhoto.ignoreWhite = true;
myPhoto.onLoad = function(success) {
//portfolioTag = this.firstChild;
numimages = this.firstChild.childNodes.length;
spacing = 20;
for (i=0; i<numimages; i++) {
this.picHolder = this.firstChild.childNodes[i];
this.thumbHolder = thumbnails.createEmptyMovieClip("thumbnail"+i, this.thumbHolder.getNextHighestDepth());
this.thumbLoader = this.thumbHolder.createTextField("my_text"+i, this.thumbLoader.getNextHighestDepth(), 10, i*20, 100, 20);
this.thumbLoader.multiline = true;
this.thumbLoader.wordWrap = true;
this.thumbLoader.color = 0xFF0000;
this.thumbLoader.underline = true;
this.thumbLoader.text(this.picHolder.attributes.bu tton);
this.thumbHolder.title = this.picHolder.attributes.title;
this.thumbHolder.main = this.picHolder.attributes.main;
this.thumbHolder.onRelease = function() {
loader.loadMovie(this.main);
title_txt.text = this.title;
};
}
};
myPhoto.load("xmlphoto.xml");

Textfield Inside Button?
Hi,

I want to make an input textfield inside a button. On the button must be a rollover event, but when I rollover the textfield inside the button i want to see the the I-beam (so users can see they can type) But when I roll over the button (around the textfield) I wanna see the "handcursor" I cant fix this, if I place the textfield inside the button i cant type in it (if there is an event on the button) but if i place the textfield outside of the button the rollover event of the button disapears when i roll over the textfield :S

can anyone help me on this one?
Thanx in advance

Timon

Initializing Textfield Inside An Mc
I'm trying to change the text property of a mc on frame2. The code is located at the AS layer and looks like this

_level0.butt2.texto.text="Button 2";

where butt2 is the instance name of the mc and texto the instance name of the dynamic textfield inside the mc.

I've tried with _root in place of _level0, but the trace() statement shows _level0 on the path:

trace(butt2.texto); output is:
_level0.butt2.texto

Can someone show me some light?

Movieclip Inside Textfield?
Is it possible to place a movieclip inside a dynamictextfield? How?

Problem With A TextField Inside A MC
Hello everybody,

I have a little problem with a Dynamic textField.

I am including it into a MovieClip that is a preloader. The textField is to show the text: ....% to show the percent loaded.

When it finishes loading a MC or a JPG, the preloader movieClip fades out...but the textField remains in screen for few seconds showing "100%" and THEN fades out, or just dissapear.

Is it this how it is suppose to happen?

I want it to fadeout as the rest of the movieClip.

Thank you very much for your help,

Peace,

Cayo Hueso

Problem With A TextField Inside A MC
Hello everybody,

I have a little problem with a Dynamic textField.

I am including it into a MovieClip that is a preloader. The textField is to show the text: ....% to show the percent loaded.

When it finishes loading a MC or a JPG, the preloader movieClip fades out...but the textField remains in screen for few seconds showing "100%" and THEN fades out, or just dissapear.

Is it this how it is suppose to happen?

I want it to fadeout as the rest of the movieClip.

Thank you very much for your help,

Peace,

Cayo Hueso

TextField Inside The Label Component.
Could you please tell me how to access TextField inside the Label class. I just need to work with it, because it has .maxhscroll property, but Label does not. I just want to cut "out of scroll" text. In case of TextField I can do the following:

TextField.prototype.cutExtra = function() {
while (this.maxhscroll>0) {
this.text = this.text.substring(0,this.text.length-1);
}
}

But where can I find TextField inside the Label?

Thank you, guys!

Making Buttons Inside Of A TextField?
Hello,

What I am trying to accomplish is having a textField full of text, and making certain words buttons, that will load movies into another container.

First, is there an easier way than selecting a word in a textfield and converting it to a symbol?

All the tutorials I can find just link words to HTML content in a blank browser window, I need to load a swf into a container.

Any help woulkd be appreciated.

Thanks!

Refer To Textfield Inside Button?
Hey, is it possible to dynamicly put text inside a texfield inside a button?


buttonInstance.texfield = "hello";

why doesnt this work? just like with a movieclip?

Dynamic Textfield Inside A Movieclip
This has been bugging me for quite some time and I can't find info on this anywhere. I'm creating movieclips. The # of movieclips comes from my xml file. I'm then trying to make textfields inside each of these movieclips that will hold the text from the xml file. But I just can't get it to work. Here is my lame try:


Code:
var nTotalButtons = 4;
var astrText:Array = new Array();
astrText = ["one", "two", "three", "four"];

for (var i = 0; i<nTotalButtons; i++) {

var navButton = navMenu_mc.createEmptyMovieClip("navButton"+i, i);
//trace (navButton);

var navText = navButton.createTextField("navText"+i,0,0,100,100);
navText = astrText[i];
//trace (navText);

}
Here is my Output:

Code:
_level0.navMenu_mc.navButton0
one
_level0.navMenu_mc.navButton1
two
_level0.navMenu_mc.navButton2
three
_level0.navMenu_mc.navButton3
four
Any information would be greatly appreciated.

Creating A Textfield Inside A Movieclip
Hey guys!

I'm trying to make a dictation exercise and so far I've managed to create this.

I've been trying to create the dynamic text field inside a movieclip, but I can't seem to get it to work. How do I put myText+i into myMC+i?

Any ideas?


Code:
var myMC:MovieClip = this.createEmptyMovieClip("myMC"+i,this.getNextHighestDepth);
var myText:TextField = this.createTextField("myText"+i,this.getNextHighestDepth(),textX,textY,0,0);

Here's the complete code for reference:

Code:
//Define the String object and add a bunch of text
var myString:String = new String("This is some example text: Michael Moore, film-maker and scourge of the Bush administration, has been handed a timely gift of pre-release publicity for his new documentary, SiCKO, by the US treasury department which is investigating him for filming in Cuba in violation of a travel ban. A letter from the treasury posted on Moore's website asked him to explain how he came to be in Cuba in March without authorisation. Dated May 2, the letter requested information on his travel dates, a list of people who went with him and justification for his presence in Cuba in apparent contravention of the terms of the US embargo of the country imposed since 1962.By deciding to investigate Moore, government officials seemed unaware that he has consistently thrived on such confrontation.");

//Define the Array object to store the seperated words
var myArray:Array = new Array();

//Define the _x and _y position variables of the text fields
var textX:Number = 10;
var textY:Number = 10;
var rightX:Number = Stage.width-100; //Right limit on Stage

function splitText():Void{
//Split the string Object at the spaces
myArray = myString.split(" ");

//Assign the split words to text fields
for(var i:Number = 0; i<myArray.length; i++){
var myMC:MovieClip = this.createEmptyMovieClip("myMC"+i,this.getNextHighestDepth);
var myText:TextField = this.createTextField("myText"+i,this.getNextHighestDepth(),textX,textY,0,0);

//Define TextFormat object
var myFormat:TextFormat = new TextFormat();
myFormat.font = "Verdana";
myFormat.size = 16;
myFormat.bold = true;
myText.setNewTextFormat(myFormat);
myText.autoSize = "left";
myText.text = myArray[i];

//Wrap the text if it goes beyond rightX
textX += myText._width;
if(textX>rightX){
textX = 10;
textY += myText._height;
}
}
};

splitText();

TextField Inside A Custom Class
Hi,

Strange problem, I have a class structure for a menu system. At the top ofthe structure is the ScreenObject class which is abstract. MenuObject extends ScreenObject. MenuItem models individual menu items and therefore the MenuObject creates several of them. The problem I am having is that I want a text box displayed inside MenuItem and it refuses to show up. Code:

MenuItem class should draw a circle then place text on top, however, it does draw the circle but not the text.

ActionScript Code:
package table{

    import flash.display.Sprite;
    import flash.events.Event;
    import flash.display.MovieClip;
    import flash.text.*;
    public class MenuItem extends Sprite {
       
        var myTextField:TextField = new TextField();

        public function MenuItem() {
            this.graphics.lineStyle(1);
            this.graphics.beginFill(0x00ff00);
            this.graphics.drawCircle(0,0,30);
            this.graphics.endFill();           

            myTextField.text = "s";
            myTextField.width = 250;
            myTextField.autoSize = TextFieldAutoSize.LEFT;
           
            this.addChild(myTextField);

        }
}

MenuObject class creates several MenuItem instances by running this several times:

ActionScript Code:
var temp:MenuItem=new MenuItem  ;
menuItems[counter]=temp;
this.addChild(menuItems[counter]);
Seems to work perfectly as my MenuItem circles are displayed

Main timeline simply creates a MenuObject:

ActionScript Code:
var mine:MenuObject = new MenuObject();
    addChild(mine);

Circles show on my menu but text refuses to. The same text generating code copied to the main timeline works fine so I am confused.

Cheers,
E1

Textfield Inside A Movieclip Will Have Problem
I find that when you try to resize a movieclip with a textfield inside to size 0, 0, then it will become infinite large.

try the following code:


this.createEmptyMovieClip("mc", 1);
mc.createTextField("tb", 1, 0, 0, 400, 20);
mc.tb.text="the text area will become huge after resize, look at your cursor"
onMouseDown = function () {
mc._height = mc._width=0;
};


Is it a bug ? Any solution ?

Getting Text Of TextField Inside A Button
I want to retrieve the text of the Dynamic textfield, Which is placed inside the button.


Example: I have a Button named "Button1" instance name "But1" and name of the Textfield which is placed inside the button is "Text1" instance name "TF". (its value is "Test Value");

When i tried to get the value of the text field, using

trace(_root.But1.TF.text);

its returning undefined.. can anyone help me.

Embed A MovieClip Inside A TextField
Hi, I have use htmlText in the past to embed images in to flash text. Is it possible to embed also MovieClips and Sprites? If yes can you please give me an example.
Thank you for your time.

OnSetFocus Select The Text Inside The Textfield
I am tring to make it so when the cursor getFocus on a textfield that it will highlight the text inside that text field.

I am tring the Selection.setSelected but not sure how to get it to work.

Any ideas?

Accessing A Dynamic Textfield That's Inside A Loaded Swf
so I loaded a swf onto my stage using the Loader Class.

so when I trace this:

trace(stage.getChildByName('_loader'));

it returns [object Loader].

Ok so far.

But suppose I want to access a dynamic textfield that's inside the swf I just loaded. How would I access it?

This throws an error:

code: stage.getChildByName('_loader').data_txt.text = 'test';

so does this:
code: stage.getChildByName('_loader').getChildByName('da ta_txt').text= 'test';

Any help would be greatly appreciated.

How Do I Create A Textfield Inside A Movieclip At Runtime?
I thought this would be simple, but it has proven not to be.

I have a Movie Clip on my stage called contentMC.
With ActionScript 2.0 I can create a textfield inside this MC at runtime using: contentMC.createTextField("contentText", 1, 0, 0, 300, 200);

With ActionScript 3.0 I can create the same textfield using:
private var contentText:TextField = createTextField(0, 0, 300, 200);
but I have no idea how to create it inside contentMC?

Please help.

Creating TextField And Formatting It Inside A Duplicated Mc
Hello. I've searched through the threads and none of the solutions that worked for others' problems worked for me.

I'm able to use the following code, in an empty movie, to accomplish my goal:

PHP Code:



function buildText() {
    for (i=0; i<=4; i++) {
        yVar = (i*15);
        var daForm:TextFormat = new TextFormat();
        daForm.font = "Verdana";
        var container:MovieClip = this.createEmptyMovieClip("container", this.getNextHighestDepth());
        var label:TextField = container.createTextField("label", 1, 5, yVar, 150, 20);
        label.text = "Hello World";
        label.setTextFormat(daForm);
    }





However, when I try using the above success within the following code, I get no text at all, much less formatted:

PHP Code:



function showDate() {
    dateID = (_root.yearVar+_root.monthVar+_root.dayVar);
    duplicateMovieClip("_root.widget", "zDay", 1);
    zDay._x = 114;
    zDay._y = 125;
    zDay.dateNum = _root.dayVar;
    for (var i = 0; i<_root.eventData_xml.firstChild.childNodes.length; i++) {
        if (_root.eventData_xml.firstChild.childNodes[i].attributes.daYear == _root.yearVar & _root.eventData_xml.firstChild.childNodes[i].attributes.daMonth == _root.monthVar & _root.eventData_xml.firstChild.childNodes[i].attributes.daDay == _root.dayVar) {
            yVar = (i*40);
            var container:MovieClip = zDay.createEmptyMovieClip("container", zDay.getNextHighestDepth());
            var label:TextField = container.createTextField("label", container.getNextHighestDepth(), 10, yVar, 150, 20);
            var daForm:TextFormat = new TextFormat();
            daForm.font = "Verdana";
            label.text = _root.eventData_xml.firstChild.childNodes[i].attributes.daName;
            label.setNewTextFormat(daForm);
        }
    }





I know that huge if statement could probably be written better, but since it works for the moment, I'm not worried about it. If someone could point out what I'm doing wrong I would greatly appreciate it.

On a side note, I can use the following to create the text fields I need, though not inside my duplicated mc, but for some reason they don't take formatting:

PHP Code:



function showDate() {
    dateID = (_root.yearVar+_root.monthVar+_root.dayVar);
    trace("dateID = "+dateID);
    duplicateMovieClip("_root.widget", "zDay", 1);
    zDay._x = 114;
    zDay._y = 125;
    zDay.dateNum = _root.dayVar;
    for (var i = 0; i<_root.eventData_xml.firstChild.childNodes.length; i++) {
        if (_root.eventData_xml.firstChild.childNodes[i].attributes.daYear == _root.yearVar & _root.eventData_xml.firstChild.childNodes[i].attributes.daMonth == _root.monthVar & _root.eventData_xml.firstChild.childNodes[i].attributes.daDay == _root.dayVar) {
            yVar = (i*40);
            var daForm:TextFormat = new TextFormat();
            daForm.font = "Verdana";
            var label:TextField = this.createTextField("label", 2, 8, yVar, 150, 20);
            label.text = _root.eventData_xml.firstChild.childNodes[i].attributes.daName;
            label.setNewTextFormat(daForm);
        }
    }


Update A Textfield From A Function Inside An As File
I'm trying to update a text field on my stage based on the results of a function. My function is in a as file however when it gets to the

textField.text="something" part it errors out with the following message
ReferenceError: Error #1065: Variable mainDisplay is not defined.

here is the line in my functin code
mainDisplay.text="GAME OVER TRY AGAIN";

how do i reference the textField mainDisplay from the function contained with the as file

I have tried stage.mainDisplay

any help would be appreciated.

regards

Sprite With Textfield Inside Acting As A Button
Hi everybody,

i've an AS 2/1 programmer for as long as it has been around and recently i've been getting more and more work done in AS3. I absolutely love it, but there's still some small parts ruining the fun for me

This is just a small thing bugging me and i'm not finding a solution very quickly, here it is :

i have a sprite on stage , and within that sprite is a textfield. Now the sprite has buttonMode enabled and has listeners attached.
But the thing is that when i hover on the sprite, i see a nice handcursor, but when i hover on the textfield inside this sprite, the handcursor dissapears, but the listener is still fired when clicked here.

How can i fix it so that the entire sprite feels like a whole button?

Many thanks for reading


*Edit *
Also, it seems that the textfield and sprite fire off the same event to the same function, but the event target seems to differ depending on what you clicked, it seems illogic because i have no listener attached to the textfield, is there also a fix for this?

How Do I Create A Textfield Inside A Movieclip At Runtime?
I thought this would be simple, but it has proven not to be.

I have a Movie Clip on my stage called contentMC.
With ActionScript 2.0 I can create a textfield inside this MC at runtime using: contentMC.createTextField("contentText", 1, 0, 0, 300, 200);

With ActionScript 3.0 I can create the same textfield using:
private var contentText:TextField = createTextField(0, 0, 300, 200);
but I have no idea how to create it inside contentMC?

Please help.

Is There A Listener For When Making A Selection Inside A Textfield
Hello,
Does anyone know how to create a listener that listens when you select some text inside a textfield?
I am trying to run a function after a selection is made. Because after you made the selection you can
get the Selection.getBeginIndex() and the Selection.getEndIndex();

Regards,






























Edited: 12/08/2008 at 01:54:18 AM by Michealnl

Textfield Inside Mc, Text Jumps Randomly
Hi all,
i have a movieclip, and inside it i have a textfield and it has a dynamically loaded htmlText inside it. Now, when i move the movieclip, the text inside the textfield moves by itself, it jumps from rows to rows.

What can i do?

Embedding Textfields And Buttons Inside A Textfield
I have a fla file which creates mutiple buttons dynamically, and a dynamic textfield to go with each button as a label. Depending on the number of rows in the backend database, the number of buttons with their textfields can grow significantly and, therefore, after about 10 instances, they go off the flash movie area so the remaining instances cannot be seen.

I don't want to increase the height of the movie or make the instances smaller. What I would like to do is place these buttons with their textfields inside a scrollable container.

I would prefer to design and code my own "up" and "down" buttons. Is it possible to embed these instances inside a dynamic textfield and then use the .scroll property?? How would I do this using actionscript? Is there a better way of doing this?

Editing A Dynamic Textfield Created Inside An Mc
i have a dynamic textfield embedded inside a movie clip. i creadted the textfeld inside an mc so i could easily add drag drop functionality. the problem now is thatthe focus remains on the mc always thus not allowing the user to edit the input text field. heres my code.

_root.createEmptyMovieClip("textfield_container_0", 100);
var tfc = _root.textfield_container_0;

tfc.onPress = function() {
tfc.startDrag(false);
};
tfc.onRelease = function() {
tfc.stopDrag();
};

tfc.createTextField("textfield_0", 100, 0, 0, 100, 25);
var tf = _root.textfield_container_0.textfield_0;
tf.type = "input";
tf.autoSize = true;
tf.multiline = true;
tf.wordWrap = true;
tf.border = true;
tfm = new TextFormat();
tfm.size = 25;
tf.text = "this is my first test field object text";
tf.setTextFormat(tfm);rmat(tfm);

Scrolling Textfield
hello!

i'd like to know how to build a scrolling textfield in flash 4 including a dragable slider and two buttons, one for up and one for down. i've worked through a turorial on the flashkit site and it works fine in flash 5 but not in version 4.

has anyone got an example fla or knows an url where to find a proper tutorial?

in case you've got an example could you mail it? here is my adress:
lounge@transporter.at


thanks,
elo.

Scrolling Textfield Help
this is my current cv, painstakenly written in flash, but i need an easier way to load the info into the website from a separate text (updating this site is a pain)...so here is the old site:
http://disfasia.net/cv/cvenglish.html

I decided to external an data file and load this into a flash file with xml. Here are the files for the flash/xml combination:

http://www.disfasia.net/testcv.zip

Yet, as you will notice, this testcv file does not scroll up or done without an outside button (how to do this with the white border and title UNDER which the swf must file itself). It seems also complex to figure out how to get this to look like the first website. So, recently someone suggested a scrolling textfield would do the trick. I know how to do this, BUT i cannot change the fonts as in this testcv---which has one line in bold, the next line not in bold.

Here is what I was able to do from a tutorial:

http://www.disfasia.net/scrolling_tutorial.zip

please advise.

all help appreciated greatly!

cheers


disfasia

Scrolling Textfield Is Getting Me Down
hi i just created a scrolling text field for a website and when i test my movie if functions correctly, until i navigate to the other pages of the website after i have used the scroll bar. these errors happen after the page that has the scrolling textfield.

please advise
TypeError: Error #1009: Cannot access a property or method of a null object reference.


var textLoader:URLLoader = new URLLoader();
var textFile:URLRequest = new URLRequest("text/external.txt");

var scrollPercent:Number = 0;
var minScroll:Number;
var maxScroll:Number;
var targetScroll:Number = text_mc.y;
var easing:Number = 5;
var scrollAmt:Number = 15;
var scrollDirection:Number = 0;


function textLoaded(event:Event):void
{
text_mc.external_txt.text = textLoader.data;
minScroll = text_mc.y;
maxScroll = minScroll - text_mc.height + mask_mc.height;
}

function dragScroller(event:MouseEvent):void
{
var dragX:Number = line_mc.x - scroller_mc.width/2;
var dragY:Number = line_mc.y;
var dragW:Number = 0;
var dragH:Number = line_mc.height - scroller_mc.height;

scroller_mc.startDrag(false, new Rectangle(dragX,dragY,dragW,dragH));
stage.addEventListener(MouseEvent.MOUSE_UP, stopDragging);
stage.addEventListener(Event.ENTER_FRAME, setScrollPercent);
stage.removeEventListener(Event.ENTER_FRAME, scrollText);
}

function stopDragging(event:MouseEvent):void
{
scroller_mc.stopDrag();

}

function setScrollPercent(event:Event):void
{
scrollPercent = (scroller_mc.y - line_mc.y) / (line_mc.height - scroller_mc.height);
if(scrollPercent < 0)
{
scrollPercent = 0;
}
else if(scrollPercent > 1)
{
scrollPercent = 1;
}
targetScroll = (scrollPercent * (maxScroll - minScroll)) + minScroll;
text_mc.y -= (text_mc.y - targetScroll) / easing;
}

function scrollUp(event:MouseEvent):void
{
setDirection(scrollAmt);
}

function scrollDown(event:MouseEvent):void
{
setDirection(-scrollAmt);
}

function setDirection(dir:Number):void
{
scrollDirection = dir;
stage.addEventListener(Event.ENTER_FRAME, scrollText);
stage.addEventListener(MouseEvent.MOUSE_UP, stopScrolling);
stage.removeEventListener(Event.ENTER_FRAME, setScrollPercent);
}

function scrollText(event:Event):void
{
targetScroll += scrollDirection;
text_mc.y -= (text_mc.y - targetScroll) / easing;
if(text_mc.y > minScroll)
{
text_mc.y = minScroll;
targetScroll = minScroll;
}
else if(text_mc.y < maxScroll)
{
text_mc.y = maxScroll;
targetScroll = maxScroll;
}
scrollPercent = (text_mc.y - minScroll) / (maxScroll - minScroll);
scroller_mc.y = (scrollPercent * (line_mc.height - scroller_mc.height)) + line_mc.y;
}

function stopScrolling(event:MouseEvent):void
{
scrollDirection = 0;
}

textLoader.load(textFile);
scroller_mc.buttonMode = true;
text_mc.external_txt.autoSize = TextFieldAutoSize.LEFT;
scroller_mc.addEventListener(MouseEvent.MOUSE_DOWN, dragScroller);
textLoader.addEventListener(Event.COMPLETE, textLoaded);
up_btn.addEventListener(MouseEvent.MOUSE_DOWN, scrollUp);
down_btn.addEventListener(MouseEvent.MOUSE_DOWN, scrollDown);

Scrolling TextField Please Help
Hello I am creating a dynamic text field that can be scrolled.

It is working but only problem is when I drag the sroller or click up or down button the text start srolling but now I want to add a stage event listener to check when the mouse moves up on the stage and that means the user have stoped dragging.

I can implelement stage.addEventListener(MouseEvent.MOUSE_UP, endDrag); fine when I have the code on the main timeline but when I move it into a class and add it there it give me an error saying null object reference

can any one please tell me how to resolve this I am attaching the fla and the class file

DuplicateMovieClip Problem - Textfield Inside Clip Inaccessible?
Ok... so I am creating an XML blog reader. So far the only thing that works is that the XML object grabs the number of nodes and duplicates a movieclip and moves it accordingly to make it look nice in a scrollbar... that is all fine...

The Problem:
Inside the movieclip that I duplicated using the movieClip.duplicateMovieClip method, there is a text box with the instance name of blog_title, obviously for the blog title.. but for some reason if i use the new name of the new movie... i can't access the text area... even if i use _parent["currentClip"+i].blog_title.text

Below is my code... let me know what you think:

myBlogs = new XML();
myBlogs.ignoreWhite = true;
myBlogs.load("blogs.xml");
myBlogs.onLoad = function(success) {
if(success){
numblogs = this.firstChild.childNodes.length;
_root.total_count.text = "Total Blogs: "+numblogs;
for (i=0; i<numblogs; i++) {
this.blogCase = this.firstChild.childNodes[i];
currentTitle = this.blogCase.attributes.blogT;
currentFile = this.blogCase.attributes.blogL;
currentClip = "blog_link"+(i+1);
blog_link.duplicateMovieClip(currentClip,i);
setProperty (currentClip, _y, +i*30);
}
}
};

Textfield Turns White When Image Is Loaded Inside
Why does html-enabled textfield turn white when image is loaded inside?
Is this a known bug in flash 8?
Is it possible to prevent it?
Please help!

http://www.hot.ee/freq/textfield.html

files are attached

TextField Not Selectable Inside MovieClip With Mouse Events
Ok this one's been bugging me for a while.. I've searched through the forum heavily and can't find a workaround for this.

When you place a TextField inside a movieclip, works great normally. But as soon as you apply an OnRollover/OnPress/OnRelease etc the textfield is not selectable and becomes useless. I assume this is due to the way flash captures the mouse events, I know the problem has been around for a long time. Does anyone know of a good way to get around it?

I've tried a few things like creating the textbox dynamically, etc but still doesnt work.. I want to have a comments form scroll down when you hover over the "Comments box", which means it needs to be inside a movieclip with mouse events attached.

DuplicateMovieClip Problem - Textfield Inside Clip Inaccessible?
Ok... so I am creating an XML blog reader. So far the only thing that works is that the XML object grabs the number of nodes and duplicates a movieclip and moves it accordingly to make it look nice in a scrollbar... that is all fine...

The Problem:
Inside the movieclip that I duplicated using the movieClip.duplicateMovieClip method, there is a text box with the instance name of blog_title, obviously for the blog title.. but for some reason if i use the new name of the new movie... i can't access the text area... even if i use _parent["blog_link"+i].blog_title.text

Below is my code... let me know what you think:


Code:
myBlogs = new XML();
myBlogs.ignoreWhite = true;
myBlogs.load("blogs.xml");
myBlogs.onLoad = function(success) {
if(success){
numblogs = this.firstChild.childNodes.length;
_root.total_count.text = "Total Blogs: "+numblogs;
for (i=0; i<numblogs; i++) {
this.blogCase = this.firstChild.childNodes[i];
currentTitle = this.blogCase.attributes.blogT;
currentFile = this.blogCase.attributes.blogL;
currentClip = "blog_link"+(i+1);
blog_link.duplicateMovieClip(currentClip,i);
setProperty (currentClip, _y, +i*30);
_parent["blog_link"+(i+1)].blog_title.text = currentTitle;
}
}
};

Creating TextField Inside A Class Derived From MovieClip
I've got a problem while trying to create a TextField inside an object that is a class derived from MovieClip. MovieClip's method createTextField doesn't return a reference to a newly created object, as do attachMovie or createEmptyMovieClip, so I cannot assign it to a private variable of the class instance. For doing that automatically (as createTextField should do) I declared my subclass as dynamic (so any code can add some properties to it). But this didn't help at all...
So, the code:

ActionScript Code:
dynamic class com.maninblack.ui.Hint extends MovieClip {
    // NOTE : some code was ommited, it has no value for the situation
    //
    private var caption_txt:TextField;
    //
    public function Hint()
    {
        this.caption_txt = null;
        //
        this.initGraphics();
    }
    //
    private function initGraphics() {
        if (this.caption_txt == null) {
            // this.caption_txt = ... won't work, because the function returns Void (nothing)
            this.createTextField('caption_txt', 1, 0, 0, 1, 1);
            // and, for example, making it not selectable
            this.caption_txt.selectable = false;
        }
        //
        trace(this.caption_txt);
        // gives "null"
    } // function initGraphics
} // class Hint
I think, attaching some external MovieClips with created TextField in them or creating some internal empty MovieClip that will create a TextField properly inside itself, may work as I need. But I don't want to have a fully qualified MovieClip as just a container for creating a TextField that appears in the scene rarely (as Hints do).
So, how to make ActionScript do the thing?

Thanks.

Why Does TextField Inside Of A Sprite Lose Its Hand Pointer?
Just copy and paste this code onto frame 1 of a new Flash CS3 (AS3) project and publish the swf. You'll notice that you get a hand cursor over the part of the sprite that's been drawn with the drawing API, but once you mouse over the text field inside the sprite, you lose the hand cursor. Why is this? How can you stop that from happening?


ActionScript Code:
import flash.display.Sprite;
import flash.text.TextField;

var txt:TextField=new TextField();
txt.background=true;
txt.backgroundColor=0xff0000;
txt.selectable=false;
txt.autoSize='left'
txt.text=' text field ';
txt.x=txt.y=3;

var button:Sprite=new Sprite();
button.buttonMode=true;
button.addChild(txt);

with(button.graphics){
    moveTo(0,0);
    beginFill(0x00ff00);
    lineTo(200,0);
    lineTo(200,25);
    lineTo(0,25);
    lineTo(0,0);
    endFill();
}

stage.addChild(button);

How Can I Apply A TextFormat To A Dynamic Textfield Inside A Button ?
Hi,

I have a dynamic textfield inside a button.
I load text to the textfield using a variable, I assigned _root.valvar variable to the textfield, and I change the text shown in textfield by changing _root.valvar value. That is fine.
I want to apply a TextFormat to it, because although I centered the text in design time, it is not being centered at all.
But how can I reference the textfield to apply the textformat to it ?

This is what I have:
main movie clip
button_btn ( the button)
txt_on (a dynamic textfield inside the button, which is shown when mouse is on button)
txt_off (another dynamic textfield inside the button)

I tried _root.button_btn.txt_on but that path does not seem to be right. I tried to get the path in the Actions panel directly, but it stops at the button, it does not let me access items inside the button.

Any ideas??

Thanks !!!!

Copyright © 2005-08 www.BigResource.com, All rights reserved