Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Video Keeps Shrinking Weird...



The videos on this site under "Motion Graphics" look fine the first time around, but after a couple of repeat selections on the menu, the video shrinks! It keeps on shrinking, as you go around clicking the different thumbnails.

Can anyone tell me why it might be doing this?



ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 08-03-2006, 01:44 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Weird Squelch Before Video
So, i have a swf file that one of our artists made many many moons ago. He has since left. I have been put in charge of removing a "Play Now" button.

Seems like an easy task, and once I played around a bit, I got the button out of there and had it playing like a champ.

Problem is, now there is a weird squelch before the video starts playing.
I checked the audio frame and there isn't even any audio playing during that time to have gotten corrupt.

Any ideas?

Any way of muting the first 2 seconds and then auto unmuting?

Really Weird Video Streaming Problem...
Hi,
I have a website at www.riggedproductions.com. If you click on the film/video section you can view various movie clips encoded as separate .flv files. Try clicking on a video on the left and wait till you see black or a video image like its about to play. Now click on two or so more movies and do the same thing. By the 3rd or 4th movie, the movies no longer load in the sceen area. Does anyone know why? It's very annoying....

Thanks,

Email me: Bobby@riggedproductions.com

Survey For A Weird Video Problem
Please use Internet Explorer (only IE is having problems) and navigate to the QMax product page via the main menu: http://www.unipac.com.my

Products > QMax

and then please answer if you're able to view the Flash video on that page.

Thanks in advance.

Client expressed his full frustration to me when many of his clients and some of his staff complained to him that his video could not be seen or not loaded.

Also, here's a weird behaviour. The computer I was using in their office couldn't play the video unless I clicked on their QMax logo on the homepage (below) that links to the product page. Weird.

I'm currently experimenting with the source by using the non-standards compliant embed code to see if it'll solve the problem because the rest of the Flash on the website are using A List Apart's Flash Satay method.

The prototype version we have running is fine all round: http://unipac.hawks-eyrie.net

I'm also looking into these other solutions if others around the world face the same weird problem:
1. Embed Windows Media Player
2. Recommend client to move to a different host (current one is their choice)

p/s: If anyone can give me a heads up for the cause of this problem, it's much appreciated. Thanks.

Flash Video Acting Weird On IE
Hello everyone,

I've got a Flash video player on a website but friends on IE have reportedly experience problem trying to even load it. It's like they're waiting for ages but nothing appears. I'm using the Flash flv player by jeroenwijering.

Please use your Internet Explorer and visit:
http://www.vmcc.com.my/ambassador.php

Then let me know if it works for you. It'll also be great if you list down your:
Flash player version
Operating system (and service pack)
Thanks for the help.

p/s: No problems in modern browsers; Firefox and Opera so don't have to test on them.

Cheers.

Weird Flash Video Problem
I'm not sure if this topic should be here and I've asked at Sitepoint and they don't seem to be helping much. So here's the problem.

Please use Internet Explorer (only IE is having problems) and navigate to the QMax product page via the main menu: http://www.unipac.com.my

Client expressed his full frustration to me when many of his clients and some of his staff complained to him that his video could not be seen or not loaded.

Also, here's a weird behaviour. The computer I was using in their office couldn't play the video unless I clicked on their QMax logo (not the Flash) on the homepage (below) that links to the product page. Weird.

The prototype version we have running is fine all round: http://unipac.hawks-eyrie.net

Also, the solutions Sitepoint people have given me: http://www.sitepoint.com/forums/show....php?p=2834077

Anyone able to help me out here?

AS3 - Video Is Acting Weird On Server
When I test my movie locally it works totally fine but when I put it on the server the video behaves strangely: the first time you go to the video section, it plays fine, but if you navigate away to another frame of the movie and then come back to the video, it won't play. All that happens is that the play controller of the video component appears, with different dimensions this time, and the preloader just loads and loads but the video never kicks in. What am I doing wrong? The video is the most important part of the site!!!

I'm using the FLVPlayback component for the video and the only code I have for it is to unload the video when you navigate to another frame [myPlayer.stop();]. This code isn't the problem though because it does the same thing when I take it out. What is the script I need to make this run properly?

Here's my site so you can refer to what I'm talking about. Video is on the "TWI TV" tab. Help!

www.thewaterinitiative.com

Shrinking Box
I was playing round with the setproperty thing to make a movieclip rotate. I'm quite happy with how it's done, just I got an unexpected side effect. The movie clip I was rotating shinks!!! Does anyone know why?

you can see what I've done and download the fla at http://www.browna27.freeserve.co.uk/shrinkingbox.htm

This one's got me beat.

Rotating And Shrinking
Why do my movie clips that are rotating using actionscript allways shrinking after some time and is there a way to fix that?

Rotating And Shrinking
Why do my movie clips that are rotating using actionscript allways shrinking after some time and is there a way to fix that?

Shrinking Charts
Hi,

Im using the Flash MX charting components, to draw a bar chart which alters over time. However for some data the chart seems to shrink down tot he right (i.e the whole thing goes very thin) The axis lables are unaffected, as is the caption...

Anyone any idea what might be happening here, I'm lost, completely...

Shrinking Wav Loop For Web Use
I've just purchased a music loop from www.elevator53.net for a client's website. I gave credit card details etc, and it gave me two files to download - a wav and an aif - both at around 7mb each.

