Posts by MaximusCript

15 posts
  • Exclusive Author
  • Has been a member for 3-4 years
MaximusCript says

Sorry Joost, my bad.

Hey i think i found a solution to that!

All i needed to do is add few lines of code:

var up:Bitmap = new Bitmap(new Picture);
var down:Bitmap = new Bitmap(new Picture);

up.pixelSnapping = PixelSnapping.NEVER;
down.pixelSnapping = PixelSnapping.NEVER;

up.smoothing = true;
down.smoothing = true;

up.scaleX = up.scaleY = down.scaleX = down.scaleY = 0.999;

upHolder.addChild(up);
downHolder.addChild(down);

startAnimation();

I just read somewhere on internet, that image’s automaticly snaps to full pixel, and only changing it’s pixelSnapping property to NEVER won’t make it. You also have to change scaling to something diffrent then full 1.

Hope it will help someone, someday… Bye.

15 posts
  • Exclusive Author
  • Has been a member for 3-4 years
MaximusCript says

Hello, its me again.

I searched all over the web, but i couldn’t find answear to this issue… And i ran out of ideas too.

So i got an animation of JPG picture, that is jumping at the end of Tween. Here’s link

I presume that problem is related with picture rendering. Here’s list of some things,(that i still remember) i did:

- I tried this animation with one picture - I checked this animation on some VERY powerfull computer, with good graphics card too. But jumping effect was still there. And CPU usage was even lower then with 360p videos on youtube. - I tried this animation with lowest possible image quality (0 in photoshop JPG save mode) - I tried with different image resolution (72 and 36), still no effect. - I tried to set BitMap.PixelSnapping = PixelSnapping.NEVER and all other options. NO effect. - Embeding image inside movie and making BitMap instances = no offect. - Loading from disk/web no effect - Allow smoothing / 100% quality from embedded JPG = no effect

I got on some clue anyways. When i try this animation with simple objects (rectangles, and some brush dots, lines) i get some jumping too!

To be exact only STROKES are jumping. Somewhere i read one day, that strokes must always be set on half pixel’s like 1,5 / 54,5 / 99,5 etc.

Any suggestions please?

PS: Does anybody knows how Bitmaps are rendered in Flash? A link to a lecture perhaps?

15 posts
  • Exclusive Author
  • Has been a member for 3-4 years
MaximusCript says

I’m not going to give up on this idea anyways :P

I just found that making this animation on timeline, typing all that random stuff in text fields, gives pretty nice effect, and dont take any CPU , that i will need for other things.

BUT . Of course, there is but… It took me about 30 minutes to make half of one text field with 351 characters in it. And i cant waste that much time on that.

Is there any way to speed it up? Anything?

Thank’s alot for help Tsafi, you already saved me so much time.

15 posts
  • Exclusive Author
  • Has been a member for 3-4 years
MaximusCript says

Hey thanks! Flupie Text Anim is amazing!

I got it working with two of my text fields, and it looks good, but it gets little choppy.

In my project i wish to use that animation to 7 – 10 text fields at once, do You know any other way to do that?

Maybe, putting text fields into movieClips, and adding several frames, with random text…? But this would probably cost alot kb’s.

Do You have any more suggestions Tsafi? or anyone?

15 posts
  • Exclusive Author
  • Has been a member for 3-4 years
MaximusCript says

Here is example what i have:

www.flashcontents.cba.pl/matrix

So i have there 7 text fields, and every text has randomed letters.

I cant get it look anything like there: www.futurebag.eu

Here’s code i got:
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
var fields = [onas1,onas2,onas3,onas3,onas4,onas5,onas6,onas7,onas8];
var w:int = 0;
var yes:int = 100;
var r:String = "HVUZLT3PA931KD0HL2XMC8BNYF7AJF2DW38GAGDL40LB0CNZ7SLG8DA8GFK4DL0SOAL2DJFS8CIFRK4OSP3LAZV8DKZSLHVUZLT3PA931KD0HL2XMC8BNYF7AJF2DW38GAGDL40LB0CNZ7SLG8DA8GFK4DL0SOAL2DJFS8CIFRK4OSP3LAZV8DKZSLHVUZLT3PA931KD0HL2XMC8BNYF7AJF2DW38GAGDL40LB0CNZ7SLG8DA8GFK4DL0SOAL2DJFS8CIFRK4OSP3LAZV8DKZSL";

addEventListener(Event.ENTER_FRAME, matrix);

