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




Help With Basic AS Please - Dynamic Image Proportions



I am having trouble with a script that was purchased for a clients site, it draws thumbnails within a scroller component. I need the images to be aligned x and y axis differently based on whether they are portrait (29px H) or landscape (122px H). I have tried if and else statements to no avail :confused; What currently sets layout of thumbs:curMC._x=myCol*(curMC._width+50);curMC._y=myRow*(curMC._height+80);Start of code////////////////////// function createClip(i){ skin = "0"; var attachWhat:String = (useThumbnails=="true") ? "skin"+skin+"_thumbnail" : "skin"+skin+"_galItem"; thumbLoader.content.attachMovie(attachWhat,"gal"+i ,i); var curMC:MovieClip = thumbLoader.content["gal"+i]; curMC._alpha=0; if(useThumbnails=="true"){ var imageStuff:Array = String(myArray[i][0]).split("/"); var myThumb:String = curGalDir+"/thumbs/"+(imageStuff[imageStuff.length - 1]); curMC.image_mc.loadMovie(myThumb); var tmpMC:MovieClip = curMC._parent.createEmptyMovieClip("tmp"+i, i+10000); tmpMC.onEnterFrame=function(){ if((curMC.image_mc.getBytesLoaded()==curMC.image_m c.getBytesTotal())&&curMC.image_mc.getBytesTotal() >50){ curMC.image_mc._x-=(curMC.image_mc._width/2); curMC.image_mc._y-=(curMC.image_mc._height/2); delete this.onEnterFrame; } } } curMC.current_mc._alpha=0; curMC.i = i; animateIn(curMC, 100, "_alpha", 30); curMC.myImage=myArray[i][0]; curMC.i=i; curMC._x=myCol*(curMC._width+50); curMC._y=myRow*(curMC._height+80); var colMax:Number = (useThumbnails=="true") ? columns_thumbs : columns_no_thumbs ; if(myCol==colMax)myRow++; myCol=(myCol<colMax)? myCol+1 : 0; curMC.onRollOver=function() { if(galEnabled!=0)animateIn(this.btn1_mc, 15, "frame", 15); } curMC.onRollOut=function() { if(galEnabled!=0)animateOut(this.btn1_mc, 0, "frame", 15); } curMC.onRelease=function(){ if(galEnabled!=0){ picClick=1; if(currentMC!=this){ animateOut(currentMC.current_mc, 0, "_alpha", 30); currentMC=this; animateIn(currentMC.current_mc, 100, "_alpha", 30); } whichPic = this.i; setFrame(); this.photoSelected1_mc._visible = true; animateIn(this.photoSelected1_mc, 100, "_alpha", 15); } } if(i==myLength-1){ galleryCombo.enabled=true; setFrame(); var galleryWait_int=setInterval(checkWait, 500); } thumbLoader.size(); clearInterval(gallery["myInt"+i]); }



KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 02-11-2005, 01:46 AM


View Complete Forum Thread with Replies

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

Help With Basic AS Please - Dynamic Image Proportions
I am having trouble with a script that was purchased for a clients site, it draws thumbnails within a scroller component. I need the images to be aligned x and y axis differently based on whether they are portrait (29px H) or landscape (122px H). I have tried if and else statements to no avail :confused;

What currently sets layout of thumbs:

curMC._x=myCol*(curMC._width+50);
curMC._y=myRow*(curMC._height+80);


Start of code
//////////////////////

function createClip(i){
skin = "0";
var attachWhat:String = (useThumbnails=="true") ? "skin"+skin+"_thumbnail" : "skin"+skin+"_galItem";
thumbLoader.content.attachMovie(attachWhat,"gal"+i ,i);
var curMC:MovieClip = thumbLoader.content["gal"+i];
curMC._alpha=0;
if(useThumbnails=="true"){
var imageStuff:Array = String(myArray[i][0]).split("/");
var myThumb:String = curGalDir+"/thumbs/"+(imageStuff[imageStuff.length - 1]);
curMC.image_mc.loadMovie(myThumb);
var tmpMC:MovieClip = curMC._parent.createEmptyMovieClip("tmp"+i, i+10000);
tmpMC.onEnterFrame=function(){
if((curMC.image_mc.getBytesLoaded()==curMC.image_m c.getBytesTotal())&&curMC.image_mc.getBytesTotal() >50){
curMC.image_mc._x-=(curMC.image_mc._width/2);
curMC.image_mc._y-=(curMC.image_mc._height/2);
delete this.onEnterFrame;
}
}
}
curMC.current_mc._alpha=0;
curMC.i = i;
animateIn(curMC, 100, "_alpha", 30);
curMC.myImage=myArray[i][0];
curMC.i=i;
curMC._x=myCol*(curMC._width+50);
curMC._y=myRow*(curMC._height+80);
var colMax:Number = (useThumbnails=="true") ? columns_thumbs : columns_no_thumbs ;
if(myCol==colMax)myRow++;
myCol=(myCol<colMax)? myCol+1 : 0;
curMC.onRollOver=function() {
if(galEnabled!=0)animateIn(this.btn1_mc, 15, "frame", 15);
}
curMC.onRollOut=function() {
if(galEnabled!=0)animateOut(this.btn1_mc, 0, "frame", 15);
}
curMC.onRelease=function(){
if(galEnabled!=0){
picClick=1;
if(currentMC!=this){
animateOut(currentMC.current_mc, 0, "_alpha", 30);
currentMC=this;
animateIn(currentMC.current_mc, 100, "_alpha", 30);
}
whichPic = this.i;
setFrame();
this.photoSelected1_mc._visible = true;
animateIn(this.photoSelected1_mc, 100, "_alpha", 15);
}
}
if(i==myLength-1){
galleryCombo.enabled=true;
setFrame();
var galleryWait_int=setInterval(checkWait, 500);
}
thumbLoader.size();
clearInterval(gallery["myInt"+i]);
}