The loop is 40 seconds long, and I will obviously need to reduce the quality and filesize so it's appropriate for the web. The current mp3 loop which I've just been using as an example is around 12 seconds long. I am using the site preloader to preload the loop (which I place in the library of an external swf for caching purposes, preload the loop.swf, and then load the sound to the main movie using the loadSound AS. I REALLY want to keep this arrangement, and I don't want to stream the loop at all.

So, I need to get this 7mb, 40second wav loop crunched into a file (mp3 if necessary) of no more than about 200kb, without killing too much quality.

I can think of a few ways to do this, but I need to know people's opinions on the best way. One thing I definitely want to avoid is that second of silence at the start that some conversion programs give you.

Any ideas?

MC Sprite Shrinking
Hi
I am having troubles using sprites in my flash projects

When i import an image to the main stage it appears full size, but when i copy/import again the same image into a movieclip it becomes smaller and unusable

How do i stop this and make them copy the same size?

Shrinking The Project
is there a way to scale down my entire flash project at once? after getting everything together the one problem is that the whoel thing takes up too much screen on laptops. can i scale down the size of everything at once?

thanks

Shrinking .swf Object
For all of you Flash Guru's,

Is there any way to construct ashrinking .swf object?

My intentions is for the .swf object to start running at a certain size on an HTML page and shrink during it's run in order to reveal other HTML content.

Hope I made my self clear

THx, Kfir

Shrinking Loadbar
I want to create a preloader with a loadbar that shrinks from left to right. My loadbar is a white box. I want it to uncover the layer behind it effectively revealing more of an image as the swf loads. My code (below) works if I try to "grow" the loadbar. I was trying to use a minus sign to reverse the math, but I couldn't figure out where to put it. In case it matters, I have my movie set up with the anchor point on the right side (since that's the point I want to stay fixed).

Thanks in advance.

Action script to make loadbar grow (How do I make it shrink, instead?):

bytes_loaded = Math.round(this.getBytesLoaded());
bytes_total = Math.round(this.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
this.loadBar._width = getPercent*(100);
this.loadText = Math.round(getPercent*100)+"%";
if (bytes_loaded == bytes_total) {
this.gotoAndPlay (5);
}

Shrinking An Object
Hello,

I have a button that shrinks an icon on my screen. The problem I am having is that its shrinking to the movicelips upper left corner and need to shrink to its centerpoint. Here is a portion of my code if that helps:

if (clickCheck == true && icon_mc.scaleX >= 0){
icon_mc.scaleX = icon_mc.scaleX - .05
icon_mc.scaleY = icon_mc.scaleX
}

Why Is My Text Shrinking?
Look at the attached document. Why does the dynamic text become smaller in the SWF?

Amazing Shrinking MC
so im loading in an external swf and the thing decides it wants to shrink and be about 3/4 size when loaded, which is, needless to say, unacceptable. i'm just using
bulletin.loadMovie("bulletin.swf");
anyone know whats goin on?
thanks

Why Is My Text Shrinking?
Look at the attached document. Why does the dynamic text become smaller in the SWF?

Shrinking The Movie
Firstly, i'm a complete newbie to flash and i've only been using it for 2 weeks.

My problem is that i have made a movie, but it is just a small rectangle in size. Whenever i play it, it also shows the blank area around it.

How do i fix this?

any help would be greatly appreciated.

Thanks
-Rogue

Flash .swf Shrinking In Netscape 6.1 WHY?
I just finished a site the has a small Flash header at the top og the homepage. I used the code generated from the Flash publish command, and cut and pasted it into my main HTML page. It looks great in IE 5 but when I view it in Netscape 6.1 it shrinks to a quarter of it's size! I've struggled with this, looking at the code and can't find what I'm doing wrong! CAN SOMEONE PLEASE HELP?

Signed,
Desperate and hates Nutscrape!

Growing And Shrinking Button
i have a button that consists of a black backgound and a soft white "glow" on it. what i want is this: when you mouse over the "glow" it flares up and gets bigger and when you move off of it, it shrinks back down to its normal size. i've accomplished to first part (making it grow when you mouse over), but if you leave the pointer on it, it just loops. i want it to stay big and then shrink down when you move off. if anyone out there knows what i'm talking about and how to accoplish it i would greatly appreciate your help!!!!

num451

Growing/shrinking Button With Mc
This seems so simple, but I can't for the life of me figure out how to do this...

in Flash 5...

I want to have a circle that is a button, so that when you rollover it it expands over 5 frames and when you roll off it, it shrinks back to the original size, again over 5 frames. And, I want it that if you roll off, before it's fully grown it'll start shrinking back from that point (not go all the way to full and not just skip back to small size). An example of what I'm talking about is at http://www.kabbalah.com/kabbalah/ - the register button at the top left.

Does anyone have an example of how to build that kind of button/mc?

Expanding/shrinking Problem
I want to make a ball expand ...how can i do that?

Shrinking File Size
Does anyone know any tricks for making a smaller swf file?
Thanks.

[MX] GRRRRRRRRR My Figures Are SHRinking
My first real day animating in Flash, and I'm about to kill my computer.

Everything was going well, until I decided I didn't like my background that I'd spent hours creating. So I exported it to photoshop, did some editing, and brought it back in. Now I have two problems.

1) I cannot edit the background whatsoever. All I want to do is erase part of it, but it's acting like the layer is locked when it's not.

2) Every time I animate my character and add a tween, she shrinks between the key frames.