function matrix(e:Event):void{
    for(var i:int = 0; i != fields.length; i++){                                   
        fields[i].t.text = fields[i].s.substring(0,w);                
        fields[i].t.appendText(r.substring(w,fields[i].l));
        if(w >= fields[i].l){                
            yes = i;
        }
    }
        if(yes != 100){
            fields.splice(yes,1);                
            yes = 100;                    
            if(fields.length == 0){
                removeEventListener(Event.ENTER_FRAME, matrix);
                trace("matrix done");
            }
        }
    w++;
}

Please help, i run out of ideas…

15 posts
  • Exclusive Author
  • Has been a member for 3-4 years
MaximusCript says

Thank’s alot for reply Tsafi!

Thats a smart concept of writing things out of no where. It’s cool and i like it! But, effect i like to achieve, is more like random letters, turning into right letters, making sentence. If You could only look at the link i posted, You will know what i mean.

let’s say we have sentence “I prefer actionscripting, then htmling.”

1. IGFOCLSEQP1PC0A1DVD0A4ALVO

2. I prefer aGFUSIALSOCPZ3D03LYD

3. I prefer actionscripting, theFODPA04KSDDOLC

4. I prefer actionscripting, then htmling.

Do you get now what i mean?

15 posts
  • Exclusive Author
  • Has been a member for 3-4 years
MaximusCript says

Hi. I found a very cool animation, and now of course i want to know how to do it :)

Effect is at : http://futurebag.eu/

Click on KOLEKCJA , and there, everytime you click next arrow, you will see that sweet text changing effect.

I have been fighting with that for a long time, and i have came to point, where i can remake that effect, but there is one but.

This animation is quite heavy when it comes to longer texts. Probably becouse of Math.random().

Let me show you some code:
var random:String = "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPLKHJGFDSAZXCVBNM1234567890";
// Random letters 
var letter:int = 0;                            // Letter to show
var sentence:String = textF.text;      // My textField i animate with some long text
var sentenceLength:int = sentence.length;      // Simply length of sentence in my textField

trace(sentence);
trace(sentenceLength);
addEventListener(Event.ENTER_FRAME, matrix);

function matrix(e:Event):void{
     letter++;
     textF.text = "";
     for(var i:int = 0; i != letter; i++){
          textF.appendText(sentence.charAt(i));
     }
     for(var j:int = letter; j != sentenceLength; j++){
          textF.appendText(random.charAt(Math.random() * 62));
     }
     if(letter == sentenceLength){
         trace("Animation is finished");
          removeEventListener(Event.ENTER_FRAME,matrix);
     }
}

Now it looks cool and all when i set it to 60 fps, but when i want some longer text, OR many textfields(then i put them in an array, together with another for loop), then it comes choppy.

So my question is: How to optimalize, or makethis anymation the way it will be fast and ligth.

I’ll appreaciate any help.

PS: Is there any way to get random number WITHOUT using heavy Math.random() function?

15 posts
  • Exclusive Author
  • Has been a member for 3-4 years
MaximusCript says

I couldn’t get better idea, but your way is is so simple, and so genius.

Thanks alot! Max

15 posts
  • Exclusive Author
  • Has been a member for 3-4 years
MaximusCript says

I have this small problem. I have mysite, where i have 5 oferts, with 5 huge images, that fits to width and height of browser. Now to do that i use z attribute in as3.

My code looks like this: var hei:int = stage.stageHeight; while(pi1c.width > wid){ pic1.z++; } while(pi1c.height > hei){ pic1.z++; } while(pic1.width < wid){ pic1.z—; } while(pic1.height < hei){ pic1.z—; } while(pi2c.width > wid){ pic2.z++; } while(pi2c.height > hei){ pic2.z++; } while(pic2.width < wid){ pic2.z—; } while(pic2.height < hei){ pic2.z—; }[/code]

wid:int = stage.stageWidth;

This works perfect, but all these pic have diffrent sizes, and it makes a nice pile of code, and lots more work for cpu. All this pictures are displayed at once, and code is run at resize event. Now, does anybody know,s how to calculate how much width/height increase and decrease while playing with z attribute?

Please, any tips.

PS: Also, could someone tell me how i make my code, look like a code i mean how i put it in a border.

15 posts
  • Exclusive Author
  • Has been a member for 3-4 years
MaximusCript says

Oh i havent mention im not using right now pixel fonts.

Im working with “Code Light” ( http://fontfabric.com/code-free-font-3/ ), trying to get text sharp at 16 px, which is pretty small as for this font.

As flash have no stroke option, to make my text bolder and sharper at once, im trying to get it with png, from illustrator, but its still little blurry…

Any ideas, what should i do?

by
by
by
by
by
by