Help With Basic AS Please - Dynamic Image Proportions
I am having trouble with a script that was purchased for a clients site, it draws thumbnails within a scroller component. I need the images to be aligned x and y axis differently based on whether they are portrait (29px H) or landscape (122px H). I have tried if and else statements to no avail :confused;

What currently sets layout of thumbs:

curMC._x=myCol*(curMC._width+50);
curMC._y=myRow*(curMC._height+80);


Start of code
//////////////////////

function createClip(i){
skin = "0";
var attachWhat:String = (useThumbnails=="true") ? "skin"+skin+"_thumbnail" : "skin"+skin+"_galItem";
thumbLoader.content.attachMovie(attachWhat,"gal"+i ,i);
var curMC:MovieClip = thumbLoader.content["gal"+i];
curMC._alpha=0;
if(useThumbnails=="true"){
var imageStuff:Array = String(myArray[i][0]).split("/");
var myThumb:String = curGalDir+"/thumbs/"+(imageStuff[imageStuff.length - 1]);
curMC.image_mc.loadMovie(myThumb);
var tmpMC:MovieClip = curMC._parent.createEmptyMovieClip("tmp"+i, i+10000);
tmpMC.onEnterFrame=function(){
if((curMC.image_mc.getBytesLoaded()==curMC.image_m c.getBytesTotal())&&curMC.image_mc.getBytesTotal() >50){
curMC.image_mc._x-=(curMC.image_mc._width/2);
curMC.image_mc._y-=(curMC.image_mc._height/2);
delete this.onEnterFrame;
}
}
}
curMC.current_mc._alpha=0;
curMC.i = i;
animateIn(curMC, 100, "_alpha", 30);
curMC.myImage=myArray[i][0];
curMC.i=i;
curMC._x=myCol*(curMC._width+50);
curMC._y=myRow*(curMC._height+80);
var colMax:Number = (useThumbnails=="true") ? columns_thumbs : columns_no_thumbs ;
if(myCol==colMax)myRow++;
myCol=(myCol<colMax)? myCol+1 : 0;
curMC.onRollOver=function() {
if(galEnabled!=0)animateIn(this.btn1_mc, 15, "frame", 15);
}
curMC.onRollOut=function() {
if(galEnabled!=0)animateOut(this.btn1_mc, 0, "frame", 15);
}
curMC.onRelease=function(){
if(galEnabled!=0){
picClick=1;
if(currentMC!=this){
animateOut(currentMC.current_mc, 0, "_alpha", 30);
currentMC=this;
animateIn(currentMC.current_mc, 100, "_alpha", 30);
}
whichPic = this.i;
setFrame();
this.photoSelected1_mc._visible = true;
animateIn(this.photoSelected1_mc, 100, "_alpha", 15);
}
}
if(i==myLength-1){
galleryCombo.enabled=true;
setFrame();
var galleryWait_int=setInterval(checkWait, 500);
}
thumbLoader.size();
clearInterval(gallery["myInt"+i]);
}

Help With Basic AS Please - Dynamic Image Proportions
I am having trouble with a script that was purchased for a clients site, it draws thumbnails within a scroller component. I need the images to be aligned x and y axis differently based on whether they are portrait (29px H) or landscape (122px H). I have tried if and else statements to no avail :confused;

What currently sets layout of thumbs:

curMC._x=myCol*(curMC._width+50);
curMC._y=myRow*(curMC._height+80);


Start of code
//////////////////////

function createClip(i){
skin = "0";
var attachWhat:String = (useThumbnails=="true") ? "skin"+skin+"_thumbnail" : "skin"+skin+"_galItem";
thumbLoader.content.attachMovie(attachWhat,"gal"+i ,i);
var curMC:MovieClip = thumbLoader.content["gal"+i];
curMC._alpha=0;
if(useThumbnails=="true"){
var imageStuff:Array = String(myArray[i][0]).split("/");
var myThumb:String = curGalDir+"/thumbs/"+(imageStuff[imageStuff.length - 1]);
curMC.image_mc.loadMovie(myThumb);
var tmpMC:MovieClip = curMC._parent.createEmptyMovieClip("tmp"+i, i+10000);
tmpMC.onEnterFrame=function(){
if((curMC.image_mc.getBytesLoaded()==curMC.image_m c.getBytesTotal())&&curMC.image_mc.getBytesTotal() >50){
curMC.image_mc._x-=(curMC.image_mc._width/2);
curMC.image_mc._y-=(curMC.image_mc._height/2);
delete this.onEnterFrame;
}
}
}
curMC.current_mc._alpha=0;
curMC.i = i;
animateIn(curMC, 100, "_alpha", 30);
curMC.myImage=myArray[i][0];
curMC.i=i;
curMC._x=myCol*(curMC._width+50);
curMC._y=myRow*(curMC._height+80);
var colMax:Number = (useThumbnails=="true") ? columns_thumbs : columns_no_thumbs ;
if(myCol==colMax)myRow++;
myCol=(myCol<colMax)? myCol+1 : 0;
curMC.onRollOver=function() {
if(galEnabled!=0)animateIn(this.btn1_mc, 15, "frame", 15);
}
curMC.onRollOut=function() {
if(galEnabled!=0)animateOut(this.btn1_mc, 0, "frame", 15);
}
curMC.onRelease=function(){
if(galEnabled!=0){
picClick=1;
if(currentMC!=this){
animateOut(currentMC.current_mc, 0, "_alpha", 30);
currentMC=this;
animateIn(currentMC.current_mc, 100, "_alpha", 30);
}
whichPic = this.i;
setFrame();
this.photoSelected1_mc._visible = true;
animateIn(this.photoSelected1_mc, 100, "_alpha", 15);
}
}
if(i==myLength-1){
galleryCombo.enabled=true;
setFrame();
var galleryWait_int=setInterval(checkWait, 500);
}
thumbLoader.size();
clearInterval(gallery["myInt"+i]);
}