Any help much appreciated!

- CW

Math-growing And Shrinking
hi all- i am working to do a simple mouse to object reaction. I am getting close to the effect, only it is opposite of what i was expecting. The goal, simply as the mouse approaches the square, the square "grows"....as the mouse leaves, it returns to it's original scale.

you can see by my horrible math, this is more an exercise to understand math and its relationship to the mouse, stage, etc. Anyway, can you help me out?


Code:
package com.site
{
import flash.display.Sprite;
import flash.events.Event;
import flash.geom.Matrix;

public class Box extends Sprite{
public function Box(){
this.outer=100;
init();
}
private function init(){
this.addEventListener(Event.ADDED_TO_STAGE,testMouse)
}
private function testMouse(ev:Event){
this.addEventListener(Event.ENTER_FRAME,measure)
}
private function measure(ev:Event){

var xm:Number=this.x-mouseX;
var ym:Number=this.y-mouseY;
var diagnal:Number=Math.sqrt(((this.x+this.width/2)*(this.x+this.width/2))-((this.width/2)-(this.width/2)));
var dist:Number=Math.round(Math.sqrt(xm*xm+ym*ym))+this.width;
if(dist<=200){
this.scaleX=this.scaleY=dist/100
trace(this.scaleX+" "+dist)
trace(dist/100);
}
}

}
}

Flash Shrinking Image
I just upgraded to cs3, and I have a site that I built in flash 8 (as2) that I wanted to update an image on. Everytime I try to import the newest version of the image flash shrinks the hell out of it. I can't figure out why. Is there maybe a setting I am not aware of? I am publishing it for as2 since thats what I built it in. I would appreciate any help.

[CS3] Actually Random Shrinking Problem
Ok so thi is my first post ever on one of these sort of forums so pardon me if I dont live up to expectations =P

I'm designing a randomly moving atom wallpaper for my mobile (no this doesnt belong in the mobile devices category) and it works perfectly and everything, BUT and theres always a but, the atom in question shrinks! Even when im playing it on my computer, it shrinks over a period of a minute or two.

Im reasonably experienced with flash (actionscript 2, intermediate) and i cant see any possible way for the atom to shrink! its impossible!

many thanks for your help in this guys/gals!!

Mike, 004505

N.B. I use CS4, the .fla file below is in CS3 format!

Growing And Shrinking Problem
I am trying to make a script that will grow the hovered button and shrink when rolled out of.

So far I have this script:

ActionScript Code:
// Script to resize buttons

size = 130; // Final Scale Size

// Set Butons
b_home.onRollOver = function() {
    buttonScale(this);
}
b_news.onRollOver = function() {
    buttonScale(this);
}

// Run Function

function growButton(button, deltaSize) {
    this.onEnterFrame = function() {
        if (button._xscale < size) {
            button._xscale += deltaSize;
            button._yscale += deltaSize;
        } else if (button._xscale >= size) {
            delete this.onEnterFrame;
        }
    }
}

function shrinkButton(button, deltaSize) {
    this.onEnterFrame = function() {
        if (button._xscale > 100) {
            button._xscale -= deltaSize;
            button._yscale -= deltaSize;
        } else if (button._xscale <= 100) {
            delete this.onEnterFrame;
        }
    }
}

function buttonScale(button) {
    changeSize = size - 100;
    deltaSize = changeSize/3;
    growButton(button, deltaSize);
    button.onRollOut = function() {
        shrinkButton(button, deltaSize);
    }
}

The script works, it is just that if you go over the next button before the first finishes, it will stop. I know this is probably easy, but I am not sure right off hand how to fix it. Thank you for any help!


EDIT: I would also like to add an ease, but this is a side thing. I just need to get it working first. Thank you.

Shrinking The Print Area
i'm trying to print from my SWF. i specified my print area, as seen in my code below. however, the print area is much bigger than a 8.5x11 sheet of paper. i want to scale the print area down before it prints. it has been suggested that i print from a movie clip instead of the root. but this is a furniture planning program, where i am loading furniture into the root. if i print a movie clip, i'll lose that furniture. obviously, those height and width parameters that i commented out are not working. does anyone have any code that i could paste in its place that will scale down my print job to letter-size? thanks for your help.

-ted



Code:
_root.print_btn.onRelease = function() {
var my_pj = new PrintJob();
var myResult = my_pj.start();
if (myResult) {
myResult = my_pj.addPage("_root", {xMin:723.3, xMax:1575.35, yMin:0, yMax:1181.5}, {printAsBitmap:false}, 5);
//my_pj._width = 612;
//my_pj._height = 792;
my_pj.send();
}
delete my_pj;
};

Very Cool Self-Shrinking Webpage
Hi,
I'd like to create an effect I saw on a site. All the contents of the window can size up or down as the window resizes. You can see it here;
http://www.jennifershannon.com

It must be a fairly simple maneuver.
Any tips on how this is done would be greatly appreciated.
Cheers,
Bob

Shrinking A Graphic From Left To Right
I am trying to transform a photo from 100% to 0% (which I will want it to do slowly to reveal another photo underneath) and only the width and not the height to decrease which I know how to do but instead of both sides of the photo shrinking to the centre of the photo (when using the free transform tool), I want it to decrease to 0% from left to right - a bit like a slideshow moving from left to right but the photo doesn't actually move, it just shrinks starting from the left side to the right revealing the next photo underneath. I thought this would be a simple thing to do but I can't work out how to do it.

