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




Dynamically Setting Text And Resizing Canvas



Hi

setting text

I'm made a button in which I put a dynamic text box, and gave it the instance name "caption". I removed it from the canvas, since it gets added using the attachMovie method. The caption comes from the html in the form of <PARAM NAME=movie VALUE="mymovie.swf?btn1=Click+Here">

I know that this parameter is loading, so that's no problem.

The problem is, that this value does not get loaded into the textbox.

I attach the button in the root:

Code:
attachMovie("btnTemp_exp", "button" + x, x);
with (_root["button" + x]) {
_x = 1;
_y = (_root["button" + x]._height * i) + 1;
_caption.text = eval("btn" + x);
}


I checked, and eval("btn" + x) returns the value of the passed parameter. the buttons get attached. When I do this:

Code:
trace(_root["button" + x]);

the result is:

_level0.button1

but when I do this:

Code:
trace(_root["button" + x].caption);
// caption is the instance of the textbox

the result is:

undefined

what am I doing wrong?

resizing canvas

I'm also trying to resize the canvas using actionscript. my button's height is 20. I want to specify in the params how many buttons I have, and pass their captions as well. if I have 3 buttons, the canvas's height should be 60. If I have 5 buttons, it should be 100. I managed to do this using actionscript, but the buttons stretch with the canvas. this means that if my original canvas's height was 20, and I want 3 buttons, it will now, be 60, but the button's height is also 60. I've seen flash movies that appear to be doing the same thing. Am I dillusional, or is there a way to do this?

Thanx in advance



FlashKit > Flash Help > Flash ActionScript
Posted on: 01-08-2004, 07:55 AM


View Complete Forum Thread with Replies

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

Resizing My Canvas
hi there

im using flashmx.
How do i resize my canvas so that i dont have any white background showing.

thanks again
dcheketri

Resizing My Canvas
hi there

im using flashmx.
How do i resize my canvas so that i dont have any white background showing.

thanks again
dcheketri

Canvas Resizing
hello everyone!!
i am making my canvas go larger,
and i wanted to center all my stuff..
how can i do it?
thanks

Canvas Resizing
Hi,

Can somebody look at the attached file and let me know why the image is appearing before the canvas finish resizing.
I would like the canvas to resize before the image appears.

Thanks for any help

Resizing The Canvas In Flash MX
I am about 90% done with this website I am designing and I find out that I need to expand the height of the canvas it is on. When I go into modify>document I can enter in a new size, however it only adds the extra room to the bottom of the document. I need it to add the extra length evenly on all sides. I know this is possible in photoshop and many other programs, is there a way to do it in flash?

Resizing A Movie Canvas
Is there anyway to change the default way the movie size increases. i.e so tit will increase/decrease from top left or bottom up?

I need to amend an existing movie but i need extra space at the top rather than at the bottom :S