XML - Resizing Dynamic Image Whilst Maintaining Proportions
Hi,

I have an issue with dynamically loading a picture into Flash from an XML file. What I want to happen is for the image (defined in my xml) to load into a text box or mc with a max height of say 100 px whilst maintaining its proportions. I have looked through other threads and found related topics but can't really make sense of them.

Any help would be gratefully received!

Cheers,

Ben

HELP PLEASE - Correcting Image Proportions When Loaded Into A Target
I downloaded an image gallery template off flashkit. It is great except when your images load into the target, they distort to fit the rectangular shape of the target. Is there a way to get them to load in their original and correct proportions, so they are not distorted?
Note: the file was just a little too big to attach here...I don't know how to make it any smaller without compromising the template.

Thanks in advance...

Basic Image View Not Dynamically Loading Image URL
What I have done Is added only a List Component to the stage and named it "lb". Then I'm Dynamically loading the data and label attributes from an external XML file. Now, I am Listening for the change event on 'lb" in order to create a new url request from the data property of the selected 'lb' item. Unfortunately, I am recieving this error message.

1067: Implicit coercion of a value of type flash.net:URLLoader to an unrelated type flash.display:DisplayObject.

Code:

var loader:URLLoader = new URLLoader();
var xml:XML;
var imgLoader:URLLoader;

loader.load(new URLRequest("http://www.xxxxxxx.com/Pictures.xml"));
loader.addEventListener(Event.COMPLETE, onLoaded);
lb.addEventListener(Event.CHANGE, itemChange);


// Loads XML data into List Component LB
function onLoaded(e:Event):void{
   xml= new XML(e.target.data);
   var il:XMLList = xml.Album[0].image;
   for(var i:uint=0; i<il.length(); i++){
      lb.addItem({data:il.attribute("url")[i],
               label:il.attribute("title")[i]});
   }
}

//Passes String used for URL
function loadImage(url:String):void{
   imgLoader = new URLLoader();
   imgLoader.load(new URLRequest(url));
   imgLoader.addEventListener(Event.COMPLETE, imageLoaded);
}

//Creates Sprite from image url passed through loadImage
function imageLoaded(e:Event):void{
   var image:Sprite = new Sprite();
   image.width = 200;
   image.height = 400;
   image.x = 200;
   image.y = 10;
   image.addChild(imgLoader);
}

//OnChange .selected item passes URL String to LoadImage
function itemChange(e:Event):void{
   loadImage(lb.selectedItem.data);
}
   

I'll admit I'm still a little new at this but I was thinking that URLRequest only need a String value wich I should be getting from "lb.selectingItem.data.toString()... atleast thats what it has been tracing. Any help is welcomed and thanks in advance.

Animated Masking A Dynamic Image Is Causing Dynamic Image To Disappear Intermedently.
You can find the file here of what I am trying to do:
http://www.yourfilelink.com/get.php?fid=462218

Please tell me if you are having problems downloading it.

This has always irritated me and I can't seem to find a way around it.

I dynamically load an image to a movie instance and the movie instance is masked. The masking is animation on it, so that it looks like the image is animated via masking. It works if the masking animation is one long shape motion tween, but if I make the masking animation frame by frame, the image being masked disappears and reappears only when it is a long shape tween of the mask.

Please refer to the downloadable sample to understand what I mean. Is there a way around this?

I have seen page flip samples that is able to do what I am trying to do, but they used really advanced actionscripting to do this. I am using timeline.

Basic Image Gallery
im trying to do a very basic galler exactly like this one http://www.squarerootdesigns.com/weddings.swf (click on gallery) can anyone please recommend a tut or offer any assistance?

Basic Image Presentation.
I am looking for a tutorial or source in MX 2004 for something like this.

http://www.innerguidancemovie.com/

I know this is probably very basic. Perhaps loading images from disk.

What would you call this type of movie if searching on it. I have tried searching using several strings and nothing comes up.

Thanks

Basic XML Text And Image
Hi guys

I'm a late xml learner. Right now I'm experimenting in using xml. The idea is that i need a simple news feed. Some text than a small image. I've created a movieclip "article_item" which holds all the data. For now i managed to get the text working. But i can't handle the images. Suggestions are more than welcome. I'm totally new to these things.

Here is the xml:


Code:
<?xml version="1.0" encoding="UTF-8"?>
<site>
<articles>
<article date="JUNE 2008" thmb="news.jpg" info="Lorem ipsum dolor sit ame"/>

<article date="JUNE 2008" thmb="news.jpg" info="Lorem ipsum dolor sit ame"/>

<article date="JUNE 2008" thmb="news.jpg" info="Lorem ipsum dolor sit ame"/>
</articles>
</site>

and here is the AS2:


Code:
var XMLurl:String = "data2.xml";
var XMLdata:XML = new XML();
XMLdata.ignoreWhite = true;
XMLdata.onLoad = function(safe:Boolean) {
if (safe)
readXML(this);
else
trace("XML read error!");
}
XMLdata.load(XMLurl);


//
function readXML(xml:XML):Void {

var articles:XMLNode = xml.firstChild.childNodes[0];

for (i:Number = 0; i < articles.childNodes.length; i++) {
var article:XMLNode = articles.childNodes[i];
var articleItem:MovieClip = this.attachMovie("article_item", "mc_item" + i, i);

articleItem.txt_date.text = article.attributes["date"];
articleItem.txt_info.text = article.attributes["info"];
articleItem._y = (i * 90);
}
}
Cheers Guys
Etienne