Thanks

Growing / Shrinking Window
I'm looking to build a "popup" window that will grow in height to a certain point when a button is clicked. When another "close" button within this window is clicked, it will shrink back down to its original height. I also want to be able to load text in a dynamic text field within it, using a sendandload.

Are there any good tutorials for this sort of thing? I am having quite the time figuring out the best way to go about this.

Help -- Shrinking The Distance Between X,y Coordinates
hey...

i am trying to create code that will shrink the distance between x,y coordinates by 50%

it works but only when x,y coordinates move from north to south, for example...
0,0
0,10
0,20
0,30
0,40
0,50

becomes (which is right)
0,0
0,5
0,10
0,15
0,20
0,25

however when the x,y coordinates move south to north...
0,0
0,-10
0,-20
0,-30
0,-40
0,-50

it remains (and is wrong)
0,0
0,5
0,10
0,15
0,20
0,25

instead of (which would be right)
0,-0
0,-5
0,-10
0,-15
0,-20
0,-25

the problem i believe lies with this part of the function...

ang = (ang - 90);
a = degToRad(ang);
xxx = xx + Math.cos(a) * radius;
yyy = yy - Math.sin(a) * radius;

i'm nearly there, i'm just doing something fundamentally wrong with the math calculating the x,y coordinates

if anybody has any ideas, i could really use the help, i got to be missing something pretty simple...

the code is in the function testShrink, below it are the support functions

if you want to test it in flash, i've created a function that creates a test list of x,y coordinates, there is also a function that will automatically give you a graphical representation of the points; white line (original), red line (new, shrunk)

thanks
.....................

//creates a test list of x,y coordinates 0,0 0,10 0,20 0,30 0,40 0,50 0,60 0,70 0,80
//"down" creates a list from 0,0 to 0,80
//"up" creates a list from 0,0 to 0,-80
create_testList("down");

//fires function using testList as x,y coordinates to shrink
testShrink(testList);


//the function i've created consists of three components...
//a) determine distance between points
//b) determine angle between points
//c) use distance and angle to create new series of points

