Trace Bitmaps Are Large How To Condense Movie?
I'm making a movie that uses 5 550 x 400 trace bitmapped pictures at different times, you can physically watch it refresh, it's not a clean switch. Is there a way to better the performence of the movie? Thanks!
FlashKit > Flash Help > Flash Newbies
Posted on: 02-10-2002, 06:43 PM
View Complete Forum Thread with Replies
Sponsored Links:
Large Bitmaps For Web And Dvd
I would like to make a 60 sec little movie for the web using large bitmaps. its for a clothes design company so cant make the bitmaps to small. Is there any way i can make the filesize small at the same time..?
I know from experience that Flash doesnt like to many large bitmaps imported into one scene.
Ialso need to make a dvd from of the same project.
If anyone can give me some advice to do this as simple as possible i would be very grateful.
View Replies !
View Related
Trace More Bitmaps..
I read this tutorial
http://www.kirupa.com/developer/mx20..._to_vector.htm
I have q.:
How can I trace bitmaps if I have in Flash e.g. 100 imported images.
Must I do it separately? Or exist some program which can make it outside of Flash?
Thanks
View Replies !
View Related
Trace Bitmaps?
Hi all
I imported a bitmap sequence. Is there any way i can trace each bitmap to a vector graphic besides tracing each bitmap on every frame one by one? That will take too long to do...there must be a faster way...
I using Flash MX 2004 Pro.
View Replies !
View Related
Tweening Large Bitmaps
I'm trying to recreate a ken burns type effect (one picture fades into another while slightly panning left or right and slightly zooming in or out). The graphics are large (filesize isn't an issue cause it's for a cd-rom)and the transition appears jerky. I've tried turning every frame into a keyframe but it didn't work.
Any ideas??
Ryan
View Replies !
View Related
Large Bitmaps Off The Screen
OK, here's the scenario:
I have a bitmap cached movie clip in a movie for Flash Player 9 built using CS3. If that movie clip is normally only showing a small portion, but contains in it a large (600 * 600) movie clip which is normally off the screen.
My question is - will there be a significant performance overhead for running the movie like this, ie: will Flash still do some processing for the off-screen movie clip each frame, as opposed to if the off screen movie clip was set visible = false or not there at all?
View Replies !
View Related
Can I Export Large High-res Bitmaps From Flash?
I'm trying to export large PNGs from Flash CS3 but I seem to be running into the program's limits. Exported images are chopped off in odd places and there are strange color separations. Anybody know of a way I can design in Flash, then export for print? I know, I know, it's not a print program. But I'm a Flash designer and the environment and tools are the most comfortable for me to create with.
Any ideas would be great...
View Replies !
View Related
Trace Multiple Bitmaps ( Easier Method ? )
In Flash5 is it possible to trace multiple bitmaps ( most likely with an external program )
example: I have a set of bitmaps (or gif's) and I want to trace them.
But trace bitmap -- next frame -- trace bitmap -- naxt frame -- trace bitmap. Is making me nuts...
I've seen programs ( 3d Flash Animator ) that export .swf's
Is there anything does what I'm asking for?
View Replies !
View Related
Large Amounts Of Trace's Slowing Down Player Performance?
I have a load of trace() statements all over my application. Im wondering if this is slowing down my application performance at all? It seems like its laggy... do large amounts of trace's create increased overhead for the player?
Is there an easy way to just disable the traces when compiling the swf? Like overloading the function or something?
Thanks!
View Replies !
View Related
How Large Is Too Large For A Movie These Days?
Hi, we're developing our portfolio site which will have a LOT of images that must be very high quality. So to keep quality up I know we have to sacrifice file size (or vice-versa).
We've divided each of the sections of images into separate movies so there is usually less than 8 images per movie. That way someone would only need to wait if they clicked to see a specific movie.
- My question is: What is considered 'large' for a movie file in these days of broadband?
We are not planning on having preloaders for the individual movies, and would like them to come up pretty quickly (so no sluggishness or blank screens). I'm also looking into how to have the movies loading in the background so that there would be less or no delay once they are called up.
As an example, one of our larger sized movie tests showed a size of around 350k for med-high quality, and about 750k for really good quality. We prefer to have the quality of the latter, but don't want people to get frustrated waiting.
On our local med-fast broadband (3.0Mb/Sec DSL) the large movie loads up pretty much instantly and looks great. But we don't want to alienate anyone.
THANKS!
View Replies !
View Related
Shared Library Bitmaps Vs. Loading Bitmaps At Runtime
First, we're trying to figure out if bitmaps are being shared at runtime. Second, we're trying to determine if it is simply better to load the bitmaps using loadMovie at runtime.
Objective: download shared background images once and cache for optimum site performance.
Here's the deal...
We're using shared libraries throughout our site. Shared symbols are set to be shared at runtime. All shared symbols are working fine, but we're not sure the background JPGs are being shared (JPGs within symbols). First, they will not update automatically when we update the one shared SWF. Second, SWFs that contain the shared JPG (bitmap) don't seem to show any loading time increase after an SWF with that same JPG has downloaded.
To simplify... we have 5 background images for 5 sections of our site. Each within a separate SWF that is set to share that image. All subsection SWF files look for that shared symbol (bitmap within a shared symbol) when they load. After any one section SWF is viewed, the JPG has downloaded, but it seems to download every time. Symbols that are not bitmaps don't seem to download again. So our guess is that bitmaps are not shared.
Optionally, we're looking into simply loading the JPG background at runtime using loadMovie. After one section SWF has loaded the JPG should be on the users machine. The other sections should load more quickly. BUT.... we're guessing our preloader is not figuring in this external JPG load, so the movie may pause at the frame that contains the loadMovie code.
VERY sorry this is such a long post. Not sure how many have looked into this issue. Anyhow.... We'll be testing and looking for responses to this post. You can check the beta site at www.edgedesign.net. All sections use the shared library method except PROFILE which we're now testing with external JPG loading.
View Replies !
View Related
Bitmaps In An Scalable Movie
Hi everybody,
I have a movie that will be scalable, and I am trying to figure out how to place a bitmap that will look good at the default size of the movie, and when the user scales up the movie.
Does anyone have any advice about this?
Thanks a lot
View Replies !
View Related
Scaling Swf Movie And Bitmaps....
Hello,
first post. And would like to thank the creators of this forums. It's been very valuable learning as3 with some help from you guys. And all from lurking..
I will just explain my problem.
I have a game that is pretty much built. It's pretty fast using mostly just bitmap graphics to handle all animations.
The bitmap data is being captured from another movieclip in my library. So I can scale the original movieclip and have pretty nice bitmaps at whatever size I choose.
But the problem I have, is that if I scale the swf to a smaller size thru a browser for example. All bitmap graphics become very jagged and pixelated. Yet my vector obejcts still remain clean of course.
I have tried 2 solutions, scale the bitmap graphics in relation to the size of the window. This did not work.
Another solution that did work, was to force smoothing on the bitmap graphics. But this one slows performance down drastically.
I have over 700 objects animating on screen at over 40 fps, and I'd like to stay as close as possible to that perfomance.
I have also tried force smoothing the bitmap graphics and capture the bitmap data from that then remove smoothing. This also did not work.
Any solutions or ideas on what's going on?
View Replies !
View Related
Can I Condense This?
for the rollOver rollOut functions, in AS2 I could just run the function in the loop like this:
AS2:
ActionScript Code:
var names:Array = new Array("Video Introduction", "2008-2009 Catalog"); for (var i = 0; i < names.length; i++) { this["btn" + i].txt.text = names[i]; this["btn" + i].btnbg.onRollOver = function() { this.alphaTo(40,0.3,"easeOutExpo"); this._parent.arrow.slideTo(238,null,0.5,"easeOutBounce"); }; this["btn" + i].btnbg.onRollOut = function() { this.alphaTo(80,0.3,"easeOutExpo"); this._parent.arrow.slideTo(288,null,0.5,"easeOutBounce"); }; }
but for AS3, the only way I know how to do it is to create a function outside of the loop like this:
ActionScript Code:
function init():void{ var names:Array = new Array("Video Introduction", "2008-2009 Catalog"); for (var i:uint = 0; i<2; i++) { this["btn" + i].txt.text = names[i]; this["btn" + i].txt.mouseEnabled = false; this["btn" + i].btnbg.addEventListener(MouseEvent.MOUSE_OVER, btnOver); this["btn" + i].btnbg.addEventListener(MouseEvent.MOUSE_OUT, btnOut); this["btn" + i].btnbg.buttonMode = true; this["btn" + i].btnbg.useHandCursor = true; }}init();function btnOver(e:MouseEvent):void{ TweenLite.to(e.target,0.3,{alpha:0.4,ease:Exponential.easeOut}); TweenLite.to(e.target.parent.arrow,0.5,{x:238,ease:Bounce.easeOut});}function btnOut(e:MouseEvent):void{ TweenLite.to(e.target,0.3,{alpha:0.8,ease:Exponential.easeOut}); TweenLite.to(e.target.parent.arrow,0.5,{x:288,ease:Bounce.easeOut});}
so any way to condense the as3 version or is that pretty much it?
View Replies !
View Related
Load Movie & Unload Movie With A Large Amount And Gotoplay(2)
working on a website and i stuck on a sort of problem. and i hope someone can give me an advise about it.
trying to explain this as clear as i can.
i have a bar where i want to load different movieclips in.
when i load one movie clip called for example: concert1.swf i want the other movie clip called concert2.swf gotoandplay(2).
these movieclips get loaded from hitarea's in a different part from the site.
these say:
tellTarget ("_root.frontmovieclip.concert1") {
gotoAndPlay(2);
}
if you select an other button it says :
tellTarget ("_root.frontmovieclip.concert1") {
gotoAndPlay(6);
}
tellTarget ("_root.frontmovieclip.concert2") {
gotoAndPlay(2);
}
this all will work fine. the problem is i have 42 concerts. so this would mean i would have to tell each hit area an entire list of 42 telltargets that would go play frame 6 or 2 if i want them in random order.
now i was thinking is there a way that if you press concert1 that it load that movie and tell anyother concert that is already there to go play 6.
so that i don't need 42 lines but only 2.
something like:
tellTarget ("_root.frontmovieclip.concert2") {
gotoAndPlay(2);
}
tellTarget ("_root.frontmovieclip.variableconcert") {
gotoAndPlay(6);
}
and that in concert2 it can say it should go to the variableconcert when it's done playing.
you can check what i mean at http://exuo.tripod.com/poging3.html (past concerts, deftones)
hopefully someone can give me some advise and if you need more info please ask.
View Replies !
View Related
Using Movie Format To Load Bitmaps?
I am making a game which has a serious amount of animated bitmaps. So far I have loaded all frames as individual images, but its clear this approach will result in a monster download as individual PNG files do not compress well for animations at all.
So, I am considering loading FLV files compressed using H264, with an alpha channel (8-bit alpha channels are crucial in my game). This will take care of the size problem.
However, I cannot play FLV files directly, as the game features hundreds of animated sprites at the same time, and decoding the animation from H264 for each one in real time is just too slow.
My idea is to load the movie, then extract individual frames from it as BitmapData objects, with the alpha channel intact.
But, so far, I have not found a way to extract all frames from a FLV movie into BitmapData objects.
Can anyone help?
View Replies !
View Related
Using Movie Format To Load Bitmaps?
I am making a game which has a serious amount of animated bitmaps. So far I have loaded all frames as individual images, but its clear this approach will result in a monster download as individual PNG files do not compress well for animations at all.
So, I am considering loading FLV files compressed using H264, with an alpha channel (8-bit alpha channels are crucial in my game). This will take care of the size problem.
However, I cannot play FLV files directly, as the game features hundreds of animated sprites at the same time, and decoding the animation from H264 for each one in real time is just too slow.
My idea is to load the movie, then extract individual frames from it as BitmapData objects, with the alpha channel intact.
But, so far, I have not found a way to extract all frames from a FLV movie into BitmapData objects.
Can anyone help?
View Replies !
View Related
Importing Many Bitmaps Into A Movie Clip
I was hoping to import a sequence of images into a movie clip but i have found that obviously 1800 images at 640x480 is too much for Flash. Is there any other way I can get around this. If the sequence was an AVI, could i control the avi within Flash - pause it and stop/rewind it??
Ta much
View Replies !
View Related
Help - Bitmaps Only Look Nice In A One Frame Movie
It could be a "morning-after-some-pints" thing here, but this is quite strange anyway. I've designed a logo in Photoshop, imported it as a .gif and as a .png, put it inside a movie clip, and put it on the first frame of the _root timeline. The whole site sits in the first frame. I decided today that I wanted to give the site ten frames, so I promptly F6'd my layers and yay - ten frames.
Control >> Test movie
Oh wow - what happened to my logo?
Essentially, it looks fantastic if the movie is only one frame. If I add keyframes to any layer, extending the main movie frame length, my bitmaps garble (the logo and two others as well).
Does anyone know what's going on here? I've played with all the lossy/photo settings in the library, tried both gif and png-24. No matter what: if it's one frame, the logo looks great. If the movie has more, it looks awful.
Any help would be super appreciated!
View Replies !
View Related
[flash 8]Adapting 'Auto Trace Mouse' Script To Perfom 'Atuo Trace Object'
Hello everyone..
I am new to flash and I am hoping the good people of this forum will help.
I have this sript for auto tracing a mouse position (got from this site) but i would like intead of trcing the mouse...to get it to trace a random moving object from another script!
mouse script:
createEmptyMovieClip("Line",1);
Line.lineStyle(1,0x000000,100);
onMouseDown = function ()
{
Line.moveTo(_xmouse, _ymouse);
onMouseMove = function ()
{ Line.lineTo(_xmouse, _ymouse);}
}
onMouseUp=function()
{
onMouseMove=null;
}
Random moving object:
loops = 0;
_root.target_x = Math.random()*450;
_root.target_y = Math.random()*300;
_root.xdiv = (_root.target_x-_root.circle._x)/20;
_root.ydiv = (_root.target_y-_root.circle._y)/20;
loops++;
_root.circle._x += _root.xdiv;
_root.circle._y += _root.ydiv;
loops++;
_root.circle._x += _root.xdiv;
_root.circle._y += _root.ydiv;
if (loops<20) {
gotoAndPlay(2);
} else {
gotoAndPlay(1);
}
I guess there is a way I can do this or it can be done...? Help will be much appreciated.
Thankz
View Replies !
View Related
Condense Code :)
hi
does anyone know how i can condense this code down:
&& !_root.over1 && !_root.over2 && !_root.over3 && !_root.over4 && !_root.over5
to be !_root.over1 THROUGH !_root.over5 instead of listing each number in between like above? thanks!
View Replies !
View Related
How To Condense Multiple
Hi,
Is there any way to use multiple variables in a if statement. For instance instead of individually typing :
if(colour1 == "yellow"){
'do whatever'
}
if(colour2 == "yellow"){
'do whatever'
}
Say you had 100 colours and all you want to find out is if any of them equal yellow or red is there anyway to do so something like below:
if(colour1 or colour2 or colour3 == "yellow" or "red"){
'do whatever'
}
I'm relatively new at code, just trying to make it tidier and more efficient.
Any help would be Appreciated.
View Replies !
View Related
Condense IF Code?
hi
i have a ton of IF condition statements that i need to condense cuz my code won't run and I get a pop up warning in my browser if i have all of them in there. here is an example:
if (_level0.swf41.startlx == 1) {
_level0.swf41.lx = 1;
_level0.swf41.rx = 0;
_level0.swf41.startrx = 0;
}
if (_level0.swf41.startrx == 1) {
_level0.swf41.rx = 1;
_level0.swf41.lx = 0;
_level0.swf41.startlx = 0;
}
if (_level0.swf41.startuy == 1) {
_level0.swf41.uy = 1;
_level0.swf41.dy = 0;
_level0.swf41.startdy = 0;
}
i have about 2000 IF conditons like this. anyone have any ideas on how to condense it? maybe with a for loop somehow for all of them? thanks!
View Replies !
View Related
Help Condense Script
Hi, I'm having problems condensing some code.
right now I'm having the same sets of functions on two separate frames, which are called by two separate buttons. I need to use only one set of functions because I realize the actions are the same, the only thing changing are the variables. I would really appreciate it if someone could give me a hand.
The file does the following :
- Upon pressing a button (Encrypt), take the text inside a textfield1, encrypt it and send it to shared object.
- Upon pressing the other button (Decrypt), take the text inside the shared object, uncrypt it and put it in a new textfield.
I have another set of buttons to do the same for textfield #2 and new textfield #2... which is ridiculous.
Eventually I'll have to crypt and uncrypt several variables (20!) at the same time, I wouldn't want to have 20 separate frame actions
Thank you very *very* much
If you don't have time to look at the file I'd appreciate some quick advice on how to proceed.
I'm putting some sample code for a preview. It's half of what needs to be repeated (the "encoding" functions, we need to decode too) :
Code:
// ================= INITIALISATION
Stage.scaleMode = "noScale";
caracteres = " 0123456789%ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
taille_morceau = 20;
laChaine_index = 0;
nouvelle_chaine = "";
// =================
// ================= FUNCTIONS
function encode_char(chaine, index, clef) {
var char_clef_index = index % clef.length;
var char_clef = clef.charAt(char_clef_index);
var decalage = this.caracteres.indexOf(char_clef);
var char_chaine = chaine.charAt(index);
var char_chaine_index = this.caracteres.indexOf(char_chaine);
if (index < chaine.length) {
return caracteres.charAt((char_chaine_index + decalage) % caracteres.length);
} else {
return false;
}
}
function encode_morceau(chaine, caractere_init, caractere_fin, clef) {
var resultat = "";
var resultat_temp = "";
for (var i = caractere_init; i < caractere_fin; i++) {
resultat_temp = this.encode_char(chaine, i, clef);
if (resultat_temp !== false) {
resultat += resultat_temp;
}
}
return resultat;
}
function encode_enterFrame() {
var resultat = this.encode_morceau(this.laChaine, this.laChaine_index, this.laChaine_index + this.taille_morceau, this.laClef);
if (resultat !== "") {
this.nouvelle_chaine += resultat;
this.laChaine_index += this.taille_morceau;
}
else {
delete this.onEnterFrame;
// pour retracer ce qu'on va envoyer dans le shared object :
//trace(nouvelle_chaine);
}
}
function encode() {
//in bold : textfield
this.laChaine = escape(this.monTexteInst.text);
//-- key to encode and decode! this.laClef = "truc";
this.laChaine_index = 0;
this.nouvelle_chaine = "";
this.onEnterFrame = encode_enterFrame;
View Replies !
View Related
Condense Code?
Hi,
I'm wondering if there is a way to shorten this code.
Thanks!!!
outline_mc.stat = "out";
mask_one_mc.stat = "released";
outline_lt_mc.stat = "out";
lines_bottom_mc.stat = "out";
line_left_mc.stat = "out";
line_right_mc.stat = "out";
//-------------BUTTONS ON RELEASE-------------------//
name_mc.onRelease = function() {
stick("name_mc");
myPicLoader._visible = true;
//_root.photo_one_mc.gotoAndPlay(60);
//_root.mask_one_mc.gotoAndPlay(60);
photo_one_mc.gotoAndPlay(65);
mask_one_mc.gotoAndPlay(65);
if (outline_mc.stat == "released") {
outline_mc.stat = "out";
outline_mc.gotoAndPlay("out");
}
if (outline_lt_mc.stat == "released") {
outline_lt_mc.stat = "out";
outline_lt_mc.gotoAndPlay("out");
}
if (mask_one_mc.stat == "out") {
mask_one_mc.stat = "released";
mask_one_mc.gotoAndPlay("released");
}
if (lines_bottom_mc.stat == "released") {
lines_bottom_mc.stat = "out";
lines_bottom_mc.gotoAndPlay("out");
}
if (line_left_mc.stat == "released") {
line_left_mc.stat = "out";
line_left_mc.gotoAndPlay("out");
}
if (line_right_mc.stat == "released") {
line_right_mc.stat = "out";
line_right_mc.gotoAndPlay("out");
}
}
View Replies !
View Related
Condense Code
I have a lot of buttons that I need to enable at once (also other movie clips that I need to position the playhead at frame 1 within each clip). I've been doing it the following way:
PHP Code:
sub_menu_kids.contentMain.i_k_btn_1.enabled = false;
sub_menu_kids.contentMain.i_k_btn_2.enabled = true;
sub_menu_kids.contentMain.i_k_btn_3.enabled = true;
sub_menu_kids.contentMain.i_k_btn_4.enabled = true;
sub_menu_kids.contentMain.i_k_btn_5.enabled = true;
sub_menu_kids.contentMain.i_k_btn_6.enabled = true;
sub_menu_kids.contentMain.i_k_btn_7.enabled = true;
sub_menu_kids.contentMain.i_k_btn_8.enabled = true;
sub_menu_kids.contentMain.i_k_btn_9.enabled = true;
sub_menu_kids.contentMain.i_k_btn_10.enabled = true;
sub_menu_kids.contentMain.i_k_btn_11.enabled = true;
sub_menu_kids.contentMain.i_k_btn_12.enabled = true;
sub_menu_kids.contentMain.i_k_btn_13.enabled = true;
sub_menu_kids.contentMain.i_k_btn_14.enabled = true;
sub_menu_kids.contentMain.i_k_btn_15.enabled = true;
sub_menu_kids.contentMain.i_k_btn_16.enabled = true;
sub_menu_kids.contentMain.i_k_btn_17.enabled = true;
sub_menu_kids.contentMain.i_k_btn_18.enabled = true;
There must be an easier, simpler code than this - isn't there? It all works fine but the code gets really, really long and ugly.
Thanks!
View Replies !
View Related
Condense Code
Hello,
I know there has to be a way condense/streamline the following code. I'm new to AS3, so please for give my programming skills.
Here is the code:
import flash.events.MouseEvent;
import fl.transitions.*;
import fl.transitions.easing.*;
import flash.display.*;
import fl.motion.*
var panelSpeed=70
TransitionManager.start(poly, {type:Rotate, direction:Transition.IN, duration:5, easing:Strong.easeInOut, ccw:false, degrees:900});
btnEnter.addEventListener("click", activateSite);
btn1.addEventListener("rollOver", btn1open); //using "rollOver" instead of "mouseOver" prevents open animation from looping
btn1.addEventListener("rollOut", btn1close);//using "rollOut" instead of "mouseOver" prevents open animation from looping
btn2.addEventListener("rollOver", btn2open);
btn2.addEventListener("rollOut", btn2close);
btn2.addEventListener("mouseDown", panelsOpen); //primer, in case user selects button 2 first
btn3.addEventListener("rollOver", btn3open);
btn3.addEventListener("rollOut", btn3close)
btn3.addEventListener("mouseDown", panelsOpen); //primer, in case user selects button 3 first
function panelsOpen(MouseEvent){
var ipLowerOpen:Tween = new Tween(lowerPanel, "y", Strong.easeInOut, 363, 785, panelSpeed, false);
var ipUpperOpen:Tween = new Tween(topPanel, "y", Strong.easeInOut, 0, -400, panelSpeed, false);
ipLowerOpen.addEventListener("motionFinish", btn1Up); //only need to listen for one of the panel "motion finish"
ipLowerOpen.addEventListener("motionFinish", btn2Up);
ipLowerOpen.addEventListener("motionFinish", btn3Up);
}
function panelsClose(MouseEvent){
var ipLowerClose:Tween = new Tween(lowerPanel, "y", Strong.easeInOut, 785, 363, panelSpeed, false);
var ipUpperClose:Tween = new Tween(topPanel, "y", Strong.easeInOut, -400, 0, panelSpeed, false);//if true=seconds, false=frames
ipLowerClose.addEventListener("motionFinish", btn1Down);
ipLowerClose.addEventListener("motionFinish", btn2Down);
ipLowerClose.addEventListener("motionFinish", btn3Down);
}
function btn1Up(event:Event):void {
btn1.addEventListener("mouseDown", panelsClose);
btn1.removeEventListener("mouseDown", panelsOpen);
}
function btn1Down(event:Event):void {
btn1.addEventListener("mouseDown", panelsOpen);
btn1.removeEventListener("mouseDown", panelsClose);
}
function btn2Up(event:Event):void {
btn2.addEventListener("mouseDown", panelsClose);
btn2.removeEventListener("mouseDown", panelsOpen);
}
function btn2Down(event:Event):void {
btn2.addEventListener("mouseDown", panelsOpen);
btn2.removeEventListener("mouseDown", panelsClose);
}
function btn3Up(event:Event):void {
btn3.addEventListener("mouseDown", panelsClose);
btn3.removeEventListener("mouseDown", panelsOpen);
}
function btn3Down(event:Event):void {
btn3.addEventListener("mouseDown", panelsOpen);
btn3.removeEventListener("mouseDown", panelsClose);
}
//--------------------------------- Open/Close Buttons-----------------------------------------------
function btn1open(MouseEvent):void {
var myTween1:Tween = new Tween(btn1.btn1Top, "y", Strong.easeOut, 0, -31, 2, true);//if true=seconds, false=frames
var myTween2:Tween = new Tween(btn1.btn1Bottom, "y", Strong.easeOut, 6.5, 37, 2, true);
}
function btn1close(MouseEvent):void {
var myTween1:Tween = new Tween(btn1.btn1Top, "y", Strong.easeOut, -31, 0, 2, true);//if true=seconds, false=frames
var myTween2:Tween = new Tween(btn1.btn1Bottom, "y", Strong.easeOut, 37, 6.5, 2, true);
}
function btn2open(MouseEvent):void {
var myTween1:Tween = new Tween(btn2.btn2Top, "y", Strong.easeOut, -10.5, -31, 2, true);//if true=seconds, false=frames
var myTween2:Tween = new Tween(btn2.btn2Bottom, "y", Strong.easeOut, 6.5, 37, 2, true);
}
function btn2close(MouseEvent):void {
var myTween1:Tween = new Tween(btn2.btn2Top, "y", Strong.easeOut, -31, -10.5, 2, true);//if true=seconds, false=frames
var myTween2:Tween = new Tween(btn2.btn2Bottom, "y", Strong.easeOut, 37, 6.5, 2, true);
}
function btn3open(MouseEvent):void {
var myTween1:Tween = new Tween(btn3.btn3Top, "y", Strong.easeOut, -10.5, -31, 2, true);//if true=seconds, false=frames
var myTween2:Tween = new Tween(btn3.btn3Bottom, "y", Strong.easeOut, 6.5, 37, 2, true);
}
function btn3close(MouseEvent):void {
var myTween1:Tween = new Tween(btn3.btn3Top, "y", Strong.easeOut, -31, -10.5, 2, true);//if true=seconds, false=frames
var myTween2:Tween = new Tween(btn3.btn3Bottom, "y", Strong.easeOut, 37, 6.5, 2, true);
}
//---------------------------------------------------------------------------------------------
any help in writing some type of class to shorten the code would be appreciated
Thank you
-7
View Replies !
View Related
Condense Code
is it possible to condense :
mouseDownHandler
mouseDownHandler2
mouseUpHandler
mouseUpHandler2
star.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
moon.addEventListener(MouseEvent.MOUSE_DOWN,mouseD ownHandler2);
star.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
moon.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler2);
thank you
package
{
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.events.MouseEvent;
public class Main extends MovieClip
{
public function Main()
{
star.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
moon.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler2);
star.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
moon.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler2);
star.buttonMode = moon.buttonMode = true;
function mouseDownHandler(evt:Object):void
{
star.startDrag();
star.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
}
function mouseDownHandler2(evt:Object):void
{
moon.startDrag();
moon.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
}
function mouseUpHandler(evt:Object):void
{
star.stopDrag();
star.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
}
function mouseUpHandler2(evt:Object):void
{
moon.stopDrag();
moon.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
}
function mouseMoveHandler(evt:Object):void
{
if (star.x > moon.x)
{
star.alpha = .4;
}
else
{
star.alpha = 1;
}
}
}
}
}
View Replies !
View Related
Condense Code?
I am only mildly proficient with Actionscript 2. I have all the code for this website on one frame, and it seems like it would be easy to take the following code and condense it. What I need is a code that someone makes it so that I can refer to WHICHEVER movie clip is on frame 7 (only one will be on it at a time) or something like that (like, whichever movie clip is visible. I don't know! Just SOMETHING) and tell whichever one that might be to do the following code. The way I have it now, I have to paste this code after each and every button that says "on release do the following". I hope this make sense.
Here is a sample of the "on release code" that is prior to the following code. This is found 8 times, as I have eight menu options.
menu_mc.home_btn.onRelease = function() {
The code that I have below each of the button "on release" functions is attached.
The code WORKS fine. I just want to learn how to be more proficient. Any ideas?
Thanks so much!
Christy
Attach Code
if (home_mc._currentframe=="7") {
home_mc.gotoAndPlay("fadeout");
menu_mc.home_btn.enabled = true;
homecontent_mc._visible=false;
}
if (holyspirit_mc._currentframe=="7") {
holyspirit_mc.gotoAndPlay("fadeout");
menu_mc.holyspirit_btn.enabled = true;
holyspiritcontent_mc._visible=false;
}
if (globalrevival_mc._currentframe=="7") {
globalrevival_mc.gotoAndPlay("fadeout");
menu_mc.globalrevival_btn.enabled = true;
globalrevivalcontent_mc._visible=false;
}
if (ministrylocations_mc._currentframe=="7") {
ministrylocations_mc.gotoAndPlay("fadeout");
menu_mc.ministrylocations_btn.enabled = true;
ministrylocationscontent_mc._visible=false;
}
if (resources_mc._currentframe=="7") {
resources_mc.gotoAndPlay("fadeout");
menu_mc.resources_btn.enabled = true;
resourcescontent_mc._visible=false;
}
if (about_mc._currentframe=="7") {
about_mc.gotoAndPlay("fadeout");
menu_mc.about_btn.enabled = true;
aboutcontent_mc._visible=false;
}
if (donate_mc._currentframe=="7") {
donate_mc.gotoAndPlay("fadeout");
menu_mc.donate_btn.enabled = true;
donatecontent_mc._visible=false;
}
else if (contactus_mc._currentframe=="7") {
contactus_mc.gotoAndPlay("fadeout");
menu_mc.contactus_btn.enabled = true;
contactuscontent_mc._visible=false;
}
}
View Replies !
View Related
Condense This Code?
How would I simplify this code so I don't keep repeating the onEnterFrame functions for each movieclip? (or can I?)
Code:
function simpleFade() {
clearInterval(simpleFadeInterval);
ground.onEnterFrame = function() {
this._alpha -= 25;
if (this._alpha<0) {
this._alpha = 0;
delete this.onEnterFrame;
}
};
alone.onEnterFrame = function() {
this._alpha -= 25;
if (this._alpha<0) {
this._alpha = 0;
delete this.onEnterFrame;
}
};
top.onEnterFrame = function() {
this._alpha -= 25;
if (this._alpha<0) {
this._alpha = 0;
delete this.onEnterFrame;
}
};
crack.onEnterFrame = function() {
this._alpha -= 25;
if (this._alpha<0) {
this._alpha = 0;
delete this.onEnterFrame;
}
};
roots.onEnterFrame = function() {
this._alpha -= 25;
if (this._alpha<0) {
this._alpha = 0;
delete this.onEnterFrame;
}
};
}
simpleFadeInterval = setInterval(simpleFade, 2000);
View Replies !
View Related
Is It Possible To Condense This Actionscript?
Code:
swatch1.onEnterFrame = function () {
this._rotation += (-3 - this._rotation)/speed;
if (this._rotation<=-3) {delete this.onEnterFrame;}
}
swatch2.onEnterFrame = function () {
this._rotation += (-6 - this._rotation)/speed;
if (this._rotation<=-6) {delete this.onEnterFrame;}
}
swatch3.onEnterFrame = function () {
this._rotation += (-9 - this._rotation)/speed;
if (this._rotation<=-9) {delete this.onEnterFrame;}
}
swatch4.onEnterFrame = function () {
this._rotation += (-12 - this._rotation)/speed;
if (this._rotation<=-12) {delete this.onEnterFrame;}
}
Sorry for this noob Q, but is it possible to condense this Actionscript? Is it possible to use a loop or something?
Thanks for the Help!!!!
View Replies !
View Related
[F8] Creating Multiple Movie Clips From Bitmaps
Hi all....I need to convert 25 bitmaps to individual movie clips preferably in an automated way rather than dragging them onto the stage and right clicking on each one.
I googled a solution and found someone who said 'run the script below'.....as something of a novice, what I don't know is the process for running this script...can anyone assist ??
if (fl.getDocumentDOM() == null) {
fl.trace("Error: No document open.");
} else {
if (fl.getDocumentDOM().selection.length == 0) {
fl.trace("Error: Nothing selected.");
} else {
var convertedBitmaps = new Array();
var selArr = fl.getDocumentDOM().selection;
for (var i = 0; i < selArr.length; i++) {
var instanceRef = selArr
if (instanceRef.instanceType == "bitmap") {
var libraryItemRef = instanceRef.libraryItem;
var newName = stripExtension(libraryItemRef.name);
fl.getDocumentDOM().selectNone();
fl.getDocumentDOM().selection = new Array(instanceRef);
var mc = fl.getDocumentDOM().convertToSymbol("movie clip", newName, "top left");
if (mc == null) {
// Throws an error on screen anyway...
fl.trace("Error: Couldn't convert "+newName+" to symbol.");
}
}
}
fl.getDocumentDOM().selectNone();
}
}
function stripExtension(str) {
var pos = str.lastIndexOf(".");
if (pos == -1) {
return str;
} else {
return str.slice(0,pos);
}
}
View Replies !
View Related
Help Please: This Is Impossible To Condense To A Subject
Hi -
I tried putting in a relevant subject but gave up.
This is the problem I need help with. We have a 3D room made in Lightwave saved as a jpg. The room contains 3 key items. We also have a swatch of 80 textures on screen. We want to be able to click one of the three objects THEN click a texture from the pallette of 80 and the object (probably a jpg or png) would swap to that texture. Thats the easy part. Then we want to be able to click another object and then a textture and have that change. The the same for the 3rd. Each time you would click and onject and then a texture and it would change. So we cannot work out how to have 3 object on screen and select one then another and then another and so on with the ability to swap the image by choosing a texture from the same palette. We can't have 3 texture palettes because it would take up too much room. One thought is having 3 palettes on top of each other that look exactly the same. When you click an object that paletter comes into the foreground.
Anyway - I hope this makes sense. We just cannot get our heads around this.,
Thanks a lot.
View Replies !
View Related
Many Buttons With Same Code, How To Condense?
this should be fairly simple, but i'm not sure how to tackle- i have 10 buttons which all have similar code involving enabled/disabled and setRGB from white to black. my code looks like this (below), and it's repeated for btn_01 through btn_10, so i've got roughly 200 lines of code that are nearly all the same.
how would i go about condensing this code so there is not so much repetition?
btn_01.onRelease = function(){
btn_01.enabled = false;
btn_02.enabled = true;
etc
etc
btn_09.enabled = true;
btn_10.enabled = true;
text01Color.setRGB(0x000000);
text02Color.setRGB(0xffffff);
etc
etc
text09Color.setRGB(0xffffff);
text10Color.setRGB(0xffffff);
}
btn_02.onRelease = function(){
btn_01.enabled = true;
btn_02.enabled = false;
etc
etc
btn_09.enabled = true;
btn_10.enabled = true;
text01Color.setRGB(0xffffff);
text02Color.setRGB(0x000000);
etc
etc
text09Color.setRGB(0xffffff);
text10Color.setRGB(0xffffff);
}
View Replies !
View Related
[MX04] Is There A Way To Condense This Code
Is there a way to condense this code, so that it is just on the main time line? I also need the text to cycle thru, A,B,C,2 in the text box and when the mouse is stopped being pressed that letter/number stays there and the cursor moves to the next space; like text messaging.
On first frame _root time line.
_root.button1.onRelease = function(){
_root.count = 0;
this.gotoAndStop(this._currentframe +1);
}
Code on each frame for text.
this.pressIt.onEnterFrame = function(){
if(_root.count >= 10){
_root.yourTextField = _root.yourTextField + "D";
_root.count = 0;
this._parent.gotoAndStop(1);
}
}
Code on frame inside button,
_root.count = 0;
this.onEnterFrame = function(){
_root.count++;
trace(_root.count);
}
View Replies !
View Related
[F8] If You Have A Chance Look At My Script And Help Me Condense It
I'm a novice at actionscript. I have used it on and off for the past few years but never really become efficient because I don't use it enough. Anyway, I'm working a menu system and I think my code is, shall we say verbose. I need some advise on how I can condense the code. There are also some things I'm trying to figure out how to do so if you have any advise it would be appreciated. Please take a look at the attached files.
View Replies !
View Related
Condense Code...function?
I have a lot of these codes, I was wondering if it's possible to condense a function using brackets.
instead of using :
Code:
onSubmit1 = function() {
pos=1;
calledfrom="self"
var j=0;
for (i=0; i<51; i++) {
if (comp1 == tableaunoms[i]) {
i=51;
}
else {
j++;
}
}
onSubmit2 = function() {
pos=2;
calledfrom="self"
var j=0;
for (i=0; i<51; i++) {
if (comp2 == tableaunoms[i]) {
i=51;
}
else {
j++;
}
}
what should I write?
I have 16 of those similar functions...
normally I would use :
_level0["variablename"+x] as a syntax but I'm not sure how to address a function since it's not "sitting" on _level0...
thanks for your help
View Replies !
View Related
How Do I Condense This Script - Use Loop?
Hi,
I'm trying to condense this script (there are actually 50 buttons but I've just used 10 in this example).
ActionScript Code:
//Function to enable buttons
function enableButtons() {
port01But.enabled = true;
port02But.enabled = true;
port03But.enabled = true;
port04But.enabled = true;
port05But.enabled = true;
port06But.enabled = true;
port07But.enabled = true;
port08But.enabled = true;
port09But.enabled = true;
port10But.enabled = true;
}
Is there a way I can use a loop to indicate the 'number' part of the button name to set the button state?
Any help would be much appreciated,
Andy
View Replies !
View Related
Scrolling Very Long Movie Clips With Bitmaps In Them That Go Off The Workarea,BUG?
Hello all its been awhile,
I believe I have found a quite nasty BUG/limitation in flash 5. It seems that if you have a long strip of bitmaps you want to move across the stage(using a looping "move x_pos" script of some kind, NOT tweened), the strip of bitmaps CANNOT be much longer than the workarea. I have found that if a clip containing bitmaps is too long(way longer than the workarea), then the bitmaps that were off the work area in the beginning turn into wierd strips of color by the time the scroll onto the stage. I have seen this occur with consistancy. Has anyone out there seen this "workarea bug"? Did my explaination make sense?
Any help would be kind,
~dev_flasher
View Replies !
View Related
RegExp - Can You Condense These Lines Of Code?
Just wondering if this can be condensed... Thanks...
ActionScript Code:
//
regExp = /</gi;
s = s.replace(regExp, "<");
regExp = />/gi;
s = s.replace(regExp, ">");
regExp = /"/gi;
s = s.replace(regExp, """);
regExp = /'/gi;
s = s.replace(regExp, "'");
regExp = /&/gi;
s = s.replace(regExp, "&");
View Replies !
View Related
Menu Processing - Please Condense This Code
Well I have a menu on Frame1 of the main stage with 5 movieclips as the menu bars. Pressing the 1st menu should move the frame of the main stage one postition (to frame2). Pressing the 2nd menu should take you to frame3 of the main stage. Etc, etc.
Anytime I put the 'gotoAndStop(2)' directly into the eventlistener line, that function is run upon testing the application. So, when testing the app, it starts at Frame2 instead of frame1 and nothing was clicked.
So can anybody explain why this attached code works, but why any other method doesn't? in noob terms?
Thanks
Attach Code
function Menu1Click() {
_root.gotoAndStop("MenuItem1");
}
function Menu2Click() {
_root.gotoAndStop("MenuItem2");
}
menu1.onRollOver = MenuOver;
menu1.onRollOut = MenuOut;
menu1.onRelease = Menu1Click;
menu1.butttext.buttontext.text = "Basic Access Control - Wired Keypads"
menu2.onRollOver = MenuOver;
menu2.onRollOut = MenuOut;
menu2.onRelease = Menu2Click;
menu2.butttext.buttontext.text = "Basic Access Control - Battery Locks"
View Replies !
View Related
How Do I Condense This Moviclip Button Function?
I need some advice on how to condense this redundant Movie Clip script:
//ComboBox Scripts
var myListener:Object = new Object();
section_cb.addEventListener("change", myListener);
myListener.change = function () {
seating_mc.gotoAndStop(section_cb.value);
empty_mc.loadMovie("seating/" + section_cb.value + ".jpg");
};
//movieClip Button Scripts Sections 100-110
seating_mc.btn100_mc.onRollOver = function() {
myColor = new Color(this);
myColor.setRGB(0xFFE400);
}
seating_mc.btn100_mc.onRollOut = function() {
myColor = new Color(this);
myColor.setRGB(0xD3D9FF);
}
seating_mc.btn100_mc.onRelease = function() {
//this script tells movieclip to change comboBox
section_cb.selectedIndex = 0;
empty_mc.loadMovie("seating/" + section_cb.value + ".jpg");
seating_mc.gotoAndStop(section_cb.value);
};
View Replies !
View Related
Condense Repeating Code? Array?
Here is the code I have... and so on (up to g20)...
ActionScript Code:
g6.setTextFormat(font_fmt);
g6.setTextFormat(style_fmt);
g6.setTextFormat(size_fmt);
g5.setTextFormat(font_fmt);
g5.setTextFormat(style_fmt);
g5.setTextFormat(size_fmt);
g4.setTextFormat(font_fmt);
g4.setTextFormat(style_fmt);
g4.setTextFormat(size_fmt);
g3.setTextFormat(font_fmt);
g3.setTextFormat(style_fmt);
g3.setTextFormat(size_fmt);
g2.setTextFormat(font_fmt);
g2.setTextFormat(style_fmt);
g2.setTextFormat(size_fmt);
g1.setTextFormat(font_fmt);
g1.setTextFormat(style_fmt);
g1.setTextFormat(size_fmt);
How can I set it to use less lines...?
Can anyone help? Thanks!
View Replies !
View Related
How To Resize That Large Movie?
I created a flash movie which involves masking and i created this in a massive 800 x 600 a while ago stupidly, its basically a piece of text with loads of black round it, but now what i want to do is shrink this document down to a measly 150px high by 600px etc
Whenever i do this via document the shrink down only shrinks down the background and the animation is left way down on the page.
I've tried selecting all frames and moving them up to the resied background, but no such luck, tried selecting all etc and moving it to the area, still messes up etc.
I even tried to center it using the align tool to stage etc and still no luck....
So basically how do i get the whole text animation to fit nicely to my resized background without messing up?
Thank you for any help
View Replies !
View Related
Published Movie Too Large
We have recently purchased Flash MX professional and have tried out the new "slide" generation facility. We are inserting 350 x 231 pixel images into each slide with a fade transition; it is a slide show. This new feature will make our slide presentations much faster to make compared to Flash 5 which required a very complicated set of movie transitions and key frame usage.
When we go to publish the movie the file size is huge, around 3.5MB compared to the old method, which are usually around 600KB for the same amount of images. Surely we must be doing something wrong?
We have tried to amend the publish settings but we still end up with large file sizes. Any help would be appreciated, we would rather not go back to the old, longer method if we can help it!
Thanks in advance.
View Replies !
View Related
|