Basic Image / Comment System...
I am fairly new to CGI and scripting, so any help is greatly apprecieated!

I am just trying to have a simple comment system where anyone who visits my site can comment on my photographs. I do not want them to have to log in, or anything like that. My web host supports cgi, but I honestly have no idea where to start.

And this does not have to be done in flash, while I would prefer it to be since everything but the splash is going to be in flash..I would still be willing to have like a pop-up html box or something simple where visiters can type what they want to say, and have it be posted under the image or something..

..again, any advice is much apprecieated

`antilimit

Basic Scrolling Text/Image Box?
Hi,

I want to make a scroll box to show text or images, and I want to have a sliding button that you can click and drag to scroll the text/images vertically, what is the easiest way to do this?

I thought one way might be to do a motion tween on the text, sliding the text from it's starting point in frame 1, to its ending point in frame 10, and somehow moving the button would move you forwards and backwards through the timeline?

The graphics part isn't a problem, but if anyone could help with the coding that would be great! It needs to be customisable for different size boxes etc, thanks!!

Basic Trigonometry: Flipping An Image Around A Y-axis. ?
Hi,

I have this code that rotates an object (a square) around a y axis.

Code:
onClipEvent (load) {
radius = 100;
speed = 5;
xcenter = 275;
zcenter = 100;
angle = 0;
fl = 100;
}
onClipEvent (enterFrame) {
z = Math.sin(angle*Math.PI/180)*radius+zcenter;
scale = fl/(fl+z);
_x = Math.cos(angle*Math.PI/180)*radius+xcenter;
_xscale = _yscale = scale*100;
angle += speed;
}
The problem is that I want the object to flip around as it goes around the radius (so that the user will see the reverse side of the square). I've tried using -Math.sin() but it's not perfect.

Please help a Math dropout. Thanks for your help.

Putting A Basic Countdown Timer In Image
i am very new to flash, what i wanted to do was put a countdown timer in these images, what i really wanted also was to have them rotate, from one to the other, and have the countdown in there, til Oct 16 2007

how difficult is that? i have no real experiance with flash

thanks!

Basic Flash - Mouseover, Still Image & New Swf Reload
ok .. i'm new to flash. i'm looking for someone to point me in the right direction .. basically to tell me what i need to do to accomplish this .. i can dig for the info from there.

i'm looking to duplicate this type of flash : http://musee.louvre.fr/visite-louvre/index.html?defaultView=entresol.s489.p01&lang=ENG

i need to be able to:

1.) click on a hotspot/mouseover and bring up a still image(just like the sample shown)

2.) click on a different hotspot to reload the flash file to a different flash file(while staying on the same html page..just like the sample shown)

3.) create an interactive map as shown on the bottom.

thanks in advance,

Need Basic Photo Gallery, Which Gets Image Links From Xml
Hi I need to make a basic photo gallery.
One like this:
http://chopper-cars-towbin-dodge.ebi...&src=eBizAutos

Main mc in on the top and 6 or so thumbnails on the bottom. Clicking on thumbnails updates the mc on the top. I need to make actionscript to get the address of images and thumbnail from an .xml file.
I just started working with actionscript. kirupa.com helps a lot i search through forums which helps a lot, so far I haven't found anything, if you know a link that would be of help also please reply, thank you


I need action script to fetch adress through an xml, like below, and display them in thumbnails and when user clicks on thumbnail larger image loads above in a mc,
kind of like here
http://chopper-cars-towbin-dodge.ebi...&src=eBizAutos

<car1>
<image>vehicles/02bmwz4.jpg</image>
<tm>vehicles/02bmwz4_tm.jpg</tm>
</car1>

thank you in advance

Pixelangry says: "Wow. Demanding?"

hey sorry if it sounds like that.
If you know something and you are willing to share. Please help.
Isn't that what forums are for?

Proportions
Ok here's the layout. I'm attempting to make a website where if you click on links new boxes come up. With these new boxes I want there to be a corner to make things bigger. I gues what I'm asking for is a script to make an interactable transform, but only allowing it to become wider and taller.


I've been searching for a little bit, but I cant find exactly what im looking for.

Thanks before hand,

Antivirus

Keep Swf Proportions
Hi friends.
I use to specify both width and height when embedding a flash movie in html pages.
Now I need to make a flash movie stretch to 100% of the containing <div> restricting proportions so the movie doesn't result distorted.
When you set an image width in the <img /> tag (or thru CSS) and omit the height, the image gets resized to the stated value keeping its proportions, and the same when the height is set and the width ommited.
Embedded objects seem to behave different. I've tried omitting the height parameter, setting it to "auto" and then to "100%". In each case the movie proportions has not been honored, nor I've got consistent results across browsers (currently just FF2 / IE7 tested).
I've also tried the four available values for Stage.scaleMode (showAll, noBorder, exactFit, noScale) but without luck.
I'll appreciate some advice from the experts out there.
Thanks a lot

Basic Flashvar Image Loader, Not Working In Firefox?
Hi guys and girls,

I'm quite a novice when it comes to flash so bare with me. I have a site i'm developing, on the homepage I created with ASP a image randomizer. Nothing complicated it just reads from a folder, then displays an image. This was working great, then i though it would look nice if their was a flash alpha fade. I found an example of how to load a jpg into a flash movie via Flashvars.


I modified the example movie and it worked great in Internet Explorer. However in Firefox, Netscape, Opera I can just see the Flash and no image loads, it just sits there and says its loading data. Here is the actionscript for the flash movie:


// Initialize the loader class
var imgLoader = new MovieClipLoader();
// Create, place, and hide an empty movieclip to hold the image
//this.createEmptyMovieClip("imageHolder_mc", this.getNextHighestDepth());
imageHolder_mc._x = 0;
imageHolder_mc._y = 0;
imageHolder_mc._alpha = 0;
greenbar_mc._alpha = 0;
// When the image is finished loading, fade it in
imgLoader.onLoadInit = function(targetMC) {
_root.onEnterFrame = function() {
targetMC._alpha += 3;
if (targetMC._alpha>=100) {
targetMC._alpha = 100;
delete this.onEnterFrame;
}
};
greenbar_mc._alpha = 100;
};
//
// Load the image in to the new movieclip
imgLoader.loadClip(imageName,imageHolder_mc);

Here is the HTML that loads the flash movie:

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="600" height="329" id="headerImage">

<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="/headerImage.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#FFFFFF" />
<param name="flashvars" value='imageName=/_images/rotators/1.jpg' />
<embed src="/headerImage.swf" flashvars=imageName='/_images/rotators/1.jpg' quality="high" bgcolor="#FFFFFF" width="600" height="329" name="headerImage" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>

As I mentioned this all works great in IE, just not any other browser.

Any ideas what i need to do? I'm a novice to Flash so please go easy on me. Would some sort of preloader help?

Here is the example that i used:

http://www.emllabs.com/article.php?articleId=113

Thanks

James

Resizing/Proportions
Hi guys. I'm having problems keeping my published swf in proportion when resizing. It resizes, but I can stretch it out horizontally and it loses all proportion - images are stretched. Same applies if I stretch it vertically.

I want to be able to keep the same proportions so images aren't affected.

Publish settings are Dimensions - Percent 100x100, Scale Exact Fit. HTML below.

So what is it that I'm doing wrong?

Cheers.

---------------
<HTML>
<HEAD>
<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
<TITLE>index</TITLE>
</HEAD>
<BODY bgcolor="#FFFFFF"
marginheight="0"
marginwidth="0"
leftmargin="0"
rightmargin="0"
topmargin="0"
bottommargin="0">
<OBJECT classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
WIDTH="100%" HEIGHT="100%" id="index" ALIGN="">
<PARAM NAME=movie VALUE="index.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=scale VALUE=exactfit> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="index.swf" quality=high scale=exactfit bgcolor=#FFFFFF WIDTH="100%" HEIGHT="100%" NAME="index" ALIGN=""
TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>
</OBJECT>
</BODY>
</HTML>

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

Proportions In Symbols?
Why is it that when I try to move a symbol from inside a MC to the main timeline it gets much bigger and won't stay at the same place even though I use "paste in place"?

...probably a newbie question...

Constrain Proportions
is there a way to constrain the porpotions when sizing something in the properties window...so you can {for instance} type in a height and the pic will change without screwing up the, well, proportions...
xxxjosh

Changing The Proportions Of An MC
Is there an actionscript in Flash 5 which could change the proportion of an MC aswell as the positioning on the canvas?

I've attached a simulation .Fla - hopefully should make it clearer

http://www.liquid-visual.com/A2B.fla

Please help me out if you have a few spare moments!

Thanks!

Resize With Proportions
Hi
I am trying to make an image/mc inside a movie resize proportionally to the image and not to the stage when the window is resizing in limited area [lets say when the window is smaller the 1024px and bigger the 600] here is the code that i am useing, but I am not sure how to make the image scale without loosing the original proportions

//positioning the background clip to fit the screen
Stage.scaleMode = "noScale";
Stage.align = "LT";
bg.onResize = function() {
this._width = Stage.width;
this._height = Stage.height;
};
Stage.addListener(bg);
bg._x = bg._y = 0;
bg.onResize();

//positioning the image to the center
content.onResize = function() {
this._x = (Stage.width-760)/2;
this._y = (Stage.height-540)/2;
};
Stage.addListener(content);
content.onResize();
stop();

thanks
-A

Constrain MC Proportions?
Hi all i'm having some trouble using FLV video if anyone can help

I have a swf file that uses the media display component to load an flv video. I want to display the swf in a browser and allow it to be scaleable except for the video. is there a way to constrain the flv video and allow everything else to scale? or at least constrain the proportion of the x,y in the flv? any help is much appreciated.

T

Constrain MC Proportions?
Hi all i'm having some trouble using FLV video if anyone can help

I have a swf file that uses the media display component to load an flv video. I want to display the swf in a browser and allow it to be scaleable except for the video. is there a way to constrain the flv video and allow everything else to scale? or at least constrain the proportion of the x,y in the flv? any help is much appreciated.

T

Resizing With Proportions
I want to resize an image only specifying the height

image.height = 40

and I want to keep the proportions by automatically resizing the width.

Can i do this with acitonscript ?

Video Proportions
hi i have soem standard videos of normal 4:3 ratio and then soem widescreen video but i need the same played to play both..

so how do i change the code below so that it doesnt squash the widescreen video

Code:


//querystring
var videoid:String = new String();
videoid = vidId;


//stream connection
var nc:NetConnection = new NetConnection();
//tellign flash were not using a stremer
nc.connect(null);
var ns:NetStream = new NetStream(nc);
vid.attachVideo(ns);
//hide everything
bufferscreen._visible = true;
playlistslide._visible = false;
urlview._visible = false;
poweredby._visible = false;
poweredby._visible = false;
loadingScreen._visible = false;
playbigbal._visible = false;


ns.setBufferTime(10);
var finishedplay;
ns.onStatus = function(info)
{
   if(info.code == "NetStream.Buffer.Full")
   {
      bufferscreen._visible = false;
   }
   if(info.code == "NetStream.Buffer.Empty")
   {
      bufferscreen._visible = true;
   }
   if(info.code == "NetStream.Play.Stop")
   {
      //when finsihed playing function   
      ns.seek(0);
      ns.pause();
   }
}
                 

playbigbal.bigb.onRelease = function()
{
   ns.play(playlistslide.playlist.getItemAt(playlistslide.playlist.selectedIndex).data);
   loadingScreen._visible = true;
   playbigbal._visible = false;
   
   playbutton.gotoAndStop("pause");   
}
rewindbutton.onRelease = function()
{
   ns.seek(0);
};


playbutton.onRollOver = function() {
   if(this._currentframe == 1)
   {
      this.gotoAndStop("playOver");
   }
   else
   {
      this.gotoAndStop("pauseOver");
   }
}

playbutton.onRollOut = function()
{
   if(this._currentframe == 5)
   {
      this.gotoAndStop("play");
   }
   else
   {
         if(this._currentframe == 1)
            {
                  this.gotoAndStop("play");
            }
         else
         {
            this.gotoAndStop("pause");
         }
     
   }
}

playbutton.onRelease = function() {
   if(this._currentframe == 5)
   {
      this.gotoAndStop("pause");
      ns.pause();
   }
   else
   {
      this.gotoAndStop("play");
      ns.pause();
   }
}

var videoInterval = setInterval(videoStatus, 100);
var amountLoaded:Number;
var duration:Number;
ns["onMetaData"] = function (obj)
{
   duration = obj.duration;
};

var barPos;
function videoStatus()
{
   amountLoaded = ns.bytesLoaded / ns.bytesTotal;
   loader.loadbar._width = (amountLoaded * 200);
   loader.scrub._x = ((ns.time / duration) * 200);
   loader.scrubbar._width = (loader.scrub._x);
   barPos = setInterval(scrubBarpos, 10);
   var curMin:Number = Math.floor(ns.time/60)
   var curSec;
   if((((ns.time/60)%1)*60) <10)
   {
      curSec = "0" + Math.floor(((ns.time/60)%1)*60);
   }
   else
   {
     curSec = Math.floor(((ns.time/60)%1)*60);
   }
   var totMin:Number = Math.floor(duration/60)
   var totSec;
   if(duration == null)
   {
      totMin = 0;
      totSec = "00";
   }
   else
   {
      if((((duration/60)%1)*60) <10)
            {
               totSec = "0" + Math.floor(((duration/60)%1)*60)
            }
         else
            {
              totSec = Math.floor(((duration/60)%1)*60)
            }
   }
   var origTime:Number = ns.time;
   
dispTot.text = totMin + ":" + totSec;
   dispCur.text = curMin + ":" + curSec;
   
   
};

function scrubBarpos()
{
   loader.scrubbar._width = (loader.scrub._x);
}
var scrubInterval;
loader.scrub.onPress = function()
{
   clearInterval(videoInterval);
   scrubInterval = setInterval(scrubit, 10);
   this.startDrag(false, 0, this._y, 180, this._y);
   barPos = setInterval(scrubBarpos, 10);
};
loader.scrub.onRelease = loader.scrub.onReleaseOutside = function ()
{
   clearInterval(scrubInterval);
   videoInterval = setInterval(videoStatus, 100);
   this.stopDrag();
};
function scrubit()
{
   ns.seek(Math.floor((loader.scrub._x / 180) * duration));
};

//volume
_root.createEmptyMovieClip("vSound",_root.getNextHighestDepth());
vSound.attachAudio(ns);
var so:Sound  = new Sound(vSound);

so.setVolume(75);
var volInterval
vslide.vscrub.onPress = function()
{
   this.startDrag(false,0,this._y,80,this._y);
   volInterval = setInterval(volumeit, 10);
};


vslide.vscrub.onRelease = vslide.vscrub.onReleaseOutside = function()
{
   this.stopDrag();
};

function volumeit()
{
   so.setVolume(Math.floor((vslide.vscrub._x / 80)*100));
};

//xml read
var vread:XML = new XML();
vread.ignoreWhite = true;

var urls:Array =  new Array();
var disp:Array =  new Array();
var pic:Array =  new Array();
var playurl:String = new String();

vread.onLoad = function ()
{
   var vdata:Array = this.firstChild.childNodes;
   for (i=0;i<vdata.length;i++)
   {
      playlistslide.playlist.addItem(vdata[i].attributes.desc,vdata[i].attributes.url);
   };
   ns.play(vdata.getItemAt(0).data);
   playlistslide.playlist.selectedIndex = 0;
   ns.play(playlistslide.playlist.getItemAt(playlistslide.playlist.selectedIndex).data);
   loadingScreen._visible = true;
   playbutton.gotoAndStop("pause");
   
};

var vidList:Object = new Object();

vidList.change = function ()
{
   ns.play(playlistslide.playlist.getItemAt(playlistslide.playlist.selectedIndex).data);
   playlistslide._visible = false;
};

playlistslide.playlist.addEventListener("change",vidList);
var vdir = "media/dataAccess.aspx?vidid=" + videoid;
vread.load(vdir);

//video messages
var menuitems:ContextMenu = new ContextMenu();
menuitems.hideBuiltInItems();
_root.menu = menuitems;

var poweredby:ContextMenuItem = new ContextMenuItem ("Powered by Decode Studios",trace,true);
//menuitems.customItems[0] = poweredby;

Resizing, But Keeping Proportions
here's the situation:
i have an MC that is in-effect imitating a Mac OS window. however, the content is all text, saved as a grapgic symbol. i want the text (contentMC) to scale with the window, but i don't want its proportions to be distorted. is there a way that i can make an object scalable and at the same time maintain its proportions?

100% Flash Fill With Proportions
I visited the following website - http://www.thetouchagency.co.uk/ - and saw that they had a flash movie that filled 100% of the window, but didn't stretch the elements within it, such as the text and the clock graphic and even the background image.

In other words it is as though it was created using html and tables, where there is simply a background image behind text that is anchored to one corner, and even if you stretch the window the text remains in its position and the large background image just continues to fill the window.

I've been working with flash for a few years now and this has always eluded me. I have searched for tutorials but with no success.

I believe that it requires actionscript in the movie rather than html in the browser window. Any help on this problem would be enormously appreciated.

Jake Astor

Full Scale Proportions
IŽm not a programmer in flash, but now my way around. However I like some help to scale images in fullscreen without distorting the image. Please

check http://www.subdisc.com for reference.

Can anyone help make a prepreped flash file?

ThanX aŽlot

MC Resize And Constrain Proportions
does anyone have an equation for resizing mc and constraining the prooprtions also.. through AS

Auto Adjust And Keep Proportions
Hi,

Does anybody knows how to auto adjust flash to the size of the window but preserving the size of the objects in the movie?.

These are two fantastic examples of that:

http://www.musicalarchitect.com/
http://www.mocafusion.com/

(try to resize the window and look how the objects adjust to the new size of the window)

I hope someone knows how to archive that.

Thanks

HOW TO 'constrain Movie's Proportions'?
Hi,

It's me with the silly questions again.

Does anyone know a quick way (actually anyway that is right) to contrain the proportions of a flash movie?

Basically, the content is 760x420 and the background is black. This will be made into an EXE (its a demo). I want the content to stay the same size (bitmaps being scaled up = very ugly), but the window can expand. When the window is expanded ity should only reveal the bg color, the stuff inside HAS to stay the same size. Does that make sense?

Please help if you can, I would really appreaciate it. In the meantime, I will be searching for the answer online.

THANKS!

Constrain Proportions Issue
This might be a totally ridiculous question to some, but bear with me.

Ok, here it goes...

Im creating some stuff that'll eventually have to be burned onto a CD. So I'll have to create a projector.
BUT, here's the thing...I want it so that when this series of movies starts to play in a window, even though it (the window) can be resized by the user, the content must always stay at 600x800.


I know this is possible, but have no idea how...HELP ME please!

[as 1] Constraining Proportions While Scaling
I'm creating a drag'n'drop scene for kids and would like to know if anyone can give me a hint as to how to make my scaling handle constrain proportions while scaling a movie clip. I would like to restrict the user from stretching or squashing the art.

Hopefully my code will explain the simple setup i am using to test this


ActionScript Code:
//create array
items=new Array();
 
//load item
scaler1_mc.itemHolder_mc.attachMovie("elf","item_mc",1);
 
//drop item in array
items[1]=scaler1_mc.itemHolder_mc.item_mc;
 
//place item at 0,0
items[1]._x=0;
items[1]._y=0;
 
//record item's initial width and height
items[1].initWidth=items[1]._width;
items[1].initHeight=items[1]._height;
 
//size outline to item
scaler1_mc.outline_mc._width=items[1]._width;
scaler1_mc.outline_mc._height=items[1]._height;
 
//place handle on top right corner of item
scaler1_mc.handle_mc._x=items[1]._width;
scaler1_mc.handle_mc._y=-items[1]._height;
 
//setup Handle
scaler1_mc.handle_mc.onPress=function(){
    xLowerLimit=items[1].initWidth/2;
    xUpperLimit=items[1].initWidth*2;
    yLowerLimit=-items[1].initHeight/2;
    yUpperLimit=-items[1].initHeight*2;
   
    startDrag(this,true,xLowerLimit,yLowerLimit,xUpperLimit,yUpperLimit);
    this.onEnterFrame=function(){
        //update widths and heights of outline and item
        this._parent._parent.items[1]._width=this._x;
        this._parent._parent.items[1]._height=-this._y;
        this._parent.outline_mc._height=-this._y;
        this._parent.outline_mc._width=this._x;
    }
}
scaler1_mc.handle_mc.onRelease=function(){
    stopDrag();
    delete this.onEnterFrame;
}
scaler1_mc.handle_mc.onReleaseOutside=function(){
    stopDrag();
    delete this.onEnterFrame;
}


So far this scales the art perfectly within my desired limits, excepting of course the "constraining proportions" bit...almost there

oh and any better coding practices are appreciated as well

Help Constraining Published Movie Proportions
In the Publish Settings Dialogue, under the HTML tab, how can I lock the proportions of my movie but still have it set to the flexible percentage setting and not the Match Movie setting?

When I use the percent setting and then play around with the opned html window, I like that all the elements remain visible regardless of the size of my window but it also allows for extreme distortion of the movie image contents.

Example is that I have a thumbnail gallery and this setting allows the pictures to be stretched.

Is there a way to let this scaling take place but to retain the movie's dimensional proportions?

Thanks if you can advise.

Michael Sheeler

Constraining The Proportions Of A Flash Movie?
Is it possible to constrain the proportions of a Flash movie? I have a movie that is 300x200 pixels and have motion-tweened graphics that are moving in and out of the stage.

I noticed that even though the movie is at 300x200, if I resize it I start noticing graphical elements outside the stage that are not supposed to be even visible.

How can I prevent this from happening? Should I even worry about this? Thanks.

Constraining Proportions Of Loaded Images?
First, can someone enlighten me as to how to constrain an image proportions based on using either _width or _height using ActionScript. My users are uploading full-sized images which I then want load into a movie to display at a smaller size. I thought about scale but since that's a percentage the results will vary as images vary in dimensions.

Second, I was trying to come up with some logic to determine where the image is placed on the stage depending on if width is greater than height and vice-versa but can't get it to work.

Here is just a portion of my code:

HTML Code:
myListener.onLoadInit = function(photo5_mc:MovieClip) {
trace(photo5_mc._width);

if(photo5_mc._width >= photo5_mc._height){
photo5_mc._x = 70;
photo5_mc._y = 30;
}else{
photo5_mc._x = 108;
photo5_mc._y = 30;
}
//trace(photo5_mc._x);

}
Thanks for your help.
-Scott

Mask, Movie And Unchanged Proportions
Hi all,

I`m sure this one has been on the board quite a few times... please redirect me, I coulnd`t locate a thread.

on this site: http://www.adidas.com/campaigns/women/content/
the menu is done with litlle mc`s. once one does rollover the enlarge and the movie starts playing. I guess so far no problem, but also the proportions of the frame (mask/white border) does stay the same. How?
A similar phenomenon happens on this site: http://softbimage.com/