function testShrink (arr):Void {
var distList:Array = new Array();
var angList:Array = new Array();
var shrinkList:Array = new Array();

//puts orgin x,y coordinates in shrinkList array
this["temp" + 0] = new Array();
this["temp" + 0][0] = arr[0][0];
this["temp" + 0][1] = arr[0][1];
shrinkList[0] = this["temp" + 0];

//determines distance between points and puts in distList array
for (var i=0; i<arr.length; i++) {
var n = hypot(arr[i][0],arr[i][1],arr[i+1][0],arr[i+1][1]);
n = Math.round(n/2);
distList.push(n);
trace("distance..."+i+"
"+n);
}

//determines angle between points and puts in angList array
for (var k=2; k<arr.length; k++) {
var n = findDegree(arr,k);
angList.push(n);
trace("degree..."+k+"
"+n);
}

//creates new x,y coordinates and puts in shrinkList array
for (var i=0; i<arr.length-2; i++) {

var a,xxx,yyy;
var ang = angList[i];
var radius = distList[i];
var xx = shrinkList[i][0];
var yy = shrinkList[i][1];

ang = (ang - 90);
a = degToRad(ang);

xxx = xx + Math.cos(a) * radius;
yyy = yy - Math.sin(a) * radius;

this["temp" + i] = new Array();
this["temp" + i][0] = Math.round(xxx);
this["temp" + i][1] = Math.round(yyy);

shrinkList[i+1] = this["temp" + i];
}

trace("original..."+arr.length+"
"+arr.join("
") );
trace("shrinkList..."+shrinkList.length+"
"+shrin kList.join("
"));

//create graphical representation of old and new points
drawXY(arr,shrinkList);
}

/////////////////////////////////////
//SUPPORT FUNCTIONS

function create_testList (xxx:String) {
var upDown = 1;
if (xxx=="up") {upDown=-1;};

testList = new Array();
for (var i=0; i<9; i++) {
this["temp" + i] = new Array();
this["temp" + i][0] = 0;
this["temp" + i][1] = (10 * i) * upDown;
testList[i] = this["temp" + i];
}
//trace(testList.join("
"));
}

function hypot (x,y,xx,yy) {
var n = Math.pow( (diff(x,xx)),2 ) + Math.pow( (diff(y,yy)),2 );
n = Math.round(Math.sqrt(n));
return n;
}

function findDegree (list,n) {
var xxx,yyy,deltaX,deltaY,rad,ang,degree,a;
var x = list[n-1][0];
var y = list[n-1][1];
var xx = list[n][0];
var yy = list[n][1];

if (n==0) {
x = list[0][0];
y = list[0][1];
}

deltaX = xx-x;
deltaY = yy-y;
rad = Math.atan2(deltaY,deltaX);
ang = (rad/Math.PI)*180;

if (yy<y) {
degree = (Math.abs(ang) - 90);
} else {
degree = (Math.abs(ang) - 90) * -1;
}

return roundToDecimal(degree,2);
}

function degToRad (d) {
return (d/180)*Math.PI;
}

function roundToDecimal (theNumber, decPlaces) {
if (decPlaces >= 0) {
var temp = Math.pow(10, decPlaces);
return Math.round(theNumber * temp)/temp;
}
}

function diff (r,s) {
return Math.abs(r-s);
}

function drawXY (listA,listB) {
//listA
_root.createEmptyMovieClip("path0",0);
_root.path0.lineStyle(10,0x000000,100);
_root.path0.moveTo(listA[0][0],listA[0][1]);

for (var j=1; j<listA.length; j++) {
_root.path0.lineTo(listA[j][0],listA[j][1]);
}

//listB
_root.createEmptyMovieClip("path1",1);
_root.path1.lineStyle(2,0xFF0000,100);
_root.path1.moveTo(listB[0][0],listB[0][1]);

for (var j=1; j<listB.length; j++) {
_root.path1.lineTo(listB[j][0],listB[j][1]);
}
}
//////////////////////////////////////////

Super Expanding/shrinking Swf
If you go to www.tdcollins.com, you'll notice that the background is a swf that expands and shrinks with the browser. but inside is anotehr movie, the home-page, and what-not. No matter how you change the browsers size, only the background changes, not the inner movie. How can i do that?

Dynamically Shrinking Text
Hey everyone...

As Ned Flanders might say, I'm in a dilly of a pickle right now...

I have a movie clip with a dynamic text box inside of it. This box is 160 pixels wide and has a font size of 14.

I am dynamically loading car names into this box. Something like "2006 Ford Taurus" just fits perfectly in there with the font I am using... another name, such as "2006 Ford Econoline" is too long and the text is cut off... I won't have anything much longer than about 25 characters, but I cannot go over the 160 pixels I have and I cannot multiline it... is there any way I can switch the text size, or "squish" the letters together so that everything will fit?

Thanks,

--d

Text Fields Are Shrinking
Ok I have a MC with multiple text areas that dynamically load text.

For some reason the first one works fine, but everytime I add a new one and test, they get subsequetly smaller text in them.

So Field #1 has 12pt text
#2 has 10pt text...

I want the text to stay 12pt, any idea what is causing this??

Growing / Shrinking Window
I'm looking to build a "popup" window that will grow in height to a certain point when a button is clicked. When another "close" button within this window is clicked, it will shrink back down to its original height. I also want to be able to load text in a dynamic text field within it, using a sendandload.

Are there any good tutorials for this sort of thing? I am having quite the time figuring out the best way to go about this.

Help -- Shrinking The Distance Between X,y Coordinates
hey...

i am trying to create code that will shrink the distance between x,y coordinates by 50%

it works but only when x,y coordinates move from north to south, for example...
0,0
0,10
0,20
0,30
0,40
0,50

becomes (which is right)
0,0
0,5
0,10
0,15
0,20
0,25

however when the x,y coordinates move south to north...
0,0
0,-10
0,-20
0,-30
0,-40
0,-50

it remains (and is wrong)
0,0
0,5
0,10
0,15
0,20
0,25

instead of (which would be right)
0,-0
0,-5
0,-10
0,-15
0,-20
0,-25

the problem i believe lies with this part of the function...

ang = (ang - 90);
a = degToRad(ang);
xxx = xx + Math.cos(a) * radius;
yyy = yy - Math.sin(a) * radius;

i'm nearly there, i'm just doing something fundamentally wrong with the math calculating the x,y coordinates

if anybody has any ideas, i could really use the help, i got to be missing something pretty simple...

the code is in the function testShrink, below it are the support functions

if you want to test it in flash, i've created a function that creates a test list of x,y coordinates, there is also a function that will automatically give you a graphical representation of the points; white line (original), red line (new, shrunk)

thanks
.....................

//creates a test list of x,y coordinates 0,0 0,10 0,20 0,30 0,40 0,50 0,60 0,70 0,80
//"down" creates a list from 0,0 to 0,80
//"up" creates a list from 0,0 to 0,-80
create_testList("down");

//fires function using testList as x,y coordinates to shrink
testShrink(testList);


//the function i've created consists of three components...
//a) determine distance between points
//b) determine angle between points
//c) use distance and angle to create new series of points

function testShrink (arr):Void {
var distList:Array = new Array();
var angList:Array = new Array();
var shrinkList:Array = new Array();

//puts orgin x,y coordinates in shrinkList array
this["temp" + 0] = new Array();
this["temp" + 0][0] = arr[0][0];
this["temp" + 0][1] = arr[0][1];
shrinkList[0] = this["temp" + 0];

//determines distance between points and puts in distList array
for (var i=0; i<arr.length; i++) {
var n = hypot(arr[i][0],arr[i][1],arr[i+1][0],arr[i+1][1]);
n = Math.round(n/2);
distList.push(n);
trace("distance..."+i+"
"+n);
}

//determines angle between points and puts in angList array
for (var k=2; k<arr.length; k++) {
var n = findDegree(arr,k);
angList.push(n);
trace("degree..."+k+"
"+n);
}

//creates new x,y coordinates and puts in shrinkList array
for (var i=0; i<arr.length-2; i++) {

var a,xxx,yyy;
var ang = angList[i];
var radius = distList[i];
var xx = shrinkList[i][0];
var yy = shrinkList[i][1];

ang = (ang - 90);
a = degToRad(ang);

xxx = xx + Math.cos(a) * radius;
yyy = yy - Math.sin(a) * radius;

this["temp" + i] = new Array();
this["temp" + i][0] = Math.round(xxx);
this["temp" + i][1] = Math.round(yyy);

shrinkList[i+1] = this["temp" + i];
}

trace("original..."+arr.length+"
"+arr.join("
") );
trace("shrinkList..."+shrinkList.length+"
"+shrin kList.join("
"));

//create graphical representation of old and new points
drawXY(arr,shrinkList);
}

/////////////////////////////////////
//SUPPORT FUNCTIONS

function create_testList (xxx:String) {
var upDown = 1;
if (xxx=="up") {upDown=-1;};

testList = new Array();
for (var i=0; i<9; i++) {
this["temp" + i] = new Array();
this["temp" + i][0] = 0;
this["temp" + i][1] = (10 * i) * upDown;
testList[i] = this["temp" + i];
}
//trace(testList.join("
"));
}

function hypot (x,y,xx,yy) {
var n = Math.pow( (diff(x,xx)),2 ) + Math.pow( (diff(y,yy)),2 );
n = Math.round(Math.sqrt(n));
return n;
}

function findDegree (list,n) {
var xxx,yyy,deltaX,deltaY,rad,ang,degree,a;
var x = list[n-1][0];
var y = list[n-1][1];
var xx = list[n][0];
var yy = list[n][1];

if (n==0) {
x = list[0][0];
y = list[0][1];
}

deltaX = xx-x;
deltaY = yy-y;
rad = Math.atan2(deltaY,deltaX);
ang = (rad/Math.PI)*180;

if (yy<y) {
degree = (Math.abs(ang) - 90);
} else {
degree = (Math.abs(ang) - 90) * -1;
}

return roundToDecimal(degree,2);
}

function degToRad (d) {
return (d/180)*Math.PI;
}

function roundToDecimal (theNumber, decPlaces) {
if (decPlaces >= 0) {
var temp = Math.pow(10, decPlaces);
return Math.round(theNumber * temp)/temp;
}
}

function diff (r,s) {
return Math.abs(r-s);
}

function drawXY (listA,listB) {
//listA
_root.createEmptyMovieClip("path0",0);
_root.path0.lineStyle(10,0x000000,100);
_root.path0.moveTo(listA[0][0],listA[0][1]);

for (var j=1; j<listA.length; j++) {
_root.path0.lineTo(listA[j][0],listA[j][1]);
}

//listB
_root.createEmptyMovieClip("path1",1);
_root.path1.lineStyle(2,0xFF0000,100);
_root.path1.moveTo(listB[0][0],listB[0][1]);

for (var j=1; j<listB.length; j++) {
_root.path1.lineTo(listB[j][0],listB[j][1]);
}
}
//////////////////////////////////////////

Super Expanding/shrinking Swf
If you go to www.tdcollins.com, you'll notice that the background is a swf that expands and shrinks with the browser. but inside is anotehr movie, the home-page, and what-not. No matter how you change the browsers size, only the background changes, not the inner movie. How can i do that?

Shrinking File Size
As those who checked out my site know, my website takes forever to load, and all it is is a basic layout. How do i shrink file size without change the interface looks, etc. By the way, idomain, I did as you said, but it didn't really work. Thanks anyway.

Help -- Shrinking Distance Between X,y Coordinates
hey...

i am trying to create code that will shrink the distance between x,y coordinates by 50%

it works but only when x,y coordinates move from north to south, for example...
0,0
0,10
0,20
0,30
0,40
0,50

becomes (which is right)
0,0
0,5
0,10
0,15
0,20
0,25

however when the x,y coordinates move south to north...
0,0
0,-10
0,-20
0,-30
0,-40
0,-50

it remains (and is wrong)
0,0
0,5
0,10
0,15
0,20
0,25

instead of (which would be right)
0,-0
0,-5
0,-10
0,-15
0,-20
0,-25

the problem i believe lies with this part of the function...

ang = (ang - 90);
a = degToRad(ang);
xxx = xx + Math.cos(a) * radius;
yyy = yy - Math.sin(a) * radius;

i'm nearly there, i'm just doing something fundamentally wrong with the math calculating the x,y coordinates

if anybody has any ideas, i could really use the help, i got to be missing something pretty simple...

the code is in the function testShrink, below it are the support functions

if you want to test it in flash, i've created a function that creates a test list of x,y coordinates, there is also a function that will automatically give you a graphical representation of the points; white line (original), red line (new, shrunk)

thanks
.....................

//creates a test list of x,y coordinates 0,0 0,10 0,20 0,30 0,40 0,50 0,60 0,70 0,80
//"down" creates a list from 0,0 to 0,80
//"up" creates a list from 0,0 to 0,-80
create_testList("down");

//fires function using testList as x,y coordinates to shrink
testShrink(testList);


//the function i've created consists of three components...
//a) determine distance between points
//b) determine angle between points
//c) use distance and angle to create new series of points

function testShrink (arr):Void {
var distList:Array = new Array();
var angList:Array = new Array();
var shrinkList:Array = new Array();

//puts orgin x,y coordinates in shrinkList array
this["temp" + 0] = new Array();
this["temp" + 0][0] = arr[0][0];
this["temp" + 0][1] = arr[0][1];
shrinkList[0] = this["temp" + 0];

//determines distance between points and puts in distList array
for (var i=0; i<arr.length; i++) {
var n = hypot(arr[i][0],arr[i][1],arr[i+1][0],arr[i+1][1]);
n = Math.round(n/2);
distList.push(n);
trace("distance..."+i+"
"+n);
}

//determines angle between points and puts in angList array
for (var k=2; k<arr.length; k++) {
var n = findDegree(arr,k);
angList.push(n);
trace("degree..."+k+"
"+n);
}

//creates new x,y coordinates and puts in shrinkList array
for (var i=0; i<arr.length-2; i++) {

var a,xxx,yyy;
var ang = angList[i];
var radius = distList[i];
var xx = shrinkList[i][0];
var yy = shrinkList[i][1];

ang = (ang - 90);
a = degToRad(ang);

xxx = xx + Math.cos(a) * radius;
yyy = yy - Math.sin(a) * radius;

this["temp" + i] = new Array();
this["temp" + i][0] = Math.round(xxx);
this["temp" + i][1] = Math.round(yyy);

shrinkList[i+1] = this["temp" + i];
}

trace("original..."+arr.length+"
"+arr.join("
"));
trace("shrinkList..."+shrinkList.length+"
"+shrinkList.join("
"));

//create graphical representation of old and new points
drawXY(arr,shrinkList);
}

/////////////////////////////////////
//SUPPORT FUNCTIONS

function create_testList (xxx:String) {
var upDown = 1;
if (xxx=="up") {upDown=-1;};

testList = new Array();
for (var i=0; i<9; i++) {
this["temp" + i] = new Array();
this["temp" + i][0] = 0;
this["temp" + i][1] = (10 * i) * upDown;
testList[i] = this["temp" + i];
}
//trace(testList.join("
"));
}

function hypot (x,y,xx,yy) {
var n = Math.pow( (diff(x,xx)),2 ) + Math.pow( (diff(y,yy)),2 );
n = Math.round(Math.sqrt(n));
return n;
}

function findDegree (list,n) {
var xxx,yyy,deltaX,deltaY,rad,ang,degree,a;
var x = list[n-1][0];
var y = list[n-1][1];
var xx = list[n][0];
var yy = list[n][1];

if (n==0) {
x = list[0][0];
y = list[0][1];
}

deltaX = xx-x;
deltaY = yy-y;
rad = Math.atan2(deltaY,deltaX);
ang = (rad/Math.PI)*180;

if (yy<y) {
degree = (Math.abs(ang) - 90);
} else {
degree = (Math.abs(ang) - 90) * -1;
}

return roundToDecimal(degree,2);
}

function degToRad (d) {
return (d/180)*Math.PI;
}

function roundToDecimal (theNumber, decPlaces) {
if (decPlaces >= 0) {
var temp = Math.pow(10, decPlaces);
return Math.round(theNumber * temp)/temp;
}
}

function diff (r,s) {
return Math.abs(r-s);
}

function drawXY (listA,listB) {
//listA
_root.createEmptyMovieClip("path0",0);
_root.path0.lineStyle(10,0x000000,100);
_root.path0.moveTo(listA[0][0],listA[0][1]);

for (var j=1; j<listA.length; j++) {
_root.path0.lineTo(listA[j][0],listA[j][1]);
}

//listB
_root.createEmptyMovieClip("path1",1);
_root.path1.lineStyle(2,0xFF0000,100);
_root.path1.moveTo(listB[0][0],listB[0][1]);

for (var j=1; j<listB.length; j++) {
_root.path1.lineTo(listB[j][0],listB[j][1]);
}
}
//////////////////////////////////////////

Expanding Shrinking In Flash
Okay I have Flash MX and make flash things for my sites. I have always wondered, and wanted to know, how some ads I have seen do some things.

How does one make say a banner that can expand over its size or shrink. Or it starts huge, one clicks something, and it shrinks. I can't figure out how to do it. I was thinking for the smaller one just make the extra space see through, IDK, PLEASE HELP!!!

OOh I though of a better example. Some sites have flash movies that you can click to go to full screen more. (movies.aol.com uses this) I think this is a better explanation. Thank You

[F8] *** Enlarging And Shrinking Images In MC's And Buttons ***
Hey guys - When in doubt ask they say - well, I would appreciate if you have an answer to the festering problem I have right now!!

My question concerns the rolling (off) of a button. I have a movie clip in a button that makes an image grow larger when you roll over it. When you roll to the OVER position of the Button -

The Movie Clip in the button plays the movie of the image growing larger. My problem is that I do not know how to set it up so the image SHRINKS back to its normal state when you roll OFF of it. roll over... the image gets bigger - roll off... the image returns to its normal size.

Right now it just snaps back to its normal size without smoothly reducing itself to its up state within the button. Can you please show how to achieve this? I have had this posted now for about a week in one of the other forums and have no answer yet. My life will be so much better when I know how to do this.

As I am new to action script - does anyone have something already scripted that does this I can review to make my buttons work this way? I have about 30 different things to do this with in general andI need to get the principle down to achieve this. Many thanks in advance. RH

Shrinking Images Size With Illustrator...
Hi,

I got a flash movie which seems to be a little on the large size so i've started to have a look round and try and shrink some of the graphics.

The movie has several images in it which were created in photoshop and exported as a png8 file, which then is imported into the movie. the file size of the png8 is 99.4kb.

i've got illustrator cs2 but never really used it - cant i convert the image into a vector graphic to make the size smaller? problem is i dont know how - i've played around with the live trace option, but this created something 292kb in size.

anyone got some tips i could try?

[CS3/AS2] Shrinking/expanding Small AS Issue
I have a small but frustrating issue with my portfolio.
If you go to this link > www.onemorechris.co.uk < and click on the photo section, then click one of the items on the menu, it preloads an external SWF and expands on screen nicely, click again and the SWF unloads and shrinks back into place.

The issue is that if you try and click on the same item again, it doesnt perform the rollover,rollout or release functions. Only when you select another item does the first item "reset" itself and become clickable again.

Heres the offending blocks of code (please forgive my slopyness, i am a designer, not a developer):


PHP Code:



//this code is in the main swf#include "mc_tween2.as"import mx.transitions.Tween;import mx.transitions.easing.*;var mcs:Array = new Array (mc01,mc02,mc03,mc04, mc05, mc06, mc07, mc08, mc09, mc10);var titles:Array = new Array ("MC Skibadee at Digital, Brighton", "Crowds at Devotion, Brighton", "MC Bruno at Concorde 2, Brighton","Dubpressure, Concorde2, Brighton", "Slash and Velvet Revolver","Brandenburg Gate, Berlin 2008","Flower City LTD, 'Abandoned' series","Crypt doors, 'Abandoned' series");var ext:Array = new Array ("pic1.swf","pic2.swf","pic3.swf","pic4.swf", "pic5.swf", "pic6.swf", "pic7.swf", "pic8.swf", "pic9.swf", "pic10.swf");var mcl:MovieClipLoader = new MovieClipLoader();var listener:Object = new Object();//listener.onLoadStart= function (alvo:Object) {//alvo._parent.pct_txt.alphaTo(100,0.5)//};listener.onLoadProgress = function (preLoader:Object, bLoad:Number, bTotal:Number) {lProgress = Math.round (bLoad / bTotal * 100);_root.preLoader.gotoAndStop(2);_root.preLoader.preloaderText.text = lProgress;alignFunction();};listener.onLoadComplete = function (alvo:Object) {leftPanelTween = new Tween (_root.leftPanel, "_x", Regular.easeOut, _root.leftPanel._x, 48, 15, false);rightPanelTween = new Tween (_root.rightPanel, "_x", Regular.easeOut, _root.rightPanel._x, 264, 15, false);rightPanelTween2 = new Tween (_root.rightPanel, "_y", Regular.easeOut, _root.rightPanel._y, aligner, 15, false);mcs[itemSelecionado].fd_mc.tween(["_width","_height"],[748,497],0.5,"easeOutExpo")//pushes items down_root.preLoader.gotoAndStop(1);}; listener.onLoadError = function () {trace ("load error");};mcl.addListener (listener);//_global.fechaMenu = function() {for (var a=0; a<mcs.length; a++) {if (a != itemSelecionado) {// Selecionado = selected itemmcs[a].bt_mc.enabled = true;mcs[a].bt_mc.useHandCursor = true;mcs[a].titleMC._y = (mcs[a].fd_mc._height);mcs[a].fd_mc.tween(["_width","_height"],[120,80],1,"easeOutExpo")mcl.unloadClip(mcs[a].alvo_mc)}}}for (var a:Number = 0; a < mcs.length; a++) {mcs[a].a = a;mcs[a].titleMC.titleText.autoSize = "left";mcs[a].titleMC.titleText.text = titles[a];//mcs[a].bt_mc.onRollOver = function(){this._parent.fd_mc.tween(["_width","_height"],[150,100],0.3,"easeOutBack")_global.itemSelecionado = this._parent.a;}mcs[a].bt_mc.onRollOut = function(){this._parent.fd_mc.tween(["_width","_height"],[120,80],0.5,"easeOutBack")}mcs[a].bt_mc.onRelease = function(){    delete _root.the_arrow.onEnterFrame; //stops scrollingthis.enabled = this.useHandCursor = false//no ideamcl.loadClip(ext[this._parent.a],this._parent.alvo_mc)//loads swf from array into alvo_mcfechaMenu();_global.itemSelecionado = this._parent.a;}}




---------------------------------------------


PHP Code:



//this code is on a button in the external SWF that is loaded EG: pic1.swfon (release) {arrowScroller();reCenterPanels2();this._parent.fd_mc.tween(["_width","_height"],[120,80],0.5,"easeOutExpo")var mcl:MovieClipLoader = new MovieClipLoader();mcl.unloadClip(_parent.alvo_mc)//unloads alvo_mc    _global.itemSelecionado = this._parent._parent.a}




----------------------------------------------

Im pretty sure its a very small thing I've missed and I would really like some help.

Dynamically Growing/shrinking Grid?
I'd like to have a 3X3 grid that when a user clicks on a particular square on the grid, that square enlarges while the others shrink. Here's a brief illustration:

http://img183.imageshack.us/img183/8071/grid01ke9.gif

then clicked:

http://img85.imageshack.us/img85/632/grid02zy2.gif

I've seen this effect before, but I can't recall where. Is there a sample somewhere I could take a peek at?

Growing And Shrinking Buttons In Menu. How DO They Do It
A while back now I came across a website menu interface for a movie called talking with angels.

In brief, the menu was basically made up of 9 rectangular buttons arranged in a grid with small square dots lying at the corners of each of the 9 rectangles. When the mouse was over one of these buttons, the button would grow and the adjacent buttons would shrink proportionally.

The actual flash site can be viewed here

I took a stab in the dark, to the best of my knowledge, at trying and reproduce something similar but I have NO idea where to go.

Could someone please shed some light on how this was produced and possibly run me through making it. I'd be so grateful.

Copyright © 2005-08 www.BigResource.com, All rights reserved