Masking A Text Scroller Using ActionScript, (file Avail For Download)
hello,
the movie (located at http://66.241.229.187/test.zip) has a text scroller that reads from an xml document (acquired at krazydad.com), and i'm trying to mask it underneath a rectangle, but to no avail. on his site he suggests the method below, which hasn't worked for me:
// at the end of the AS on frame 1:
mask_mc.swapDepths(10); ticker_mc.setMask(mask_mc);
thanks for any help on this
SitePoint > Design Your Site > Flash and Actionscript
Posted on: May 19, 2004, 18:03
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
- Download Text File Using Actionscript
- Masking A Text Scroller
- Text Scroller Download Can You Make Smoother Scrol
- Actionscript : Download File
- Download File Button With Actionscript?
- Actionscript Masking And Text
- Download File From Xml Text
- Masking Dynamic Text Created From Actionscript.
- Download Text File Button
- Link To Download Text Or .doc File
- Creating My OWN Text Scroller For Text Loaded From A .txt File?
- Text Scroller With Txt File : Help Me, Please
- Problem With Actionscript Text Scroller And Special Character
- News Scroller From Text File
- Loading Text Into Scroller From Txt. File?
- Loading Text Into Scroller From Txt. File?
- Scroller That Calls On TEXT File?
- Problem Masking A Dynamic Text File
- Masking Externally Loaded CSS Text (from.txt File)
- Problem With Masking Html Text From File
- Cool Dynamic Text Scroller For Txt File - But...
- Scroller And Dynamic Html Text File
- Link On My Text , In My External Loading Txt. File, For My Scroller------------------
- Help With Custom Scroller With Externally Loaded Text File
- External File Scroller - Links, Text And Images
- Image+text Scroller, Form Scroller, And Loading External Text Files - Urgent
- Image+text Scroller, Form Scroller, And Loading External Text Files - Urgent
- Inserting File (News Reader) / Vertical Text Scroller
- Dynamic Scroller>problem Masking
- Window Scroller Masking Problem
- I've Posted This Before To No Avail....
- Please HELP..i've Been Scouring The Net To No Avail...
- Pop-ups Are Killing Me... Anyone Know? Ive Searched But To No Avail
- Text Scroller Help - Scroller Won't Scroll Full Length Of Text?
- Urgent Help: FlashTyper Download Or Any Other Free Text Animator Download
- TRYING To Print A Movie Clip Out - To No Avail
- Searched To No Avail (frames Prob.)
- Resize Movie To 100% Of Browser's Avail Height
- Loadmovie, Getbytesloaded, Pass Variables, No Avail
- Convert Movieclip Scroller To Dynamic Text Scroller
- Convert Movieclip Scroller To Dynamic Text Scroller
- Import Text Directly Into Actionscript From A Text File?
- Import Text Directly Into Actionscript From A Text File?
- Text Scroller With Image With Mouse Scroller
- ActionScript In A Text File
- Actionscript In Text File?
- Help With Text File ActionScript
- Why Word Document File Types Wouldn't Allow File Download?
- Compare File And Check Progress Of File Download Y Using Flash
Masking A Text Scroller
I'm having some problems with a text box that i'm trying to mask. What happens is that the text in the MC seems to jump or vibrate slightly during the animation. Can anyone take a look a the .fla and tell me what they think is the problem?
Text Scroller Download Can You Make Smoother Scrol
If I give you this text scroller download can you make it scroll smoother? Thats the challenge I havent seen one roll smoothe yet. Can you apply some code to make it scrol in small pixel amounts and speed as well? So that it rolls up or down the screen the same as movie words scrol on the TV screen?
http://www.geocities.com/jaffasoft2/texscroller.fla
Actionscript : Download File
i got this script from the library from flash but i cant seem to make it work on local folders.
i tried to replace the "http://balbal" with just "../mov/movie.mov" and it doesnt work. What seems to be the problem?
Code:
import flash.net.FileReference;
var listener:Object = new Object();
listener.onSelect = function(file:FileReference):Void {
trace("onSelect: " + file.name);
}
listener.onCancel = function(file:FileReference):Void {
trace("onCancel");
}
listener.onOpen = function(file:FileReference):Void {
trace("onOpen: " + file.name);
}
listener.onProgress = function(file:FileReference, bytesLoaded:Number, bytesTotal:Number):Void {
trace("onProgress with bytesLoaded: " + bytesLoaded + " bytesTotal: " + bytesTotal);
}
listener.onComplete = function(file:FileReference):Void {
trace("onComplete: " + file.name);
}
listener.onIOError = function(file:FileReference):Void {
trace("onIOError: " + file.name);
}
var fileRef:FileReference = new FileReference();
fileRef.addListener(listener);
var url:String = "http://www.macromedia.com/platform/whitepapers/platform_overview.pdf";
if(!fileRef.download(url, "FlashPlatform.pdf")) {
trace("dialog box failed to open.");
}
Download File Button With Actionscript?
I'm attempting to make a simple button that when clicked, will allow a file to be downloaded. Right now I have this code:
downloadBtn_mc.onRelease = function () {
getURL("mp3/DieForToday.mp3");
}
I opted to use getURL, because I thought it would just make a prompt come up giving the user the option to download the file. Instead it tries to open the file up in QuickTime (I'm assuming because quick time is set as a default to play mp3 files).
Is there a simple way to code a button that lets the user just download the file? Thanks in advance.
Actionscript Masking And Text
I have a little problem with masking dynamic text.
The masking layer doesn't seem to affect the text on the target layer even though it affects eveything else on it.
Here is a small clip of the code
[code]
//_root.DropDown
Scroller.setMask(MaskingLayer);
[code]
[code]
//_root.DropDown.Scroller
Doppio();
var temp:Object = new Object;
function Doppio() {
if (_parent._parent.DukeData_Creatures_Types[2] == "Tick") {
for (var a:Number = 0; a < _parent._parent.MyData[3]; a++) {
temp = "Box1" + a;
createClassObject(CheckBox, temp, Row, {_x:a*15+2, _y:6});
Row++;
temp = "Box2" + a;
createClassObject(CheckBox, temp, Row, {_x:a*15+2, _y:26});
Row++;
temp = "Box3" + a;
createClassObject(CheckBox, temp, Row, {_x:a*15+2, _y:46});
Row++;
temp = "Box4" + a;
createClassObject(CheckBox, temp, Row, {_x:a*15+2, _y:66});
Row++;
}
} else if (_parent._parent.MyData[2] == "Radio") {
//The same but for radioButton
}
createTextField("Teksti1", Row, a*15+4, 2, 183-a*15, 20);
Row++;
createTextField("Teksti2", Row, a*15+4, 22, 183-a*15, 20);
Row++;
createTextField("Teksti3", Row, a*15+4, 42, 183-a*15, 20);
Row++;
createTextField("Teksti4", Row, a*15+4, 62, 183-a*15, 20);
Row++;
Teksti1.text = _parent._parent.MyData[_parent._parent.OnRow*(Number(_parent._parent.MyDa ta[3])+1)+3];
Teksti2.text = _parent._parent.MyData[(_parent._parent.OnRow+1)*(Number(_parent._parent. MyData[3])+1)+3];
Teksti3.text = _parent._parent.MyData[(_parent._parent.OnRow+2)*(Number(_parent._parent. MyData[3])+1)+3];
Teksti4.text = _parent._parent.MyData[(_parent._parent.OnRow+3)*(Number(_parent._parent. MyData[3])+1)+3];
_parent.Movimento(); //This gets the selected state for each visible checkBox/radioButton.
}
_parent.Down.onRelease = function() { //If the down button is pressed
if (_parent._parent.OnRow < _parent._parent.MyData[1] - 2 && _parent.Scroller._y == 37) {
_parent._parent.OnRow += 1;
Liike (37,17,"1");
}
}
function Liike(a,b,temp) { //The movement of the boxes and text.
Pathway = new mx.transitions.Tween(_parent.Scroller, "_y", mx.transitions.easing.Elastic.easeOut, a, b, 2, true);
Pathway.onMotionFinished = function() {
Returning(temp);
}
}
function Returning(temp) {
if (temp ="1") {
_parent.Movimento(); //Gets the selected state for each visible checkBox/radioButton again.
}
}
[code]
Now what I am trying to do is:
There should be an array for x by y set of radioButtons or checkBoxes, of which 3 rows are shown at a time. There is a fourth row that is hidden underneath the mask... or at leaast it should be. The boxes are covered just fine but for some reason I can't get the text hidden.
If this has been a bit too obscure, I can always post my file on this forum. Good luck trying to figure that out (Some translating was done with the names in this example).
Download File From Xml Text
Hi,
I am making a site for a client.
They want to be able to upload videos and also have the viewer be able to download the video.
But...they want to be able to add the videos / files to download themselves.
I was going to use an xml video player component, so I figure it will be fairly easy for the client to add or take away videos.
But I'm not sure how to set it up so that the client can add a link that will automatically download a file?
Any ideas?
Masking Dynamic Text Created From Actionscript.
I have a whole bunch of dynamic text fields created with the following ActionScript function:
Code:
function Label(x:Number, y:Number, width:Number, text:String)
{
_clip = _root.createEmptyMovieClip("MovieClip" + Gensym.Make(text), _root.getNextHighestDepth())
_clip._x = x
_clip._y = y
_clip.lineStyle(1, 0, 0)
_clip.lineTo(width, height) // Sets _clip's width and height, albeit in a convoluted way.
_text = _clip.createTextField("TextField" + Gensym.Make(text), _clip.getNextHighestDepth(), 0, 0, width, height)
_text.autoSize = "left"
_text.embedFonts = true
}
Label is a class I've written, _clip and _text are members of objects of that class. It works well; everything shows up where I tell it to, in the size and font that I request (so long as I remember to embed those sizes and fonts, that is). But now I'm trying to mask this text I've created, and it's going very badly. I create and apply the mask like so:
Code:
function SetDrawRegion(x:Number, y:Number, width:Number, height:Number)
{
var mask_clip:MovieClip = _root.createEmptyMovieClip(Gensym.Make("LabelMask"), _root.getNextHighestDepth())
mask_clip.lineStyle(1, 0xffffff, 0)
mask_clip.lineTo(width, height)
mask_clip._x = x
mask_clip._y = y
mask_clip._width = width
mask_clip._height = height
_clip.setMask(mask_clip)
}
The trouble is this: whenever I set the mask, my text disappears! It doesn't matter where my mask is or how big it is; the text vanishes even with a mask at (0,0) with width and height 1024 (far larger than my entire movie). I've checked and rechecked the documentation, and I don't see what I'm doing wrong: my fonts are properly embedded, I'm not trying to add transparency or rotate anything, I'm not even fooling around with _*scale. I've used trace statements to check everything's width and height, and nothing is 0, undefined, or in any way unexpected.Does anyone know what I might be missing?
Download Text File Button
Hi!
I've made a button that allows users to download a text(Word)file to their hard disk. I have used the right path and an zip file. But... it still doesn't work.The browser turns up with a message that the page could not be found. Does anyone know what I'm doing wrong??
Link To Download Text Or .doc File
I was wondering if someone could help me out with this simple little problem I've run into. I want to put a link so a person can download a text version of my resume or whatever. How would I go about doing this? I've tried get url with the absolute address of the file, but it always tries to open a new browser window. I suppose I could always set up a 'print' function, but I would like them to be able to download the actual file. Is there a way I can have it so that when they click the link, the 'save as' windows pops up and they just save the file? I suppose this could apply to other things such as .zip files and stuff like that. But anyways, if someone could help me out that'd be great. Thanks in advance.
Creating My OWN Text Scroller For Text Loaded From A .txt File?
im loading my text from an external .txt file... and i know how to make a regular flash component scroller scroll this... but how would i make MY OWN text scroller... just like an up and down arrow...
i tried the one in the kirupa tutorials but it was for flash 5 and it didnt work for me...
Text Scroller With Txt File : Help Me, Please
hi there, i'm a newbie of this forum and this site, too.
i've got a problem with a text scroller.
i ve got a txt box called "scroller" with this actions on the frame
dati = new LoadVars();
dati.onLoad = function() {
scroller.html = true;
scroller.htmlText = this.texthere;
delete dati;
};
each button i click gets this action to load the right external txt file:
on (release) {
dati.load("tester.txt");
}
well... it loads the first txt file i click for and then stop.
if i click on another button, there's non new txt file loaded but just the old one.
help me please. i know it could be a stupid thing, but it not so stupid for me...
thank you in advance....
Problem With Actionscript Text Scroller And Special Character
Hello All,
I have a problem with an ActionScript scroller text which has a .txt file as a external file.
The problem is when I insert special characters in the .txt (like a ó, á, ñ, etc.) and the export the movie, it shows me a little squares and doesn't show me the text completely. I've tested adding caracters to properties of the text box in my .fla file, but it doesn't works either.
Thanks you
News Scroller From Text File
Does anyone know how to make a text news scroller in Flash that is fed from a text file? I've been looking everywhere for a tutorial or a fla to show how to do it. I'm using Flash MX.
Thanks!
Chris Hunter
Loading Text Into Scroller From Txt. File?
I am loading text. into my scroller form a txt. file and want to know how to go about changing the font. here is the deal, I have a projest I am working on, and the companies name contains an "e" with the accent over the letter. in my program, that I am writing the text. file in (textedit), in mac osx, it shows up fine and dandy, when I test the movie in flash, the place where the "e", with the accent over them show up with a less than or grater than sign under them. I have tried changing the font, in text editor, but no luck.
IS THEIR ANYWAY POSSIBLE TO DO SOMETHING ABOUT THIS PROB?
----------------------------------------------------------------------------------------------------
thank you, so much if you can help me at all...as I am pressed for time. Best Regards.
g.g.
Loading Text Into Scroller From Txt. File?
I am loading text. into my scroller form a txt. file and want to know how to go about changing the font. here is the deal, I have a projest I am working on, and the companies name contains an "e" with the accent over the letter. in my program, that I am writing the text. file in (textedit), in mac osx, it shows up fine and dandy, when I test the movie in flash, the place where the "e", with the accent over them show up with a less than or grater than sign under them. I have tried changing the font, in text editor, but no luck.
IS THEIR ANYWAY POSSIBLE TO DO SOMETHING ABOUT THIS PROB?
----------------------------------------------------------------------------------------------------
thank you, so much if you can help me at all...as I am pressed for time. Best Regards.
g.g.
Scroller That Calls On TEXT File?
I am not good with actionscript. is there any easy way to make this file pull it's text from a .txt file? I would really like to use this particular scroller. thanks
Problem Masking A Dynamic Text File
Hi, there
Problem:
I have a movie and within this movie a MovieClip. From the main movie i'm loading a .txt file with a few html tags from the server into a dynamic text field in the MC. This works offcourse but when i put a mask over the MC in the main movie, it shows the rest of the MC (pictures, and static text) but not the content of the .txt file in the dynamic text field.
Can somebody help me out
Masking Externally Loaded CSS Text (from.txt File)
Well, I know how to do it when using dynamic text and using setmask and embedding your fonts, but how do you do it when you are using a CSS font class with 3 diff. fonts and maybe even more?
There is no mention of how to use a mask over a dynamic textfield in the MX 2004 tutorial with externally loaded CSS .txt file, so hopefully someone knows how to do this? I am getting a blank text field, but it works when I delete the mask layer.
thx.
Problem With Masking Html Text From File
i just went through a great tut on how to import html text from an external text. however, when i mask the movie clip that the text is stored in, anything that is bold or italic is missing completely. i have selected caps, lowercase, numbers, and punctuation. normal text can be seen, just not bold or italic.
does anyone have any cluse?
gkc
Cool Dynamic Text Scroller For Txt File - But...
This is a great bit of functional script that takes a txt file and updates the scroller to work. The only thing is that the original programmer didn't allow the variable on the third line of code (theMask._height = 100; ) able to change very much. I would like it to go to 193 pixels but around 150 it distorts the scroller. Anyone feel like downloading it and taking a peek. Welcome to use it, very useful I think.
Scroller And Dynamic Html Text File
I am trying to html format dynamically laoded text and when i add the line scroller.html.text = this.var1 the text formats with html but the scroll bar button disappears can any help?
actionscript
loadVarsText = new loadVars();
loadVarsText.load("news.txt");
//assign a function which fires when the data is loaded:
loadVarsText.onLoad = function(success) {
if (success) {
trace("done loading");
//Now that we know the data is loaded,
//set the text content of the Text Field
//with the instance name "scroller" equal to the
//contents of the variable
scroller.html = true;
scroller.htmlText = this.var1;
} else {
trace("not loaded");
}
};
Thanks
p1}{el []
Link On My Text , In My External Loading Txt. File, For My Scroller------------------
my link will not work in my external loading txt. file. the text. file is a dreamweaver txt. file. and the link will not show up. I clieck , "render as hmtl", and I have no luck...
check it out:
www.carpeinternational.com/forte.html
scroll to the bottom to see the link I am having problems with.
PLEASE HELP me in my emergency.
thank you!
Help With Custom Scroller With Externally Loaded Text File
Basically, my problem is that the dragger will not scroll all the way down and I have no clue how to fix it. It works well when there is a lot of text in the text file but when there isn't, the dragger does not behave as it should.
Here is my file so hopefully someone can help me out here.
Thanks a lot,
Prich...
Its done with mx 2004 btw
External File Scroller - Links, Text And Images
Hello all!
Quick question. I want to dynamically load an html document within a scroller.
I want to include hyperlinks as well. I have some crude action script written which works until I nest it. Is their some source out there to accomplish this? The problem I've had is when the code I'm using is referenced within the timeline but it is nested a below the top.
I have two scenes escena 1 and escena nested. It works in the first and not in the other.
Please let me know if someone can help me take this the rest of the way.
Thanks!
-D-light
Image+text Scroller, Form Scroller, And Loading External Text Files - Urgent
Hi everybody!
Does anybody know how to do the following things in Flash MX?
1.Make a scroller with text + images in it;
2.Make a scroller with text + a form in it;
3.I followed the tutorial entitled "Scrolling Dynamically Loaded Text", but the text that I tried to load has over 160 lines, and I can only scroll down to about half way of the total lines. Why is that?
4.I also tried to load xml files using the code <?xml version="1.0" encoding="utf-8"?> on the first line of each xml file, but the ', &, and " " don't work.
Can anybody help me, please? This is urgent!
Thanks in advance!
animind
Image+text Scroller, Form Scroller, And Loading External Text Files - Urgent
Hi everybody!
Does anybody know how to do the following things in Flash MX?
1.Make a scroller with text + images in it;
2.Make a scroller with text + a form in it;
3.I followed the tutorial entitled "Scrolling Dynamically Loaded Text", but the text that I tried to load has over 160 lines, and I can only scroll down to about half way of the total lines. Why is that?
4.I also tried to load xml files using the code <?xml version="1.0" encoding="utf-8"?> on the first line of each xml file, but the ', &, and " " don't work.
Can anybody help me, please? This is urgent!
Thanks in advance!
animind
Inserting File (News Reader) / Vertical Text Scroller
Hi,
after trying to look for a external file vertical text scroller..., i decided to build my own. I do not have much flash-scripting know how (or flash as a matter of fact) but so far I have been able to read a text file and insert into flash.
however, the text is not properly formatted (as some of it does not appear). Also, in addition I need some help in scrolling the text that is read from file to auto scroll repeatedly...
Code:
loadText = new LoadVars();
loadText.load("data.txt");
loadText.onLoad = function() {
name.text = this.name;
};
i was thinking of looking for EOS for each line then display that; then wait couple of seconds and read the next line...however i do not know how i will do that in flashscript...
Dynamic Scroller>problem Masking
Hi there,
The way my site is set up I need to mask my scroller(animated)
But somehow the scroller won't do the mask thing and also load in the textfile.When I remove the mask everything works.Strange.
Anyone can help out.I've tryied just about everything I can think of.
Btw it's a component I got from macromedia.
Big thx in advance,
Here's the file:
Window Scroller Masking Problem
Hi - Ive managed to tweak a scroller I found somewhere and have it resizing to fit a window (even with my limited coding knowlege)
The problem Im now encountering is that I cant get the masking of the content to work correctly (ie scroll all content when the windows small and none when its large)
Ive uploaded a zip of my progress here - http://www.contrastmedia.co.uk/downloads/
- if anybody could help in ANY way it would be much appreciated, as at the moment I see this playing on my mind all christmas until I get it woring :)
many thanks
I've Posted This Before To No Avail....
on
http://www.neutechnet.com/website
I've created the top scroll thing to show a portfolio. Well when you scroll all the way to the right the last image doesnt appear. any ideas why? I've deleted and re-imported. nothing... I am adding another image and that is not working either, so now I have 2 that are not working. please help!!!!
Please HELP..i've Been Scouring The Net To No Avail...
http://www.avimports.com/_test/index.html
click the logo, and click the contact button...now i have a few comboBoxes loaded with content from an xml file...the content is great, the callbacks are good, my listeners are functioning properly,,,but after you make a selection with the combo box a green box stays around the box when you are targeting it????what is this?...and when you choose sales and the other boxes come up they leave "ghosts" as well...please try this link and hit the combo boxs a few times.....WHY is the targeting doing this...i have tried for overa month now to search for this problem duplicated anywhere,,forums, help sites, etc...all with no results...please,,please could one of the gurus here come to my aid....
even the almighty LEE....drop some knowledge about this to me...please..
thanks.
shane
Pop-ups Are Killing Me... Anyone Know? Ive Searched But To No Avail
hi everyone,
ok, i tried to use javascript to create a pop-up on an html page, and i couldnt get it to work.
so i thought i would try flash, and everything anyone has posted still wont work...
ive never made a pop-up before... i do not like them in the slightest, but this client is adament that he wants his site build in one.
please help.
it will be launched from a button in flash.
i have already searched flashkit, but everything has been posted hasnt worked.
i dont know if im supposed to be putting actionscript anywhere else,
i dunno.
anyone able to help me? im sure someone must have done popups before
Text Scroller Help - Scroller Won't Scroll Full Length Of Text?
I have a text scroller that calls for a external text file. I have 16 numbered items in the .txt file but only 12 items will scroll. Why is this and how do I fix it? Also, is there any way to format text in the .txt file so that it appears formatted in flash? Right now there is a bunch of spaces between the numbered items. Thanks anyone!!
TRYING To Print A Movie Clip Out - To No Avail
ok i have fla with a number of frames......
the stage size is the standard 550 x 400 pixels.....
now basically on one of the frames (with a frame label of '#P') i have a button (instance name 'print') and a movie clip (instance name 'certificate') - inside this clip is sorta like a certificate thing..........
ok now basically im trying to make it so that when i click the 'print' button, the 'certificate' movie clip prints out A4 page size (standard page size)....
ive got the print button workin ok but the problem is it is printing out too small - i need the contents of certificate mc to be scaled so the fit the whole A4 page.....
obviously, because the stageg size is 550 by 400 there is no way i could actually resize the certificate movie clip on the stage cus it would look stupid...
heres the current code on the 'print' button :-
on (release) {
print("certificate", "bmovie");
}
HEEEEEEELPPPPPP QUIICK dudez!!!!!!!
vikta.....
Searched To No Avail (frames Prob.)
I have been searching the Internet and forums for an answer for this but I keep getting the same answer and I still can't get it to work.
I have a site with a flash nav bar and I would like to use frames. I have the coding for the button set as:
Code:
case 1 :
trace("Actions button 1");
getURL("home.html", "mainFrame");
break;
and i have my content frame labeled:
HTML Code:
<frame src="home.html" name="mainFrame" id="mainFrame" title="mainFrame" />
and I can NOT get it to load in the frame. It keeps loading the home page in a new page. I have been at this for 2 days is there something I'm missing?
Your help is appreciated in advanced
Resize Movie To 100% Of Browser's Avail Height
I know this is possible if I export the movie at 100%, but I have two problems with that that I cannot seem to overcome:
I have a component (MM tree component from UI set 2) in the left frame of a three panel HTML frameset. The frame that the component is in is fixed at 200 pixels wide.
(1) I want the width of the component to remain fixed at 200 pixels, while the height adjusts to fill the height of the browser window at any given moment (needs to adjust if browser is resized)
(2) The fonts need to remain a fixed size regardless of how much the component grows/shrinks to accomodate the increased/decreased height of the browser window.
Loadmovie, Getbytesloaded, Pass Variables, No Avail
I am attempting to load external swfs into my main movie for the purpose of playing audio tracks. as of yet, i have:
one main movie and one external swf with the audio to play in the first frame.
i have a button set the variable "track_name" and tell the playerMC to go "track_name" and load track_name+".swf" and all works well, although the audio doesn't stream.
my loadmovienum works fine on level1. if i try loadmovie and designate a path, the whole movie cralls and appears to hang. so if i can use loadmovienum and accomplish the following, then that's fine.
i want to be able to pass getbytesloaded, etc from the second swf to _root so that i can create a progress bar (with percentage of getbytestotal) and display "loading" or "playing" respectivley. also, while the file is "loading" i want the audio track to stream.
what is the best way to go about getting this to work? thanks very much in advance!
Convert Movieclip Scroller To Dynamic Text Scroller
I have code I borrowed that is set up to scroll a movie clip image. However, it doesn't work well if I replace the graphics with a text box as the scrolling becomes "jerky" as I think there is too much information for it to process with the complexity of the text. So I was hoping to change the scrolling content from a movie clip image with text to a dynamic textbox. But it will not function when I do that change. In this currrent setup, the movieclip instance name is "contentmain". I tried naming the instance of the dynamic textbox with that name, but no text shows up next to the scroller when I play the movie.
Here's the code:
scrolling = function () {
var scrollHeight:Number = scrollTrac._height;
var contentHeight:Number = contentMain._height;
var scrollFaceHeight:Number = scrollFace._height;
var maskHeight:Number = maskedView._height;
var initPosition:Number = scrollFace._y=scrollTrac._y;
var initContentPos:Number = contentMain._y;
var finalContentPos:Number = maskHeight-contentHeight+initContentPos;
var left:Number = scrollTrac._x;
var top:Number = scrollTrac._y;
var right:Number = scrollTrac._x;
var bottom:Number = scrollTrac._height-scrollFaceHeight+scrollTrac._y;
var dy:Number = 0;
var speed:Number = 10;
var moveVal:Number = (contentHeight-maskHeight)/(scrollHeight-scrollFaceHeight);
// Setup easing event
contentMain.desiredX = contentMain._y;
contentMain.onEnterFrame = function() {
this._y -= (this._y - this.desiredX) / 3;
};
scrollFace.onPress = function() {
var currPos:Number = this._y;
startDrag(this, false, left, top, right, bottom);
this.onMouseMove = function() {
dy = Math.abs(initPosition-this._y);
contentMain.desiredX = Math.round(dy*-1*moveVal+initContentPos);
};
};
scrollFace.onMouseUp = function() {
stopDrag();
delete this.onMouseMove;
};
btnUp.onPress = function() {
this.onEnterFrame = function() {
if (contentMain._x+speed<maskedView._x) {
if (scrollFace._x<=left) {
scrollFace._x = left;
} else {
scrollFace._x -= speed/moveVal;
}
contentMain._x += speed;
} else {
scrollFace._x = left;
contentMain._x = maskedView._x;
delete this.onEnterFrame;
}
};
};
btnUp.onDragOut = function() {
delete this.onEnterFrame;
};
btnUp.onRelease = function() {
delete this.onEnterFrame;
};
btnDown.onPress = function() {
this.onEnterFrame = function() {
if (contentMain._x-speed>finalContentPos) {
if (scrollFace._x>=right) {
scrollFace._x = right;
} else {
scrollFace._x += speed/moveVal;
}
contentMain._x -= speed;
} else {
scrollFace._x = right;
contentMain._x = finalContentPos;
delete this.onEnterFrame;
}
};
};
btnDown.onRelease = function() {
delete this.onEnterFrame;
};
btnDown.onDragOut = function() {
delete this.onEnterFrame;
};
if (contentHeight<maskHeight) {
scrollFace._visible = false;
btnUp.enabled = false;
btnDown.enabled = false;
} else {
scrollFace._visible = true;
btnUp.enabled = true;
btnDown.enabled = true;
}
};
scrolling();
Any ideas?
Thanks,
Dave
Convert Movieclip Scroller To Dynamic Text Scroller
I have code I borrowed that is set up to scroll a movie clip image. However, it doesn't work well if I replace the graphics with a text box as the scrolling becomes "jerky" as I think there is too much information for it to process with the complexity of the text. So I was hoping to change the scrolling content from a movie clip image with text to a dynamic textbox. But it will not function when I do that change. In this currrent setup, the movieclip instance name is "contentmain". I tried naming the instance of the dynamic textbox with that name, but no text shows up next to the scroller when I play the movie.
Here's the code:
scrolling = function () {
var scrollHeight:Number = scrollTrac._height;
var contentHeight:Number = contentMain._height;
var scrollFaceHeight:Number = scrollFace._height;
var maskHeight:Number = maskedView._height;
var initPosition:Number = scrollFace._y=scrollTrac._y;
var initContentPos:Number = contentMain._y;
var finalContentPos:Number = maskHeight-contentHeight+initContentPos;
var left:Number = scrollTrac._x;
var top:Number = scrollTrac._y;
var right:Number = scrollTrac._x;
var bottom:Number = scrollTrac._height-scrollFaceHeight+scrollTrac._y;
var dy:Number = 0;
var speed:Number = 10;
var moveVal:Number = (contentHeight-maskHeight)/(scrollHeight-scrollFaceHeight);
// Setup easing event
contentMain.desiredX = contentMain._y;
contentMain.onEnterFrame = function() {
this._y -= (this._y - this.desiredX) / 3;
};
scrollFace.onPress = function() {
var currPos:Number = this._y;
startDrag(this, false, left, top, right, bottom);
this.onMouseMove = function() {
dy = Math.abs(initPosition-this._y);
contentMain.desiredX = Math.round(dy*-1*moveVal+initContentPos);
};
};
scrollFace.onMouseUp = function() {
stopDrag();
delete this.onMouseMove;
};
btnUp.onPress = function() {
this.onEnterFrame = function() {
if (contentMain._x+speed<maskedView._x) {
if (scrollFace._x<=left) {
scrollFace._x = left;
} else {
scrollFace._x -= speed/moveVal;
}
contentMain._x += speed;
} else {
scrollFace._x = left;
contentMain._x = maskedView._x;
delete this.onEnterFrame;
}
};
};
btnUp.onDragOut = function() {
delete this.onEnterFrame;
};
btnUp.onRelease = function() {
delete this.onEnterFrame;
};
btnDown.onPress = function() {
this.onEnterFrame = function() {
if (contentMain._x-speed>finalContentPos) {
if (scrollFace._x>=right) {
scrollFace._x = right;
} else {
scrollFace._x += speed/moveVal;
}
contentMain._x -= speed;
} else {
scrollFace._x = right;
contentMain._x = finalContentPos;
delete this.onEnterFrame;
}
};
};
btnDown.onRelease = function() {
delete this.onEnterFrame;
};
btnDown.onDragOut = function() {
delete this.onEnterFrame;
};
if (contentHeight<maskHeight) {
scrollFace._visible = false;
btnUp.enabled = false;
btnDown.enabled = false;
} else {
scrollFace._visible = true;
btnUp.enabled = true;
btnDown.enabled = true;
}
};
scrolling();
Any ideas?
Thanks,
Dave
Import Text Directly Into Actionscript From A Text File?
I have a flash movie Im working with where, at the moment, there is a variable that carries some text used in another part of the move:
This is the actionscript within the movie that deals with it:
ScrollingDisplay1:Message = "Scrolling LED display...";
ScrollingDisplay1:MaskWidth = 10;
call("ScrollingDisplay1/:Initialise");
stop();
the line with "Scrolling LED Display..." is the current text that is used in another part of the move.
What I need to do is draw in text from a text file and directly insert it inbetween the " " part on line 1 of the above script. I know how to import text and insert it dynamically into a separate text box, but I cannot find any online help as to how to insert text directly into Actionscript dynamically from a text file.
The text file Im currently using looks like this:
&gk_text=This is test text which will appear in the movie
As you can see, it declares itself as a variable "gk_text"
The file is called text2.txt
I know that to begin the code to link the text file is
loadVariables("text2.txt","_root");
But thats as far as I can take it.
If anyone can help and let me know how it can be done, Id appreciate it.
Many thanks
Wayne Dorrington
Import Text Directly Into Actionscript From A Text File?
I have a flash movie Im working with where, at the moment, there is a variable that carries some text used in another part of the move:
This is the actionscript within the movie that deals with it:
ScrollingDisplay1:Message = "Scrolling LED display...";
ScrollingDisplay1:MaskWidth = 10;
call("ScrollingDisplay1/:Initialise");
stop();
the line with "Scrolling LED Display..." is the current text that is used in another part of the move.
What I need to do is draw in text from a text file and directly insert it inbetween the " " part on line 1 of the above script. I know how to import text and insert it dynamically into a separate text box, but I cannot find any online help as to how to insert text directly into Actionscript dynamically from a text file.
The text file Im currently using looks like this:
&gk_text=This is test text which will appear in the movie
As you can see, it declares itself as a variable "gk_text"
The file is called text2.txt
I know that to begin the code to link the text file is
loadVariables("text2.txt","_root");
But thats as far as I can take it.
If anyone can help and let me know how it can be done, Id appreciate it.
Many thanks
Wayne Dorrington
Text Scroller With Image With Mouse Scroller
Hi to all,
I have problem with flash. that i want to creat dynamic text & image scroller in scroller by creating custom scroller (not inbuilt component) That scroller i can scroll with help of mouse's scroller. (the mouse's scroller & image must be include in to the scroller box)
Help me !
Help me !
Reply me fast if u have solution for it!!!!
Regards,
Samual
ActionScript In A Text File
I have heard that ActionScript can be placed inside of a text file instead of being put into the Flash file itself. What are the benefits of this and how does it work? Would this work for object and frame actions as well? I'm not too clued up on this so where would you suggest I go to get more information about this?
I would appreciate your feedback
Steve
Actionscript In Text File?
I've imported a text file into a nice scrollin text field.
I can put in regular HTML links no problem.
But now the question is: Is it possible to execute actionscript from that file as well?
What I need to do is if someone clicks a word in the file (like a regular link) I want to load a new swf movie into, for instance, level 10
Help With Text File ActionScript
All --
Basically, I'm trying to load in a text file that contains multiple variables. The first variable in the text file is "i" which is always equal to a number. That number is used to help me generate a loop and load in the other variables contained within my text file. Eventually, this will be used to rotate through several SWF files using loadMovie, but I've hit a bit of a snag. Can someone take a look at this code and tell me why I keep receiving "undefined" when I try to trace my variables? I can't trace "i" without getting undefined, and I definitely can't trace any of my other variables. That said, it seems like I'm getting the proper number of "undefined" messages to indicate that my loop is working, so I guess that's a plus.
Also, here are the contents of my headerRotator.txt file:
i=2&header1=test1.swf&header2=test2.swf
Code below:
Attach Code
loadText = new LoadVars();
loadText.load("headerRotator.txt");
loadText.onLoad = function(success) {
if (success) {
//trace(success);
i=this.i;
while(i>0){
header[i]=this.header[i];
trace(header[i]);
i--;
}
}
};
|