Vertical AutoScroll News?
Can someone point me in the right direction.im intrested to find a tutorial on how to create a vertical autoscroll dynamic news driven by XML file. can someone help me.thanks
Actionscript 2.0
Posted on: Sat Mar 03, 2007 6:17 pm
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Fast Vertical Autoscroll
I need a fairly fast vertical autoscroll for f/x like you see in futuristic movies. The text might actually be gibberish--it's for effect only. Maybe every five seconds the scroll would pause for an instance.
Any idea how I can do this?
Horizontal Autoscroll News Ticker
Hello peoples, how are you all?
I am trying to create an horizontal and autoscroll news ticker, similar to the one you actually see on CNN footer, for example.
I've already did a scroll like this one, but it just pass one message per time. The messages are being loaded from an XML file throught a XPath query.
My problem is: how can I make this scroll continuous, with all the messages following one by eacher other, as a loop through XML.
If somebody could help me, I will appreciate. Thanx for your attention!
Trying To Get A Flash File To Read An XML File And Autoscroll It Like A News Ticker.
Code:
function processXMLData(success)
{
if (success)
{
var rootNode=this.firstChild;
var contentNode=findNode(rootNode, "content");
content=getValue(contentNode);
}
else
{
content="Today's news is not found";
}
}
function getValue(node)
{
if (node && node.firstChild)
return node.firstChild.nodeValue;
return "";
}
function findNode(node, nodeName)
{
if (node.nodeName==nodeName)
return node;
for (var i=0; node.childNodes && i<node.childNodes.length; i++)
{
var foundNode=findNode(node.childNodes[i], nodeName);
if (foundNode!=null)
return foundNode;
}
return null;
}
var xmlData=new XML();
xmlData.ignoreWhite=true;
xmlData.onLoad=processXMLData;
xmlData.load("news.xml");
function scrollDown():Void{
if(xmlData.scroll<xmlData.maxscroll){
xmlData.scroll++
}else{
xmlData.scroll = 0;
//back to start
}
}
Code:
<?xml version="1.0" standalone="yes"?>
<news>
<content>Scientists discovered a cure for the widely publicized boredom-syndrome. Bla...bla...bla... They recommend a full month of nice vacation in for people with stage one and two of boredom-syndrome.</content>
<content>Scientists found out that flash really is great</content>
<content>123</content>
</news>
Good news:
It reads the XML.. WOOHOO
Bad News:
It won't autoscroll like a news ticking from bottom up and then repeat.
News Ticker Flash File
I've enclosed the source files above. I'd greatly appreciate the help whomever it is that has the time to do so. It's probably just a few code changes.
Vertical News Scroller
Probably been asked time and time before, but how can I make an automatically vertical scrolling news ticker which accepts variable lenght news articles?
Get the variables etc is no problem I just don't know how to make something scorll without it being a movie which won't work as the text could change in size.
Any help would be great or examples as I have had problems finding those too.
Si
Vertical News Roller
I'm finding a good vertical news roller that imports datas from a external file ... any suggestions?
Vertical News Ticker
Hello everyone,
Im trying to create a vertical scrolling news ticker where it continuously loop in a small rectangular text box, is there any way of doing this. I would appreciate it if someone could point me in the right direction.
thanks
The Vertical News Ticker
Does anyone know any good tutorials for a basic vertical news ticker. Pretty much this one: http://www.flashkit.com/movies/launc...426&bg=#ffffff
Thanks,
FiNcH
Help Doing Vertical News Ticker
Hello ppl,
I am newbie about flash and all things related...
but with some tutorials i can manage myself
I was trying to make a news ticker that scrolls vertical, but i can't find anywhere!
Does anyone know where i can find a tutorial or something , I would appreciate!
Thanks
Vertical Scroller/News Ticker
I am looking for tutorial/instructions to create a Flash Vertical Scroller/News Ticker that reads a text file, where the news/headlines are updated frequently.
And, more importantly, is Flash (what version) capable of this?
Mike
Vertical Scrolling News Ticker
Hey all,
I have Flash MX 2004, although I am still quite a newbie. I am trying to create a vertical scrolling news ticker, using a dynamic textbox. Ideally, the text should automatically scroll upwards, and either:
-> Stop at the end of each paragraph for a second or two
-> Stop when mouseover
This is what I want, yet this is an Java applet: http://www.appletcollection.com
Thank you in advance for any help you give,
Lewis
Typewriter News Vertical Scroller?
I've been looking around and all I can find is javascript...
anyone have a good actionscript for typewriter text that then scrolls upwards automatically like a ticker?
Please help. I've managed to do the typewriter effect but I don't know how to make it scroll up automatically.
Making A Vertical News Scroller
I am trying to make a vertical News scroller. I want to have it so it reads the news items into a Dynamic textbox. I thought it would be easy to do but once I started thinking about it, I cant figure it out.
Does anyone know of a good tutorial that shows how to do this?
Thanks
Adam
How To Build An XML NEWS BOX With Vertical Movement Effect?
Ok, what I'm tryin' to do is a box that contains NEWS (date + short description with links on each). There would be an XML file feeding the swf. I'd like the effect of the 'menu' to be similar to what PixleCrew has been talkin' about in some other thread. The menu would be masked and would move vertically depending on the mouse position.
PixleCrew wrote his code in that thread but I can't seem to build my FLA file the right way since I'm not the best actionscripter there is. His FLA file is not available.
So if someone could help me out with this or simply point me to someplace where this subject has been discussed, I'd really appreciate it.
Thanks!
Creating Vertical News Ticker In Flash
hello friends,
I am new to flash, but i want to create a vertical news ticker that will be displayed on my front page showing recent news. can u tell me the tutorial for that. i have downloaded readymade tickers, but having some problems while using that. I want to create my own, so pleaze help me for that.
thanks
pankaj
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...
External Text In A Vertical "news" Scroller-can't Get It To Work
Hey there,
Ok, so I am somewhat novice to flash, but I have kind of come up against a wall here. I have a swf file that will be functioning as my website. It calls another swf that acts as a "news ticker" with vertically scrolling text.
I have two problems:
1-the newsticker by itself works good, except that the text scrolls beyond the limits of the dynamic text box I created to put it in. I have tried to mask it, but that doesn't seem to be working (though I could be doing it wrong...)
2-When I test the main swf, and it calls up my news ticker swf, the text in the newsticker is there, but it doesn't scroll at all.
I have put the fla's and the referenced text file on a webpage where they can be accessed:
http://www.freeflightvideomagazine.com/onlinevideo.html
If anyone has any suggestions on the masking and the non-functional scrolling, I would be very grateful. I have been combing forums and tutorials for a while, and haven't figured it out yet!!
Thanks,
Chris
Autoscroll...please Tell Me How Or Where
would somebody be so kind as to point me in the right direction of a fla or instructions on how to make text autoscroll.
I can load the text from a text file, but I would like it to continuosly scroll up...any ideas.
I have searched the movies here at fk
Thanks
Pete
Autoscroll?
is there a way so that you can make exturnal text automaticly scroll all the way down to the bottom?
http://aaronslife.ath.cx/notepad/
heres what I mean in example....
and is there a way to hit the enter button to send a sumbit function?
Autoscroll?
is there a way so that you can make exturnal text automaticly scroll all the way down to the bottom?
http://aaronslife.ath.cx/notepad/
heres what I mean in example....
and is there a way to hit the enter button to send a sumbit function?
Autoscroll, Yeah Need That?
hey does anyone knowof a way to have a dynamic text field automatically scroll, without the mouse controls, just by itself-obviously based offof time? Thanks? Or a tutorial on this?
Yeah, Need That Autoscroll
hey does anyone knowof a way to have a dynamic text field automatically scroll, without the mouse controls, just by itself-obviously based offof time? Thanks? Or a tutorial on this?
Autoscroll - Menu
Just looking for some helpful hints or links to any tutorials that would help me create a mouse-sensitive scrolling menu... In other words, when the mouse moves up on the menu it scrolls the menu one way, and when moved down it scrolls the menu the other way.
Thanks,
GF
Autoscroll Text
hi i need help making a dynamic text box that loads external text, and scrolls on its own till you mouse over it @ which point it stops scrollin. i need it to be linkable as well if possible. like i said ive gotten the loading text part down but i need a hint or two on how to make it autoscroll
Thanx
Martin
Autoscroll Text
is there any way i can autoscoll text until its moused over? for example if i were to load text from an external .txt file then i wanted it to scroll until it was moused over how would i do that? thanx
Autoscroll Text
Hello all,
I am looking for auto scroll text in flash. Am new to flash scripting and have no idea as to how can this be achieved.
Can anybody help me with this.
Thanks,
Vandana
Autoscroll Navigation
Is there a way to achieve this navigation autoscroll effect using AS? If so can someone point me a tutorial on how to do it?
Thanks in advance.
Autoscroll Question
I'm trying to get a dynamic text box to scroll vertically on its own. On the main timeline, I load the text file externally and then inside the text_mc, I have a simple loop that tells the text box to scroll:
//
names.scroll = names.scroll+1;
//
It scrolls it the first time around but when it loops on this command a second time, the text disappears. Any ideas on why it's not scrolling? The files are attached.
thanks!
AutoScroll If MouseOut
I want to make a thing for the homepage on this site http://signdesigns.com
They make signs and i want to make a thing for them in Flash MX where it has pictures of signs and people can click on them and pop up a new window (Javascript i guess)
you see i am a true beginner with flash and i just installed flash mx today. so im gonna need some help.... i know HTML very well -- I'm a novice with PHP and Javascript
The hard part of this project will be making the images scroll by automatically at a set speed when the mouse is anywhere but on the movie then when the mouse is on the movie i want the images movement to be controled by the mouse
Abelius's - Flag Scroller is a very good example of what i'm looking for -- also another thing that might be hard is making it loop not like the flag scroller where it stops at the end
so what i need to know how to do is--
1. edit the flag scroller fla to open a new browser window
i guess that's it cause the flag scroller takes care of the other stuff
Horizontal Autoscroll Help
Hi. i'm just trying to make a simple text box that auto scrolls horizontally; kind of like a news or stock ticker. Any help greatly appreciated.
Thanks
Trace And Autoscroll
i going crazy !
if you have something like :
ActionScript Code:
onEnterFrame=function(){trace(8)}
you get a lot of "8" in the trace
some time the trace window is scrolling automaticly to the last trace
BUT sometime it's just somewhere else so i can't see the last trace
then i try to scroll down by hand but at this time the value is already old and "somewhere"
how to get Flash to scroll whit the trace ?
mean i wana see the LAST output and not somewhere randomly abowe !!!
thanx for your time
Can Anyone Help Me With Some Actionscript For Autoscroll?
Hello,
I'm trying to dynamically load a txt file (formatted with html) as a news page, and get it to smoothly autoscroll vertically.... Here - http://www.nocco.co.uk/test/text.html
After numerous searches I came across this actionscript which was originally set for horizontal scrolling -
Code:
System.useCodepage = true;
function newsticker(content, posX, posY, depth, tempo) {
this.loadVariables(content);
this.onData = function() {
createTextField("text", depth, posX, posY, 10, 20);
text.html = true;
text.htmlText = news;
text.selectable = false;
text.autoSize = "left";
createTextField("text2", depth+1, posX, posY, 10, 20);
text2.html = true;
text2.htmlText = news;
text2.selectable = false;
text2.autoSize = "left";
text2._x = text._width;
function tick() {
text._y -= tempo;
text2._y -= tempo;
if (text2._y <= posX) {
text._y = posX;
text2._y = text._width + posY;
}
updateAfterEvent();
}
setInterval(tick, 30);
};
}
newsticker("events_artists.txt", 0, 7, 1, 1);
In the function bit i changed all the Xs to Yx which makes it scroll vertically.... as it is there are two text fields, i want just one long scroll rather than having it display double like that.... So I tried removing the second createTextField bit but then the scrolling completely stops.
Can anyone here help me to understand the actionscript a little so that i can tweak it to my liking?!
Thanks in advance
Pat
The files are attached if it helps
Autoscroll Problem
Hey there, I was looking for a way to make the thumbnail gallery auto scroll and I found it here in the forums the only problem is that for some reason everything works perfectly except when you click on a thumbnail, it opens up a new page on the explorer instead of changing the images in the gallery if someone could check the code I would really appreciate it thanks.
Code:
cliparray = [];
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
thumbnails = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
thumbnails[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
thumbnails_fn(i);
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");
/////////////////////////////////////
listen = new Object();
listen.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
prevImage();
} else if (Key.getCode() == Key.RIGHT) {
nextImage();
}
};
Key.addListener(listen);
previous_btn.onRelease = function() {
prevImage();
};
next_btn.onRelease = function() {
nextImage();
};
/////////////////////////////////////
p = 0;
this.onEnterFrame = function() {
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
if (picture._alpha<100) {
picture._alpha += 10;
}
}
};
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}
}
}
function prevImage() {
if (p>0) {
p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}
}
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
picture_num();
}
}
function picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
}
this.createEmptyMovieClip("tscroller", 1000);
scroll_speed = 4;
var tot = 0;
tscroller.onEnterFrame = function() {
if ((_root._ymouse>=thumbnail_mc._y) && (_root._ymouse<=thumbnail_mc._y+thumbnail_mc._height)) {
if (_root._xmouse>=(hit_right._x-40)) {
for (var obj in cliparray) {
cliparray[obj]._x -= scroll_speed;
}
if (cliparray[0]._x<-cliparray[0]._width) {
cliparray[0]._x = cliparray[cliparray.length-1]._x+cliparray[cliparray.length-1]._width+5;
var j = cliparray.splice(0, 1);
cliparray = cliparray.concat(j);
}
} else if (_root._xmouse<=(hit_left._x+40)) {
for (var obj in cliparray) {
cliparray[obj]._x += scroll_speed;
}
if (cliparray[cliparray.length-1]._x>hit_right._x) {
cliparray[cliparray.length-1]._x = cliparray[0]._x-(cliparray[cliparray.length-1]._width+5);
var j = cliparray.splice(cliparray.length-1, 1);
cliparray = j.concat(cliparray);
}
}
} else {
for (var obj in cliparray) {
cliparray[obj]._x += scroll_speed;
}
if (cliparray[cliparray.length-1]._x>hit_right._x) {
cliparray[cliparray.length-1]._x = cliparray[0]._x-(cliparray[cliparray.length-1]._width+5);
var j = cliparray.splice(cliparray.length-1, 1);
cliparray = j.concat(cliparray);
}
}
};
function thumbnails_fn(k) {
var yy = thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
cliparray.push(yy);
tlistener = new Object();
tlistener.onLoadInit = function(target_mc) {
target_mc._x = 20+(target_mc._width+20)*k;
target_mc.pictureValue = k;
tot += target_mc._x;
target_mc.onRelease = function() {
p = this.pictureValue-1;
nextImage();
};
target_mc.onRollOver = function() {
this._alpha = 50;
thumbNailScroller();
};
target_mc.onRollOut = function() {
this._alpha = 100;
};
target_mc.onRelease = function ()
{
p = k;
getURL(link[p], "_blank");
};
};
image_mcl = new MovieClipLoader();
image_mcl.addListener(tlistener);
image_mcl.loadClip(thumbnails[k], "thumbnail_mc.t"+k);
}
Make This Into Autoscroll
Hello, I am new to flash and slowly learning how to use it. I followed the tutorial below to make a scrolling menu. THe menu moves to the left or right depending on the position of the mouse.
My question is how can I make it so the menu autoscrolls either from left to right or right to left automatically.
Here is the tutorial that I followed.
http://www.kirupa.com/developer/mx/infinite.htm
Thank you.
Listbox CSS And AutoScroll?
Hi
I am creating a Flash MP3 player and having troubles with a couple of issues with the Listbox Component.
I am importing my playlist from an XML file, and can get the current song that is playing highlighted in the list. However what i would also like to be able to do, is, if the current song is halfway down the list of songs in the listbox, is somehow automatically scroll down to this point.
Secondly, is there anyway to set the background color of the listbox to transperant? I set the alpha to 0, but I lose all colors with that.
thanks
On ENTER FRAME AutoScroll Can It Be Done?
Hi guys, I've been searching and searching but I can't quite seem to get the answer or help i'm looking for in the past posts so here goes a new one.
What i'm trying to acheive is to have a loaded .txt file scroll from top to bottom then jump up to the top and repeat. I've gotten a bit of help from this post:
http://www.flashkit.com/board/showth...ht=auto+scroll
I'm not sure where to place that actionscript in the scene, and i'm also not sure if it will work with a loaded .txt file.
Can the above be implemented into this tutorial:
http://www.flashkit.com/movies/Smart...6455/index.php
Thanks
Zeypher
On ENTER FRAME Autoscroll Can It Be Done?
Hi guys, I've been searching and searching but I can't quite seem to get the answer or help i'm looking for in the past posts so here goes a new one.
What i'm trying to acheive is to have a loaded .txt file scroll from top to bottom then jump up to the top and repeat. I've gotten a bit of help from this post:
http://www.flashkit.com/board/showt...ght=auto+scroll
I'm not sure where to place that actionscript in the scene, and i'm also not sure if it will work with a loaded .txt file.
Can the above be implemented into this tutorial:
http://www.flashkit.com/movies/Smar...-6455/index.php
Thanks
Zeypher
How To Make An Autoscroll Text?
I want to make an autoscroll text for using it for my music player of my site? Could anyone help on to do it i have no idea... Thanks a lot
And one more thing. I want to load the ID3 of an mp3 file.. I use the following code
_root.music.songName.text = _root.sndMusic.ID3.TIT2;
all i get is undefined...
I've noticed also that flash can only read id3 tags that are in UTF-8 format. I am using a mac how can i find if its in UTF-8 format?
I'm asking a lot of things huh?
Thanks in advance,
dimitris...
Autoscroll An External File
I have implemented an rss parser and reader into a flash movie it comes in fine and has a scroll bar and everything. What i need is for it to autoscroll vertically all the text that comes from the file, update, then start over again.
Is this possible?
Thank you for your time and help.
MX 2004 ScrollPane AutoScroll
Hmm, I feel a bit like a noob, plus, I'm being lazy again, but does anyone remember why scrollpanes do not autoscroll once an swf (or any other object for that matter) is loaded into them, even though they are bigger than the scrollpane area?
Autoscroll Imported Txt File
Hi guys.
Hope you can help me out some here.
Im kind of new to flash.
Ok here is what i want to do.
I have imported a rather large text file in to a text box and i cant see all data in it.
i use the command "loadVariables("text.txt","_root");"
when i run movie i can only see the text that fits in the text box so what i want to do
is a function that autoscroll the text in the text.txt file in the textbox so i can read all the content in the text.txt file.
what i have understand so far is that the way to do it is.
1. Create the text.txt
2. Open flash
3. In first frame take "action" print in code "loadVariables("text.txt","_root");"
4. Go to second frame make a "insert blank keyframe" and take "action" insert code stop()
5. make the textbox
6. insert the variable "text" in the texbox properties "since my text.txt first line is "&text="
7. Make it to dynamic text
8. Run movie
so far so good. i can see the text in them movie now but only so mutch text as the text box size.
so what i want to do now is the text to scroll up and make all the text in the text file scroll up.
i applied the code
var myInterval = setInterval(scrollUp,50);
function scrollUp(){
text_MC._y -= 5;
// text_MC is the name of the text box
}
and the text was scrolling up but still only so mutch text that fitted in the textbox from the first place. not all the text in the text.txt file.
I have been looking around for hours on the net and forums for a good code or tutorial but its hard to find.
I hope someone is able to help.
Cheers
Dimicus
MX 2004 ScrollPane AutoScroll
Hmm, I feel a bit like a noob, plus, I'm being lazy again, but does anyone remember why scrollpanes do not autoscroll once an swf (or any other object for that matter) is loaded into them, even though they are bigger than the scrollpane area?
Mouse Event: On(rollOver) Autoscroll
hello
i'm using this code to scroll a textbox:
on(rollOver){
txtbox.scroll++;
}
but i want the textboxc to keep on scrolling until rollOut
can someone help?
cheers
[F8] Autoscroll Dynamic (XML Based) List?
Hi folks... long time viewer, 1st time poster...
Problem:
I'm trying to implement a self-scrolling list that gets its data from an XML file via php...
Current Code:
Code:
var theXML:XML = new XML();
theXML.ignoreWhite = true;
theXML.onLoad = function() {
var nodes = this.firstChild.childNodes;
for (i=0;i<nodes.length;i++) {
premiumlist.addItem(nodes[i].firstChild.nodeValue,i);
}
}
theXML.load("http://localhost/BrianTest.PHP");
I can get the Data to appear in the scroll list but cannot figure out a way to make it autoscroll... nor can I make the apply any type of formatting to the text...
Can anyone assist?
Thanks in advance...
Autoscroll Panorama Scaling Problem
I followed Lee's tutorial for the autoscroll thumbnail menu, only instead of making a small thumbnail menu, I just applied the same steps to a panoramic photo.
I have several buttons on the panoramic photo, each one coded so that when clicked on, the panoramic photo scales, giving the appearance of zooming in on the button just clicked. Once zoomed in, the viewer can then click a secondary button and be zoomed back out.
The troublesome aspect I'm having is accurately zooming back out so that the entire panoramic photo ends up in exactly the same spot as it was on initial load (pre-zoom). My attempts thus far seem to come close to arriving back at this initial position, but I'm starting to wonder if what I'm trying to do is even possible.
Here's the scaling code I'm using.
on(release){
this.onEnterFrame=function(){
this._xscale+=(650-_xscale)/15;
if(this._xscale > 650-1&& this._xscale < 650+1)
delete this.onEnterFrame;
this._yscale+=(650-_yscale)/15;
if(this._yscale > 650-1&& this._yscale < 650+1)
delete this.onEnterFrame;
this._x+=(5250-this._x)/10
this._y+=(-500-this._y)/10
}}
News Section In AS3 - Easy Method To Add New News Etc
Hi there. I am trying to create a nice frontpage news section on the frontpage of my site. I wanted to somehow do it, so that it is easy to update and automatically loads into the site.
a perfect example is this as2 software i found (click on 'news' in the menu)
http://www.sketchography.com/demoSit...s_demoSite.php
HOw would i go about doing this?
Is there similar software which i can purchase and install?
Autoscroll XML Gallery And Path Specific Integration Problem
Hi,
I have a XML gallery SWF movie that reads the XML thumbs and information. It works quite flawless as a standalone SWF but when I try to integrate it into my main movie, all the functions just stop working.
Code:
_root.container.loadeds.contcon,
is the path in which XML gallery movie resides. Which means my XML gallery is loaded into "contcon MC".
There is a horizontal thumbnail slider panel with onRollOver, in which thumbs are loaded(its width is calculated automatically according to the # of thumbs times width of one thumb) and there is a holder MC for the full size images that is called into the stage after clicking thumbs.
THE PROBLEM IS,
Nothing works when I embed this SWF into the path that I've mentioned above.
I know I should modify it with _parent , _root or so... but after trying many things, I finally got lost. Paths and hierarchy... always tricky. and also functions and "this" thing makes it even more complex.
Loaded movie has only one frame of actions which is consisted of 129 lines.
I'm giving the whole code here. So can you give me an idea or manipulate it for me so that it works when loaded into the path I have written above?
Code:
panel.onRollOver = panelOver;
function panelOver() {
this.onEnterFrame = scrollPanel;
delete this.onRollOver;
}
var b = stroke.getBounds(_root);
function scrollPanel() {
if(_xmouse<b.xMin || _xmouse>b.xMax || _ymouse<b.yMin || _ymouse>b.yMax) {
this.onRollOver = panelOver;
delete this.onEnterFrame;
} else {
var xdist = _xmouse - 200;
panel._x += -xdist / 14;
//trace(panel._x);
}
if(panel._x >= 123) {
panel._x = 123;
}
if(panel._x <= panelRightStop) {
panel._x = panelRightStop;
}
}
//galleryCode
space = 0;
photo_mc._alpha = 0;
MovieClip.prototype.loadPhoto = function(photo){
photo_mc._alpha = 0;
this.loadMovie(photo);
_level0.onEnterFrame = function(){
// modified the total and loaded so as to round it up
// to smaller number.
var total = Math.round(photo_mc.getBytesTotal()/1024);
var loaded = Math.round(photo_mc.getBytesLoaded()/1024);
if (total != 0 && loaded>=total){
var w = photo_mc._width + space;
var h = photo_mc._height + space;
border.resize(w, h);
delete this.onEnterFrame;
}
}
};
MovieClip.prototype.resize = function(w, h){
//the higher the slower the resize of the border
var speed = 4;
this.onEnterFrame = function(){
this._width += (w - this._width)/speed;
this._height += (h - this._height)/speed;
if( Math.abs(this._width-w)<1 && Math.abs(this._height-h)<1){
this._width = w;
this._height = h;
photo_mc._x = this._x - this._width/2 + space/2;
photo_mc._y = this._y - this._height/2 + space/2;
photo_mc._alpha = 100;
delete this.onEnterFrame;
}
}
};
var images:Array = new Array();
var thumbPrefix:String;
var fullPrefix:String;
var suffix:String;
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.load("xml/gallery.xml");
xml.onLoad = function(success:Boolean):Void {
if (success) {
// Set up some references.
var rootNode = this.firstChild;
var rootAtts = rootNode.attributes;
var imageNodes = rootNode.childNodes;
// Store prefic and suffix data.
thumbPrefix = rootAtts.thumbpath;
fullPrefix = rootAtts.fullpath;
suffix = rootAtts.format;
// Loop through the image nodes and extract the data to store in images.
for (var i:Number = 0; i < imageNodes.length; i++) {
images.push(imageNodes[i].attributes.src);
}
buildThumbs();
} else {
trace("There was an error loading the XML.");
}
}
var panelRightStop:Number;
function buildThumbs():Void {
var len:Number = images.length;
var spacing:Number = 150; // spacing after the previous thumbnail
panelRightStop = -(len*spacing - stroke._width);
trace(panelRightStop);
for (var i:Number = 0; i < len; i++) {
var button:MovieClip = panel.attachMovie("thumbnail", "btn"+i, i);
button._x = i * spacing;
button.img_mc.loadMovie(thumbPrefix + images[i] + suffix);
button.image = fullPrefix + images[i] + suffix;
button.onRollOver = function():Void {
this.gotoAndStop(2);
this._alpha = 100;
}
button.onRollOut = function():Void {
this.gotoAndStop(1);
this._alpha = 50;
}
button.onRelease = function():Void {
photo_mc.loadPhoto(this.image);
trace(this.image);
}
}
panel._x = -(panel._width - Stage.width)/2;
}
function zeroPad(num:Number, places:Number):String {
var numAsString = String(num);
while (numAsString.length < places) {
numAsString = "0" + numAsString;
}
return numAsString;
}
This is the original code without my changes (I got this piece of code from some thread in this forum, i can't remember the exact address line).
I'm near to the end. So please let me accomplish this task successfuly. Any help is appreciated.
THANK YOU.
Typorganism.com - Good News - Bad News
Hi,
I have just been looking at this site.
If you go into the section where it says "good news - bad news" there is a piece of work that I think is very clever.
Any ideas on how this was created? I would very much like to have something similar in a project that I am working on - somewhere that users can post pictures and a little line of copy to go with it.
Any one know of any tutorials/components/open source that will give me some kind of angle on achieving this.
It is very clever though - I tried emailing the site but have had nothing back yet
Hope someone can help
D
|