Hi, i new to flash mx. i nid to do a project on a marquee. can anyone tell mi where to find tutorials on making the marquees?
Thanks:)
Printable View
Hi, i new to flash mx. i nid to do a project on a marquee. can anyone tell mi where to find tutorials on making the marquees?
Thanks:)
http://www.tutorialized.com/view/tut...-Marquee/11281
Here's a guide to Google, while you're at it. It's a very useful tool..learn to use it!
Hi orginally i was saying i was doing a marquee. sorry, i doing an image marquee the software i am using is flash mx professional 2004. Any help will be greatly appericated...
i was going to attach the file for reference, but can`t because it doesn`t support .rar files.
:(
Thanks in advance
That isn't really defining anything, by adding the word "image". I suppose you mean it isn't text scrolling, but an image sliding?
You can use tweens for that, and just loop it. I don't expect it would be that difficult.
Anyway, there should be enough tutorials out there-- again, use google.
Now, in terms of the file, which would indeed be helpful, you can use another format including zip (basically a more compatible version of .rar, and you can create that with basically any software that will let you create .rar), or you could just do a screencapture of your trouble and we can view it quickly and help, IF that is enough information.
I be using actionscript to create the marquee.
i tried doing the marquee by reading up the stuffs etc. attached below is the source code which i written. On the surface its looks fine but the marquee could not display all the pictures i put in another folder. The
In the meantime while waiting for your replys i going to keep trying where i went wrong or i need to add in more codes
cheers :)
Hmm....
Your ActionScript seems waaaaaaay too complicated. I'd recommend the start over from scratch approach.
Sometimes when I code myself into a hole, I just put it aside and come back to it. A fresh mind goes a long way.
In any case, check out the "scrolling thumbnail panel" video tutorial at www.gotoandlearn.com.
That might fit the bill quite nicely. Otherwise, attach your .fla.
Thanks for the advice.. i get back to you if i have a problems. :D
haha i found my mistake already
function startScrolling()
{
logos_mc.x--;
if(logos_mc._x<=-(logos_mc._width/10))
if logos_mc._x=5;
}
when i change the 10 to 2, the whole thing work perfectly, can anyone tell mi tell mi y?
Thanks :D
:confused:
Hi can anyone explain y i help my number,the program work perfectly???
That would have to depend on your setup. It's a conditional statement so for it to to trigger the events attached to it, it has to be rendered true.
I can't tell directly what actions this conditional triggers from your snippet, so it's hard to tell you why.
But I think this snippet is related to resetting the scroller when it goes too far to the left. What I suspect is that you have a fairly large image/movieclip in relation to the stage.
Say, your logo_mc's width is 100 pixels. Your conditional statement would then be testing to see if the logo_mc's x position is at -10. If it is, then it would reset it to 3. If you have a large image in relation to the stage, that conditional is going to be met pretty quickly. Since you say that your code didn't work before and changing this fixed it, I suspect that your image/mc might have been very close to 10 pixels over the left side of the stage (either due to it's entire size or positioning at the beginning of the movie). You're resetting to 3, so that might be it. So, if you have a frame rate of anything greater than 13, you're not going to get much movement -- the higher the frame rate, the less you'll see (even though the code is executing...just too quickly to catch)
Now, with the same example, changing it to 2 now makes the conditional statement test for -50. This is a far larger scrolling distance. Because of the application here, I suspect logo_mc to be fairly large in width. So, that test value is probably fairly high giving you plenty of room to scroll before the conditional triggers.
Hope that explains it :)
Hi medyman,
if i understand wrongly, i gt 2 lines of codes which is like this
// increase loadedImages by .5 and not 1 because the images are being loaded twice otherwise, it will double.
loadedImages += 0.5;
if (loadedImages == totalImages)
{
replaceMCs();
}
// decrease totalimages by .5 and not 1 because the images are being loaded twice otherwise, it will double.
totalImages -= 0.5;
if (loadedImages == totalImages)
{
replaceMCs();
}
Do u mean this 2 statements influence the the number i asked u abt??
:)
No, the number of images in the marquee don't necessarily make a difference to the width of the marquee.
If you have ten images that are 10px wide or one image that's 100px wide, it's the same thing to Flash.
The numbers you asked about are in direct result of the width of the logo_mc and it's position relative to the left edge of the stage.
If it helps at all... Maybe your just going for the multiple effects flash can put on a marquee... But HTML has a simple marquee code and it works nicely. its really simple tag too... You would nevr guess the name of it... Its called
You can edit the speed and stuff... Theres a whole reference page here on it:Code:<marquee>Text images and other junk</marquee>
http://www.htmlcodetutorial.com/_MARQUEE.htmlhttp://It a couple pages but they are down to the point, give you the code and make everything make sense...
Hopes it helps even though your looking for a way to do it in flash which I don't know how todo...
An option, if you're not a stickler for usability or compliance. For your <marquee> tag users though, I think there are some plans to add marquee tags into CSS 2 specifications.
Plus, I think the OP is using images...by marquee I'm assuming he/she means a scrolling panel.
Thanks for the tip Rockonmetal. but i could only do it in flash :(
medyman, thanks for the solution, i still quite a greenhorn to flash so i might have to trouble u for a little longer .Hope u dun mind helping out for a little longer :D
Oh bother, now my project nid to auto-resize all the images into a standardized size.
Any tips on how to do it..
Are you resizing the image within some type of animation? If not, then you should probably resize the images before you bring them into Flash.
Resizing an image in Flash will:
1) Bloat your file size
2) Not have the best results -- distorted/pixelated
If you are going to resize, you should use a high quality .png to achieve the best possible results.
Look into McTween for AS 2.0 and Tweener for AS 3.0 to create the animation.
Let me know if you need any help with this.
hi medyman , the logos dimensions are all 150 by 126, i suppose there should be no problems. But when i put it in the marquee the the logos with juz the words will be short in height, i suppose my task nw is to make the words to be as tall as the other logos with images. I try using websites with resizing softwares, but without any success.
attached are 2 images juz for reference, in case u not too sure wat i toking abt :o
Hi, here a screenshot i took. spend some time looking for a bmp converter :D
I see what you mean. I really don't think that looks bad though. I'd opt for keeping the logos at their original dimensions in lieu of resizing them to fix an arbitrary size.
I see two problems here.
1) The logotypes (text logos) don't have a set height for the type. So if you were to resize them, you wouldn't know what to resize them to (unless you use transparent .pngs with all white space trimmed).
2) I'm not sure if your marquee can handle elements of variable width. I forget if you're bringing the images in dynamically or if they're hard-coded into the .swf.
If having a uniform size is important to you, I'd suggest doing it external of Flash. Yes, it means extra work but that's the only way to achieve a professional result.
If you still want to do it within Flash, here's the basic syntax with mc_tween.
orCode:#include "mc_tween2"
logo_mc.yScaleTo(percentage, time(in sec), animation type);
Using only the first will give you a distorted image. You'll also have to use xScaleTo if you want to maintain the proportions.Code:#include "mc_tween2"
logo_mc.resizeTo(width, height, time, animation type);
erm, should be hard coded i tink? cos i onli use the action frame to do the whole marquee. the timeline etc i 'not allowed' to use it. Then the program i wrote will find the images folder & the .txt file. personally i feel its looks okie without resizing, can`t realli imagine wat some of the images will look like after re-sizing. feel kind of odd
By hard-coded I mean are the images within the .swf or are bringing them in from an external source. Since you're talking about .txt file etc..., I'm guessing the latter.
And I have to agree that it looks fine. It would be much easier (and better quality) to edit the images external to flash. That's what I would do, at least.
Hi, the code u gave mi i nt too sure how to use & insert, mind explaining wat is the syntax & animation type means? :confused:
i attached it juz in case u dun understand. Realli sorrie for replying so fast :o
Yea. I`m bringing them frm an external source. well i nid to check if i`m allowed to change the images sizing using other software instead of of using coding to control. The chances is i hav to use codes to control them. Zzz
That screenshot is impossible to read, lol.
But first, have you installed mctween? If you haven't that's the first step (link is below).
As far as the syntax, i'll let the original author explain it to you. It'll probably make more sense with examples etc... on his site.
http://hosted.zeh.com.br/mctween/
btw...why wouldn't you be able to edit the images using image authoring software. Resizing shouldn't be protected under any type of copyright. If it is, then you'd be violating that by doing it by code as well. The problem arises when you edit the contents, not it's dimensions. But it depends on your source, I suppose.
The resizing images was someting i thought out of. :) My teacher only tell to make the images the same height and he gone for the weekend.. Anw, there an interesting website u recommend. the images i will ask him on monday abt the resizing methods.
btw, the 2 lines of codes u gave, i tink the 2nd one is better since the percentage looks harder
Is my example correct? Erm, the animation type is a must? since i already hav my marquee moving at this present time & must move at a constant pace.
Sorrie in advance abt bomarding u with so much qns at one time
Code:#include "mc_tween2"
logo_mc.resizeTo(100, 100, 10, easeInQuad);
Oh I see.. I didn't realize this was for school. I thought maybe the people that own the images had restrictions on you to not resize. It makes sense now.
You're AS is close...but the animation type goes in quotes.
Yes, the animation type is required. If you don't want any type of easing, you should use "linear" as the animation type -- this in effect doesn't apply any easing.Code:#include "mc_tween2"
logo_mc.resizeTo(100, 100, 10, "easeInQuad");
With that code, you're resizing the image to 100px by 100px over 10 seconds. If you use this in your application, you'll probably want to make the time really small (like .01 seconds) so it happens right away.
The benefit of the percentage is that you can maintain an aspect ratio without doing the math. For example, your logos (at least the examples you posted here) are 150px by 126px. If you resize to 100 x 100...the proportions will be all off and the image will look skewed. But if you resize the x-axis and y-axis by 10%, then the proportions are kept in line. You could also just do the math and use resizeTo() as well -- which is what I usually do because you're right, it is easier than messing with percentages.
Hi, okie i put the quotes on the animation type already. But when i run it, there is an error. (Error opening include file mc_tween2: File not found.) #include "mc_tween2". Do i nid to declare in the beginning? Or i nid to do someting to it?
Sorry, that was my mistake...i forgot the extension.
It should beIf that doesn't work, make sure you downloaded and installed it.Code:#include "mc_tween2.as"
ya, i download the extension file manager for flash mx on fri alr. Or should i dl for flash5 instead? Another thing is, as i can scroll down there r some installation file, do i dl the newest ver? Erm, medyman btw i suddenly realise the image size is also the background size (white background) right? so we should not be able to change the interior (wording /images ) using normal means. If i wrong to say tt, pls correct mi cos i still fuming abt y i cannot change the size :D .
Okie, anw be4 u reply i dl the newest ver . the program can accept tiz piece of new information so is able to run, but its seems to hav no effect. Perhaps u might hav some more tricks up your sleeve
Hi, al`right.. I FINALLY know wat the requirement for tiz project. My teacher wants me to do a mouseover the marquee & when click 1 of image will go to a website. so for example 40 images 40 websites.... The website muz b in the same file as the .txt which stores de images.
btw medyman, the auto-resize I dun nid it alr. he change his mind again. Always at the minute... :mad:
Okie for nw, i better go read up on mouseover...
Ahh, well let me know if you need any more help.
A quick tip: You don't really want a mouseover, you want to click on image and go to a website, right? So you'll want to use [movieclip].onRelease
a mouseoveris done with [movieclip].onRollOver but that would mean that you would go to the website just but mousing over the image, not actually clicking
Erm if its a mouseover too. Cos the marquee nid to stop when the cursor is in the marquee. I was tinking abt using javascript for the txt file ( putting all the website address in there) & saving as .txt files. Then the mouseover in actionscript.
can it be done saving the website address in .txt file & not .html file?
:D
Yes, of course. Or, if you want to simplify it further, use XML (don't know if you're allowed to do this for your project).
XML is SUPER SUPER easy. A txt file might be harder.
You'll have to use the same process you're using with the images to bring in the text (the links will have to be in the same order as the images) and then pass that value into getURL()
To be honest, I've never worked with importing data from .txt files. I've found that method to be a little bit more labor intensive and more error prone (maybe it's just my implementation).
I always use XML for this kind of thing.
medyman, thanks for your suggestion abt using xml file but my teacher say NO XML FILE, U WILL CONFUSE YOURSELF & OTHERS. U R SUPPOSED TO USE ONLI A .txt file. gt a big dressing down. i dun realli get it nw. y he say xml will confuse people?
I don't know either. I think XML is more straightforward.
The thing with text files is, it doesn't have a set structure in the same way XML does. I suppose you could define a certain separation character/string. So, for example: imagePath and imageLink. From there, you will be able to divide the whole string into an array in ActionScript.
With XML, you would have a string like this
and you could easily parse any/all of the attributes, without having to deal with arrays and all that.Code:<img path="path/to/image" link="http://www.link.com" />
I guess text files are a more "basic" structure and might be better from you to learn from (at least in your teacher's eyes). I build these sorts of applications to go live on the web and I don't usually manage them. So, I need the most user friendly way possible for my clients to change things. But in the end, my clients are only dealing with a CMS...I create the XML via PHP. But since XML has a defined structure, it's easy to create via PHP.
ic.xml sure looks easier. :) my marquee is juz for the school intranet. So mayb i do not nid to do till so professional. Erm do u noe how to do it in .txt file? The linking of websites . :D
I read frm online, its says juz putting a | den type the website down, it should work