Dynamically Setting Labels Or Dynamically Setting Frames To Print
1. Does anyone know if there is a way to dynamically set a frame label. The reason for this is that I want a particular frame to Print with other frames (requiring a frame label of #p) if you answer a question a certian way and not to print with the other frames (needing a different label or no label at all) if the question is answered differently.

2. Option #2 would be to be able to dynamically set which pages print when you call the "PRINT" command (probulary through an expression). Any ideas would be appreciated.

thanks

Minimum Flash Canvas Size And Resizing
Hi there,
I'm having some really weird difficulties with a Flash file interfering with some other Javascript on a specific page. It seems that when I set the height of the Flash file like so:


Code:


<script type="text/javascript">
AC_FL_RunContent('codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','80','height','80','src','flash/xyz,'quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','flash/xyz' ); //end AC code
</script>



Javascript that I have elsewhere that does drawings won't work properly. I think it is because the Prototype library somehow can't calculate the offset of items following it. However, when I remove the width and height parameters, everything works fine.

I'm trying to see if I can get an 80x80 SWF file from the person who developed it so I won't have to manually set the size. However, one thing that concerns me is that it seems that, even if I link to a bogus file, there is a certain irreducible Flash canvas size that is closer to 200x200 pixels. This shows up as a white box.

Does anybody know if it is impossible to reduce a Flash movie beneath this size without specifying the height and width as parameters? I.e. if I can get a smaller SWF file, will it make a difference or will it still blow up to that larger size?

Basically, I don't know what that white canvas is all about or why it defaults to that size and seems to break out of its containing blocks. Also... I don't really know much about Flash in general . I just have to keep this SWF file from interfering with my other stuff.

Thanks for your help.

Dynamically Resizing Text Box
I'm trying to create a textbox that has a fixed width, but the height changes depending on how much text there is. I can't quite seem to figure out how to determine when the text overflows the current textbox size.

Dynamically Resizing Text Box Width
Hello,

I'm working on a movie that imports a list of peoples names via XML, and then horizontally scrolls the names on the movie (similar to a stock ticker).

I have everything working, but I'd like to make it a bit cleaner by fixing up the spacing between the names as they scroll by. Currently, I have a MC instance that I dyanamically create via ActionScript for each name. Every MC instance is 200 pixels wide with a 150 pixel space between each MC instance. This would be fine if everyone's name were the same length, but they are obviously not.

What I would like to do is to minimize the width of each instance depending on the length of the name so that the spacing between each MC instance is approximately the same.

Does anyone know a way to do this that doesn't involve a fixed-width font?

Thanks in advance,
-mike

Dynamically Resizing A Text Field
Ello all

I have a tool tip movie clip that is just a dynamic textfield hovering about and was wondering if anyone knows if its possible to resize the textfield to fit the amount of text it contains

thanks in advance

[F8] Dynamically Scrolling, Resizing Text
Anyone see an FLA similar to this tsunami-ish effect over on Lynda.com's home page ...

trainingbanner.swf

It's a scrolling list which responds to mouse movement and clicks.

The text and URLs are fed dynamically.

Tried to reach the designer without luck.

CreateTextField, Dynamically Loaded Text, And Setting Text Format..
I'm trying to format some text that i'm loading into a text box, that's inside a movie clip, that's created at load time. It seems that I have everything but the snippet of code that will apply the text formatting. I just don't know where to get it from, or rather, what to point it at.

my code is

Code:
//creates empty movie clip
this.createEmptyMovieClip("enter_mc", 10);
//creates text field inside movie clip
this.enter_mc.createTextField("welcome_txt", this.getNextHighestDepth(), 0, 0, 100, 300);
//sets text formatting
var my_fmt:TextFormat = new TextFormat();
my_fmt.bold = true;
my_fmt.size = 20;
//

LV = new LoadVars();
// declare a new LoadVars object
LV.load("enterTxt.txt");
// load content in it
LV.onLoad = function(success) {
if (success) {
// when the file is loaded...
_root.enter_mc.welcome_txt.text = this.enterTxt;
// load the value of the variable "enterTxt" in the
// file into the text field "named" welcome_txt
}
};
and that works to create the movie clip, the text box, and load the text.

this

Code:
_root.enter_mc.welcome_txt.setTextFormat(my_fmt);
would make sense for formatting the text but it doesn't format the loaded text. there's nothing special about the text that's being loaded.

I'm at a loss, any help would be greatly appreciated.

Dynamically Setting Text Size
The actionscript tells me, textField.textSize = 10

which i'm sure would work, but what if you dynamically create a text field

when you do this, you set the variable name for the text field, but some how I can't seem to get the textSize to work :/


PHP Code:



this.loader.loadProgress_txt.textSize = 4;
this.loader.loadProgress_txt.textColor = 0xFFFFFF;




the color property works, but no the text size, whats up?

[F8] Dynamically Setting Text Colors
i have 4 different text format styles i will apply to different text fields. My dilemma is that i can not get Flash to accept something like

Code:
txColorCounter++;
txField.setNewTextFormat(ts+txColorCounter)


any ideas how i can get a dynamic counter to add the numeric suffex to the "ts" of the textFormat object?

thanks



Code:
//*******set WHITE text styles**********
var ts0:TextFormat = new TextFormat();
ts0.font = "Century Gothic";
ts0.size = 10;
ts0.color = 0xFFFFFF;
//*******set ORANGE text styles**********
var ts1:TextFormat = new TextFormat();
ts1.font = "Century Gothic";
ts1.size = 10;
ts1.color = 0xFFCC33;
//*******set Pink text styles**********
var ts2:TextFormat = new TextFormat();
ts2.font = "Century Gothic";
ts2.size = 10;
ts2.color = 0xff99CC;

Dynamically Resizing A Text Field - Doable?
Hey hey,

i'm filling a text field with variables from an external text file, but i dont know how much text there will be. is there a way increase the height of the text field depending on a known number of variables?

eg

textfield._height = 50 * num_of_var;

i'm not sure how to reference the text field since you can't name it. it is inside a movie clip but i don't want to stretch the MC, just the text field inside it.

FK

Resizing Dynamically Created Text Field
I've only got 360 pixels in width to work with. My dynamically entered text may be longer than that and I want to resize it, in essence "squishing" it to fit the area. I've tried putting the created text field in a movie clip and resizing it to no avail. Here is the code I am using.

headfmt = new TextFormat();
headfmt.color = 0xFFFFFF;
headfmt.font = "Arial Black";
headfmt.bold = true;
headfmt.size = 14;
headline.createTextField("headtext", 10, 0, 0, 30, 24);
headline.headtext.type = "dynamic";
headline.headtext.autoSize = "left";
headline.headtext.text = "HEADLINE ONE GOES HERE WITH EIGHT TO TEN WORDS IN IT";
headline.headtext.setTextFormat(headfmt);

"HEADLINE ONE GOES HERE WITH EIGHT TO TEN WORDS IN IT" is much longer than 360 pixels (approx. 540 px). How can I squish it down to fit the 360 px. area at runtime? Is there a way to convert text to shapes at runtime?

Setting Links Dynamically From A Text File
I have included a .fla that I need help with. In the movie clip "Final Button" I have a layer called "button". There is also a layer called "linkGetter". When I run the .swf "linkGetter" loads a text url from a text file. What I want to happen is that when the button in the "button" layer is pressed that it goes to the URL in "linkGetter". I cant seem to get this so some help would be appreciated and for all you experts out there I would think that this would only take a second. Thanks! PS... my Action Script for loading the variables from the text file can be found in the "actions" layer of the main timeline if that helps at all. Thanks!

Dynamically Resizing Text In A Fixed Width Field
Hello!

I'm creating a series of fixed width text fields which will have text brought into them from a feed, using createTextField();.

I'd like to be able to dynamically resize the text so that it fills the entire width of the text field automatically.

Is there a way of doing this without parsing the string and working out the equivalent font size for the number of characters? Or does anyone know of a method, class or component that could deal with this?

Dynamically Resizing Images Inside A Text Area
Hello all,

I'm wondering, is it possible to dynamically resize an image after it's been inserted into an input text area? With how touchy flash seems to be regarding images imbedded inside text areas this seems as if it wouldn't be possible. I'm working on a project where we would really like to be able to do this. Anyone know if it's possible and/or how to do it?

I'm trying to get as much MS Word-like functionality out of this project. Any hlp will be appreciated.

Getting And Setting The Width And Height Of Text Tool Dynamically
What I am trying to do is set the text of a text tool at runtime, which I was able to do. The problem is how can I determine if the text exceeds the size of the text tool and how to resize it at runtime.

Setting Dynamic Text Field Variable Dynamically
Hiya guys

I know that we can set up a var for a dynamic textfiled by putting it in the box but is there a was to do it by code, every route I have taken has failed,

any help greatly appriciated

ta

Zen

Dynamically Resizing A Text Field To Content And Scroll If Beyond ScreenResolutionY
Day 4 researching this and still trying to see if there were a way for me to have scroll bars appear for my auto size text field if the content were to go beyond the viewable area. This would regard screen resolution I guess?
So if viewers were on a smaller screen size the scroll bars would appear, but no scroll bars for people on large monitors. I am aiming for a design that will be effective for most resolutions.
The best exmple of it I have seen is here choose PRESS then check out the way Biography resizes.
Hope I am clear.
I am mindful that I may be biting off more than I can chew but I would really love to add this functionality to my design.
Apprecite any ones ideas

Modify The Canvas Size Dynamically
Hi guys,
I want to resize the canvas of my flash page ,depending on the content of the movie
the content will be a text coming from a XML file will be change always so
the question:
how can i modify the canvas size dynamically?
thanks

Dynamically Resizing A Text Field With Auto Scroll If Beyond Screen Resolution.
Quote:





Originally Posted by Delmundo


Dynamically resizing a text field I have a dynamic textfield that I'm reading data into from a text file. All works fine, except that I need to physically drag the textbox down to create more space for the content.

The content will invariably not be of one length, it'll be changing on a weekly basis, so my question is: is there a way of setting the size of the textfield depending on how much content it contains, so all the content is displayed?








Firstly thank you for the advice and information you posted regarding the above link. I found it really helpful, exactly what I was hunting for. I have done a bit more research trying to see if there were a way for me to have scroll bars appear for my resized text feild if the content were to go beyond the viewable area. This would regard screen resolution I guess?
So if viewers were on a smaller screen size the scroll bars would appear, but no scroll bars for people on large monitors.
The best exmple of it I have seen is here choose PRESS then check out the way Biography resizes.
Hope I am clear.
Thanks for your prior help

Text Color And Background Color Setting Dynamically
How would I go about setting the background color of a flash movie as well as the text color of a text box based an external variable?

I want to pass in both of these colors in the <object> tag
myfile.swf?bgcolor=red&textcolor=white

Please advise.

Thanks
Robert

Setting Position And Resizing Help
I know this is probably easy to do but for some reason I cannot get this to work. I am using a screen resolution of 1280 x 1024. I have my navigation MC at

navigation_mc._y = 673;
navigation_mc._x = 946;

I want it to be that when the screen is fullscreen the mc will be at the positions above, but when I resize the browser window, the mc will resize as well. I know how to set the mc at the bottom if I wanted. But I dont know how to set it initially to the positions above but still scale to the browser window.

Below is what I have, but if someone can help me with setting the positions as well as allowing to scale it would be greatly appreciated.

Stage.align = "lt";
Stage.scaleMode = "noScale";
Stage.showMenu = true;
_quality = "high";

//Center the stage elements
var myListener:Object = new Object();
myListener.onResize = function() {
updateLocations();
};
Stage.addListener(myListener);
updateLocations = function () {
// Values of the initial .swf width and height
initialWidth = 950;
initialHeight = 600;
// Get the current stage width and height
currentWidth = Stage.width;
currentHeight = Stage.height;
// Position navigation
navigation_mc._y = 673;
navigation_mc._x = 946;
};
updateLocations();

Adding Text To Canvas In Flex/AS3
I am doing AS3 programactically so I have a one mxml file that calls to my application.

Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" applicationComplete="Main.main()">
</mx:Application>
I am running in to issues when I try to display text inside the Canvas of a view in the ViewStack(The view stack is displaying correctly with links for the navbar). See code below. What am I doing wrong? Any help is welcome!

BTW, I know I posted a lot of code but I really want some help on this as I am very new to AS3. The real meat of the code is in the AccountView class.

Thanks in Advance!

Tonté Pouncil

Code:
package com.pouncilt.chuckspic3.core{
import mx.containers.Panel;
import mx.containers.ViewStack;
import mx.controls.*;
import mx.core.*;
import com.pouncilt.chuckspic3.views.ViewFactory;
import com.pouncilt.chuckspic3.views.View;

public class Main {
private static var mainPanel:Panel = null;
private static var application:Application = null;
private static var navBar:LinkBar = null;
private static var views:ViewStack = null;

public static function main():void{
init();
}

private static function init():void{
Main.application = Application(Application.application);
Main.application.styleName = "plain";
createMainPanel();
createNavigationBar();
Main.application.addChild(Main.mainPanel);
}

private static function createMainPanel():void{
Main.mainPanel = new Panel();
Main.mainPanel.title = "Chuck's Pic 3";
Main.mainPanel.percentHeight = 95;
Main.mainPanel.percentWidth = 95;

Main.mainPanel.setStyle("paddingTop", 10);
Main.mainPanel.setStyle("paddingLeft", 10);
Main.mainPanel.setStyle("paddingRight",10);
Main.mainPanel.setStyle("paddingBottom", 10);
}

private static function createNavigationBar():void{
Main.navBar = new LinkBar();
Main.views = new ViewStack();
Main.views.setStyle("borderStyle","solid");
Main.views.percentHeight = 100;
Main.views.percentWidth = 100;
Main.views.visible = true;

Main.views.addChild(ViewFactory.createView(ViewFactory.HOME));
Main.views.addChild(ViewFactory.createView(ViewFactory.LOGIN));
Main.views.addChild(ViewFactory.createView(ViewFactory.REGISTRATION));
Main.views.addChild(ViewFactory.createView(ViewFactory.ACCOUNT));
Main.views.addChild(ViewFactory.createView(ViewFactory.APPLICATION));

Main.navBar.dataProvider = views;
Main.mainPanel.addChild(Main.navBar);
}
}
}


package com.pouncilt.chuckspic3.views{
import flash.utils.getDefinitionByName;
import flash.utils.getQualifiedClassName;

public class ViewFactory{
public static const HOME:String = "com.pouncilt.chuckspic3.views.HomeViewFactory";
private static const homeViewFactoryRef:HomeViewFactory = null;

public static const REGISTRATION:String = "com.pouncilt.chuckspic3.views.RegistrationViewFactory";
private static const registrationViewFactoryRef:RegistrationViewFactory = null;

public static const LOGIN:String = "com.pouncilt.chuckspic3.views.LoginViewFactory";
private static const loginViewFactoryRef:LoginViewFactory = null;

public static const ACCOUNT:String = "com.pouncilt.chuckspic3.views.AccountViewFactory";
private static const accountViewFactoryRef:AccountViewFactory = null;

public static const APPLICATION:String = "com.pouncilt.chuckspic3.views.ApplicationViewFactory";
private static const applicationViewFactoryRef:ApplicationViewFactory = null;


public static function createView(className:String):View{
var classReference:Class = getDefinitionByName(className) as Class;
var factory:IViewFactory = new classReference();
return factory.createView(null);
}
}
}


package com.pouncilt.chuckspic3.views{

public class AccountViewFactory implements IViewFactory{

/*public function createView():View{
return new AccountView(null);
}*/

public function createView(label:String):View{
return new AccountView(label);
}
}
}


package com.pouncilt.chuckspic3.views{
import mx.controls.Text;
import mx.controls.Label;
import mx.core.UIComponent;

internal class AccountView extends View{

public function AccountView(label:String){
super(label)
var uic:UIComponent = new UIComponent();
var welcomeText:Text = new Text();
welcomeText.text = "Account Page";
welcomeText.visible = true;
//welcomeText.x = 200;
//welcomeText.y = 300;
uic.addChild(welcomeText);
addChild(uic);
}
}
}

package com.pouncilt.chuckspic3.views{
import mx.containers.Canvas;

internal class View extends Canvas{
public static var COUNT:int = 0;


function View(newLabel:String){
super();
if(newLabel == "" || newLabel == null){
label = "View " + View.COUNT;
} else {
label = newLabel;
}

View.COUNT++;
}
/*function View(){
//View("View " + View.COUNT);
super();
label = "View " + ++View.COUNT;
}*/
}
}

Resizing Movies Dynamically
How can I resize my flash movies when the browser window resizes? Is this even something that ActionScript can do?

Dynamically Resizing Image
I need to dynamically resize an image via actionscript and am alittle new to actionscript so could use alittle guidance.

here's what I have:

// url value flashquerystring.cfm?imgHeight=300&imgWidth=300

// actionscript for image resize
imgFormat = new ImageFormat();
imgFormat.height = _root.imgHeight;
imgFormat.width = _root.imgWidth;
imgbox.setImageFormat(imgFormat);

// I may be way off as to how I set my imgBox variable. I made my image a movie clip and set that as the instance. I've attached the fla if that's easiest

thanks in advance

Resizing Fonts Dynamically
Hi -

we're trying to pull in some names from a database into flash that are then displayed in a panel.

Our probem is that the names will invariably be too long for the panel width, and so will need to wrap or resize to fit.

Is there a way that this can be done within flash?

if anybody could give me a few hints as to what route we should take - then I can pass this onto the coders

many thanks

Hot To Attach An MC To A Dynamically Resizing MC?
Hi there....

Hope you are all doing well. I have come across a small problem.
Here's a bit of background info.

I have an MC(clipMC) which i am resizing using ActionScript. The moveclip only resizes
horizontally. What i would like to do is attach a movieclip(menuClip) that contains my menu buttons to the right edge of the dynamicly resizing movieclip.

When the buttons are clicked the MC resizes and new content is loaded in.

Heres my code so far.

On resizing ClipMC. This is actually inside another MC as I am using it to mask an image.

Code:
onClipEvent (load) {
this._width = 700;
this._height = 500;
}
onClipEvent (enterFrame) {
this._width += (_root.changeWidth-this._width)/7;
this._height += (_root.changeHeight-this._height)/7;
}
on last key frame of flash. Just changes the width of the clipMC

Code:
stop();

_root.menuClip.button1.onRelease = function() {
_root.changeWidth=185;
_root.changeHeight=500;
};


_root.menuClip.button2.onRelease = function() {
_root.changeWidth=285;
_root.changeHeight=500;
};

_root.menuClip.button3.onRelease = function() {
_root.changeWidth=500;
_root.changeHeight=500;
};

_root.menuClip.button4.onRelease = function() {
_root.changeWidth=350;
_root.changeHeight=500;
};
What would i need to add to the menuClip MC to get it to "dock" to the right edge of my resizing MC.

I tried putting this on the menuClip MC:


Code:
onClipEvent (enterFrame) {
this._x -= (_root.changeWidth-_root.clip._width)/7;
}
but it doesnt really give me the desired result. The menu over shoots the clipMC

Any help would be much appreciated.

thanks in advance.

Robert

Resizing Images Dynamically?
I want to resize an image dynamically,

I know that this._yscale and this._xscale resize the image in percentage way.

And that this._y and this._x place the picture according to co ordinates.

and this._width and this._height resizes it according to pixels. So i should use this one to resize it. However when i try to resize it, it doesnt show up at all on the screen??????? but when i dont use this._width and this._height it does....

Any Ideas

Dynamically Resizing Mask
Is it possible to dynamically resize a mask I created programmatically? I tried, but it doesnt work. Here's what I've done:

this.createEmptyMovieClip("maskMC", 100);
maskMC.beginFill(0x000000);
maskMC.lineTo(0, 0);
maskMC.lineTo(900, 0);
maskMC.lineTo(900, 560);
maskMC.lineTo(0, 560);
maskMC.endFill();
outerMC.setMask(maskMC);

Stage.scaleMode = "noScale";
Stage.align = "TL";
var myListener:Object = new Object();
myListener.onResize = function() {
var stageH:Number = Stage.height;
var stageW:Number = Stage.width;
if (stageH>=560) {
maskMC._y = stageH;
} else if (stageW>=900) {
maskMC._x = stageW;
}
};
Stage.addListener(myListener);

When I test movie, the mask works. But the second I try to resize the stage, the mask doesnt work anymore and nothing shows up.

Resizing Boxes Dynamically...
Ok, first off I just want to thank you all for taking time with my other posts to help me out, I really appreciate it!

Now my question.

So I have a dynamic menu system, where text is getting loaded from SQL to a text box (dynamic). However sometimes there are so much text that it will go past the preset size. So I would like to find out how to resize it dynamically by height.

Now when you move your mouse over the menu selection, I would like a rounded box to lightly highlight the menu selection, however if I have a resizing text box, how can I script a rounded box to be the size of that particular menu selection? I guessing I might have to have the text box in a MC, and find a script to resize the rounded box to meet the height, width and position of the Movieclip.

Any ideas to research this or coding examples would be GREATLY appreciated.

Dynamically Resizing An Image
Hi all.

I have an image that I am trying to resize depending on the size of the window. The thing is, when it resizes it looks pixelated and horrible. I have no idea why this is. The image is a gif that is 321 x 347 and it pixelates when shrinking down as well as up...

my code looks something like this and yes, my image is a bunny:


var bunnyHmax:Number;
var bunnyWmax:Number;
var thisbunnyW:Number;
var thisbunnyH:Number;
var bunnyratio:Number;

bunnyHmax = bunny_mc._height;
bunnyWmax = bunny_mc._width;
thisbunnyH = bunny_mc._height;
thisbunnyW = bunny_mc._width;
bunnyratio = thisbunnyH/thisbunnyW;

if (bunnyHmax < 200) {
bunny_mc._height = Stage.height * .4;
bunny_mc._width = Math.round(bunny_mc._height/bunnyratio);
}else{
bunny_mc._height = 347;
bunny_mc._width = 321;
}

Resizing A Dynamically Loaded SWF
Hi, I'm trying to load in a movie using 'loadMovie' into an empty movie clip. The movie being loaded is a linear playing .swf movie I made using Sorenson Squeeze. I've got a 320x240 video and I want to resize it to 240x180 and play in my flash presentation. Whenever I try to change the movie container's width/height the movie disappears. I can hear the audo but no video. Here's an example of what I've tried:


Code:

movieToOpen = video_txt.text;
_root.createEmptyMovieClip("movieHolder_mc", 100);
movieHolder_mc.loadMovie(movieToOpen);
movieHolder_mc._width = 240;
movieHolder_mc._height = 180;
I've also tried using a .onData event to do resizing there. What am I doing wrong? Or can you just not resize a swf like this? Any help is appreciated, thanks

Resizing And Moving Dynamically
I'm looking to resize and move a movie clip with Actionscript and Easing. Here's an example of kind of what I'm looking for...

http://www.jamesgood.f2s.com/main.php

I'd really like to do it using Flash 5, is it possible?

Cheers,
Mike

Resizing A Dynamically Loaded SWF
Hi, I'm trying to load in a movie using 'loadMovie' into an empty movie clip. The movie being loaded is a linear playing .swf movie I made using Sorenson Squeeze. I've got a 320x240 video and I want to resize it to 240x180 and play in my flash presentation. Whenever I try to change the movie container's width/height the movie disappears. I can hear the audo but no video. Here's an example of what I've tried:


Code:

movieToOpen = video_txt.text;
_root.createEmptyMovieClip("movieHolder_mc", 100);
movieHolder_mc.loadMovie(movieToOpen);
movieHolder_mc._width = 240;
movieHolder_mc._height = 180;
I've also tried using a .onData event to do resizing there. What am I doing wrong? Or can you just not resize a swf like this? Any help is appreciated, thanks

Resizing And Moving Dynamically
I'm looking to resize and move a movie clip with Actionscript and Easing. Here's an example of kind of what I'm looking for...

http://www.jamesgood.f2s.com/main.php

I'd really like to do it using Flash 5, is it possible?

Cheers,
Mike

Dynamically Resizing Textboxes
is it possible to dynamically resize a dynamic textbox at runtime without stretching out the text inside?

Dynamically Loaded Picture - Resizing
I am working on a picture viewer that will step through all pictures in folder. The pictures are all different sizes.

How would i go about resizing the dynamically loaded picture to fit inside a specified area in the movie? Below is the update function used to load the picture.

Thanks

function update() {
url = filename+picnum+".jpg";
loadMovie(url, picture);
}

Dynamically Resizing Bar On Button Click.
Hi guys. I have five buttons. Everytime i click on a button, a bar underneath must resize to accomodate information. On a click of a button, the movie goes to a specific frame where info is located. How would I go about achieving the bar resize?? I'm an actionscript newb. thx for help in advance!

Dynamically Resizing A Dynamic Textbox..
Hi. Just making a news page for my site, the contents of the news is loaded from a database. thats all easy. problem is, i want the dynamic text box (that displays the news) to change size to fit the news. i.e. at the moment, if there is a very long news item, then it just makes the text too big for the box and you have to scroll down to se it. i know this kinda sounds like a strange request but it makes sense if you could see what im doing.... i need it so that the textbox resizes itself to grow big enough to fit in all the text. any ideas?

thanks in advance

Rich

Resizing Main Stage Dynamically
I've seen this before and haven't found it by searching. The main stage or movie clip changes it's x/y coordinates when a navigation button is clicked. For example, when the "News" section is clicked, the main stage changes to 300x100.

There are a few sites that i've seen do this. Any places I can look or any code out there?

Dynamically Resizing Flash Piece
This question is in regards to the following site, which many of you may be familiar with - http://www.pdk.pl/index_feng.html

Does anyone know how they have dynamically resized the flash piece in this site?. When you click on one of the buttons (for example click on the blue 'What documents do I need' over on the right hand side) the flash piece extends left and right to both edges of the browser (which I can do) but it also extends downwards towards the bottom of the screen and then down past the bottom of the screen bringing the scrollbar into play (unless you're on a giant monitor).

How have they done this?, Can anyone help with this or give me a push in the right direction.

Thanks,
Stephen.

Resizing Jpgs Loaded Into A Mc Dynamically
I have a drag and drop card wizard. Where there are at least 3 hit test areas. If the hit test is true the dragable button loads a external jpg into the mc holder.

What I would like to do is have the jpeg dynamically resize to fit the empty mc. Each hit area/mc holder for the jpeg are different sizes, so I would like the jpeg to accomadate the mc holder.The mc holders need to be a set size.

Any help with this is so appreciated! Thanks all in advance.

[F8] Dynamically Resizing Textfield Width
Hello, all.

I am trying to fill in a dynamic text field with a piece of text that is of variable length. I want to make the dynamic text field adjust its width so that it is always the same width as the text inside of it, but cannot figure out how to do so. Does anyone know of a way?

I tried this:

Code:
myTextField._width = myTextField.text.length*myTextField.textWidth;
But that ends up with my text field being far smaller than the text inside of it.

If anyone could point me in the right direction I would be much obliged.

Girasquid.

Resizing Dynamically Loaded Jpegs
Hi,
I am loading JPEGs into an MC called pictureHolderMC using "loadMovie" without a problem. But, the JPEGs are different sizes and I need them to be a constant width (100 pixels) so I am using the code below to set this:

Code:
_root.pictureHolder._width = 100;
But when I add this code the JPEG disappears from "pictureHolderMC". I know that "pictureHolderMC" is still there as I put a background colour block in it which still shows up, but without the JPEG.
Ultimately, I will write a function that also sets the "_height" property in proportion, but I need to get the basics of controlling the size to work first.
Any suggestions as to how o achieve this would be much appreciated.

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