any ideas of how that`s done?

thanks for your feedback,
m.

Fitting Images And Maybe Preserving Proportions
At the moment I am using

_root.image.loadMovie(photo.jpg);

to load a jpeg into a movieclip which results in the picture being loaded at its full size. Whats the best way to get it to fit to the "container" movieclips size.

Also is there a way to get it to preserve its proportions so it doesn't stretch?

MovieClip Proportions Including Mask
I'm just starting out with AS3 and I'm trying to adjust the width and height of a MovieClip that contains images that are masked. For instance the main container clip is called MainClip and inside MainClip I have a large image at (1000x1000) masked down to a 500x500 square. If I trace MainClip.width I will get the overall size of the clip up to the image's original size which is 1000x1000 (even though it is masked). How do I access the overall clip's size including the mask? I realize I can access the mask width, but I'm actually trying to SET the width of MainClip to a larger size and when I do so it doesn't do it according to it's visible mask but via it's children. Thanks for the help.

Website Res/size And Constrain Proportions
hey guys,
just wondering, what the best size is to make a website at using flash. also, if someone could help me with the constrain proportions function:

I want to make a website that only has a small rectangle as the main bit (and doesn't resize when the window size changes), but i want to create the rest of the page (the "background", which will still have a couple of buttons/copyright/etc on it) so it resizes with the browser window....

if anyone could help it would be much appreciated!!


  Kitten ^_-

Maintaining Proportions With Full Screen Flash
hi, I have a flash site set up that allows a mc in the background containing various images to always take up the full browser window while the foreground elements remain unchanged. What I would like to do is keep the background images from distorting when the window is resized...a good example of this is on redtettemer.com - it maintains proportions and just cuts off at the bottom or side if it would cause any distortion.

this is the current code I have on frame 1:

Stage.scaleMode = "noScale";
Stage.align = "TL";



var stageListener:Object = new Object ();
stageListener.onResize = positionContent;
Stage.addListener(stageListener);

function positionContent():Void {

portfolio_bg._width = Stage.width;
portfolio_bg._height = Stage.height;

}

positionContent();

can anyone help with this?
thanks

AddChild Changing Proportions Of Sprite Incorrectly
Code:

   public class CS3InputField extends Sprite
   {
      private var _lbl:Label = new Label();
      private var _edt:TextInput = new TextInput();      
      
      public function CS3InputField(ix:Number, iy:Number, w:Number, h:Number, title:String="", password:Boolean=false)
      {
         super();      
         
         // Setting the sprite to the desired size,
         // if not set causes the width to be incorrect.
         graphics.lineStyle(0, 0, 0);
         graphics.moveTo(0, 0);
         graphics.lineTo(w, (h * 1.2) + h);
         
         // Defining the properties of the label
         _lbl.width = w;
         _lbl.height = h;
         _lbl.x = 0;
         _lbl.y = 0;
         
         // this is a method within the class setting the _lbl's textfield.text property
         caption = title;

         // Defining the properties of the textfield
         _edt.displayAsPassword = password;
         _edt.width = w;
         _edt.height = h;
         _edt.x = 0;
         _edt.y = (h * 1.2);

         // Until now the height is completely correct
         trace(height);

         // Adding both to the sprite
         addChild(_lbl);
         addChild(_edt);      
         
         // Now the height is incorrect
         trace(height);

         // Moving the sprite to coordinates ix and iy
         x = ix;
         y = iy;
      }


I don't get it... for some reason addChild causes the sprite to be much taller than it should be. When I create a new CS3InputField with w=125 and h=18 the first trace returns 39.6 and the second one 122. WTF? Why does addChild change the height of the sprite?! If I'm not blind even after adding the components _lbl and _edt the height shouldn't be more than (h * 1.2) + h.

Very Basic, HOW DO I USE DYNAMIC TEXT? I'm Lost.
Could someone explain to me how to achieve dynamic text. From start to finish.

Questions, what code must I use, where do I put this code?

Do I give the dynamic text box an instance name, and or when do I give it a variable name?

How do I import an external text file and make it work?



I've tried to look this stuff up online, but it's just not working for me,....thanks.

Basic AS Question About Dynamic Names
Hi everyone,

have a question about as 2.0,
in as 1.0 I could use a for loop to create a lot of variables dynamically, but with as 2.0 it always gives me error messages, how do I do this in as 2.0

for(i=0;i<10;i++){
this["variable"+i]=Math.floor(Math.random()*1000);
}

I have tried following but it doesn't work:
for(i=0;i<10;i++){
var ["variable"+i]=Math.floor(Math.random()*1000);
}

Please help

Very Basic, HOW DO I USE DYNAMIC TEXT? I'm Lost.
Could someone explain to me how to achieve dynamic text. From start to finish.

Questions, what code must I use, where do I put this code?

Do I give the dynamic text box an instance name, and or when do I give it a variable name?

How do I import an external text file and make it work?



I've tried to look this stuff up online, but it's just not working for me,....thanks.

Basic Dynamic Object Question
Is it possible to check certain properties of a class instance against a dynamic object?

Given a class with multiple properties...

var bob : Person= new Person();
bob.name = "Bob";
bob.weight = "150";
bob.height = "5"

var obj:Object = {name:"Bob"};

Looping through the object returns the value but not reference. Is this possible?

Alternatively, I guess I could create an array in each class that contains a list of properties, and use that for the loop.

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