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








Scaling Vector Width (Flash MX 2004)


Hi.

I'm creating a website (flash only) that will feature a thin vector rectangle at the top. I only want the width of this rectangle to scale when the browser window is resized.

Also, this rectangle will be the only scaling item and all the other content will remain static. I would appreciate advice on how to achieve this effect.

Thanks
Lawrence




FlashKit > Flash Help > Flash ActionScript
Posted on: 06-26-2005, 02:15 PM


View Complete Forum Thread with Replies

Sponsored Links:

Flash, Video And Scaling Non-vector Images
i have been asked to produce a short Flash movie which will also be burned to DVD, and i would like to know what effect scaling will have on any non-vector (ie imported png's) images i use in the movie.

i intend to make the movie 720x576px (4:3 ratio) in Flash, at 24fps. when it is played on DVD it needs to scale up so it fills as much of the screen as possible.

i have two questions in this repsect:

1. will it scale automatically when the DVD is played? if not, how can i make it do so?

2. when it scales up in size, will the quality (ie the resolution) of the non-vector images suffer?

thanks in advance for any help you can provide

Andy.

View Replies !    View Related
Flash, Video And Scaling Non-vector Images
i have been asked to produce a short Flash movie which will also be burned to DVD, and i would like to know what effect scaling will have on any non-vector (ie imported png's) images i use in the movie.

i intend to make the movie 720x576px (4:3 ratio) in Flash, at 24fps. when it is played on DVD it needs to scale up so it fills as much of the screen as possible.

i have two questions in this repsect:

1. will it scale automatically when the DVD is played? if not, how can i make it do so?

2. when it scales up in size, will the quality (ie the resolution) of the non-vector images suffer?

thanks in advance for any help you can provide

Andy.

View Replies !    View Related
Importing Vector Art In Flash 2004
I'm using Flash MX (Flash 6) and am considering upgrading to Flash 2004.

MX seems to have problems with importing vector art from Adobe Illustrator. If I build a graphic in AI, save it as an ai file, then try to import it into MX, Flash will drop points occasionally, giving me a "broken" graphic.

This doesn't happen in Flash 5, so I have to take the extra step of opening Flash 5, importing my ai graphic into an fla, save the fla, then open that fla in MX as a library and copy the graphic to MX that way.

My question is, does Flash 2004 have any problems with importing vector art from external sources (like Illustrator)? Thanks!

-Glenn-

View Replies !    View Related
HOW To Import Vector Imagine In Flash MX 2004?
Hi!
I created in Fireworks some vector imagines with some effects on n I want to import them in Flash MX 2004 to animate them caz it's easier in Flash then do it frame by frame in Fireworks.

The problem is that after I imported them in Flash and I
-open the library: the imagines importat r bitmaps now
-when I test the movie: the imagines have not the same quality. They look not clear!!! In Flash, the fla looks ok, the swf does not. In Fireworks look great n also when I viewd them in browsers.

I made a vector imagine with the pen tool in Flash n when I animate it the colors are all fine. How can I keep the imagines I want to import as vectors?


Can anyone help please with any useful sugestion?

View Replies !    View Related
Scaling Width Of Flash Movie, Not Height
I am trying to figure out how to do this for a banner...basically I want the height of my flash banner not to change scale, but the width to stretch as far wide as the browser is...

can someone tell me how to do this? i would like to do this with the background of my flash banner repaeting so that the text doesnt distort... thx thx thx!!!

View Replies !    View Related
Vector Scaling
Hi all.

I've a 430 x 430 vector square filled with a simple gradient from #444444 to #000000.

This is the file:
http://www.presslabrecords.com/prova.swf

Why it displays horizontal lines?

I've tried:
_quality = "BEST" or
_quality = "LOW" but is the same.

Thx to all

View Replies !    View Related
Scaling/resizing Vector Square
Hi, I'm was curious as to how I can make a vector square resize itself to make it bigger or smaller. I'm using the squares to put content inside, I've seen this on many websites before where when u click a button the square box that holds the content resizes itself to fit whatever its holding.

IF ANYONE KNOWS HOW TO ACCOMPLISH THIS THROUGH ACTIONSCRIPTING, please reply? Thank you for your time

View Replies !    View Related
Does Scaling Effect Vector Rendering?
OK, this is totally wierd. I have this movie that contains a number of clips that are scaled from small to large by Actionscript. One clip contains text that has been broken to outlines, thus vector art. And the other contains a simple horseshoe-shaped fill--also vector art.

So the crazy part is this: as I scale these graphics up in their separate movie clips, some (most) of the curved paths that make up these shapes are suddently no longer curves. They are rendered as "corner" points, ie, straight lines between them instead of curves. The text outlines are almost entirely devoid of curves (though somehow one or two isolated curves on a few letter shapes are still there) and one full half of the horseshoe-shaped fill is still a curve, but the other half renders as straight lines between the anchor points.

Has anyone seen this before? What is going on?? When I preview these shapes and work with them on the stage, they look fine--all curves intact.

Super-frustrating. Any help will be greatly appreciated.

View Replies !    View Related
Scaling To 100% Width
hi | i've got a flash movie that i published at 1024 x 90. my intention is to use it as a flash header for an html page. then, as the browser is resized, the flash banner, programmed to match 100% width and height, will automatically resize to fit smaller dimensions than 1024 width. but it's not. you see, when it is scaled smaller, i see the stuff that is off the stage of the movie that i don't want to be seen.

you can see it here:

http://www.filio.com/writers/index-two.html

at 1024 width the blue lines wrap perfectly but anything below, you'll see, the lines go up. any ideas what could be causing this?

thanks. - matt.

View Replies !    View Related
Scaling Width But Not Height?
Hi

I am working on a chart for a hotel in Flash CS3 / AS 3.0. I have created a
movie clip inside my main movie that I want to replicate to "fill in" the
chart. What I want to do is scale the background of the clip to expand
across the number of days for a reservation. However, when I scale the clip
it scales both the width AND height. I don't want to make the height taller.
How can I prevent the scaling of the height?

Thanks

Rich

View Replies !    View Related
Scaling Width And Height At Once Using Percentage
Hello all. I am trying to scale a movie clip on rollover using percentages so I can say:

on (rollOver){
mc.scale=125%
}

this is what I am doing now:

MC Actions:

onClipEvent (load) {
new_width = _width;
new_height = _height;
ease = 3;
}
onClipEvent (enterFrame) {
_width += (new_width-_width)/ease;
_height += (new_height-_height)/ease;
}

Button actions:

on (rollOver) {
mc.new_width = 50;
mc.new_height = 50;
}

how can I combine this so I can scale both the width and height in one shot using a percentage?

Any help is greatly appreciated and I am doing this in Flash 5.

View Replies !    View Related
Question About Mc Scaling And Foo_mc.width
I’ve got a movieclip, printResults_mc, the bottom layer contains an 850 x 1100 pixel white rectangle positioned at (0,0) representing paper all the other elements are completely contained within this rectangular space. When I drag printResults_mc onto the stage the property inspector gives me dimensions of 850 x 1100, however, during runtime if I execute a trace on the dimensions I get the following:

printResults_mc.scaleX == 1
printResults_mc.scaleY == 1
printResults_mc.width == 883
printResults_mc.height == 1101

I can understand the height being off by a pixel due to rounding but why should the width be more than 30 pixels off? It’s not like I’ve transformed printResults_mc in any way, I’ve simply thrown it on the stage and asked “how big is it?”

View Replies !    View Related
9-slice Not Scaling Width Properly
I'm making a slider component, and I have a vector Sprite highlight on it that I'm scaling with 9-slice. It works pretty well, but the farther it stretches, the more imprecise the stretch gets.

In other words, it doesn't stretch the graphic to the exact width specified. It's like, 95%. And as the width gets bigger, that empty 5% gets more and more noticeable.

It seems like Flash is including some empty space, thinking that it's part of the graphic. There's only one layer on the highlight art, and I've verified that changing the art doesn't solve the problem.

I've also verified that the width that I'm setting the highlight to is the correct width. But the art still isn't wide enough.

Any ideas? I'm stumped.

View Replies !    View Related
Setting A Movieclips Width, Without Scaling It.
I have been hacking together two different tutorials to create a menu with changing images, and some animating text. Everything looks great, except the menuitems, which i try to resize dynamically depending on the menuitem-movieclip-contained dynamictext. When i resize this movieclip, the whole movieclip scales, and everything looks odd.

I hope someone has a pointer to what could be wrong, the deadline was yesterday.

Ps, this is my first flash project on my own, so be nice :-)

fla file can be found at: http://scanav.w-typo3.dk/scanav.fla

Sincerely

Claus Witt
Php and javascript veteran - Flash newbie/rookie...

View Replies !    View Related
Swf Scaling To Full Browser Width (plus)
First time poster here I have it mind to create content that fills 4 mcs that cumulatively span the full width of the browser window - 25% equally. There are two parts to this obvioiusly, one having to do with the general spanning of the swf to meet the full width of the window (though there needs to be a max-width sset at 1280px). The other has to do with dynamically duplicating clips that will maintain their width percentage (25%) within this area.

Anyone done anything like this before, or know a good way to go about this? TIA.

View Replies !    View Related
Scaling Clip To Stage Width
ActionScript Code:
box._x = 0;
box._xscale = Stage.width;
trace(box._width);


when i test the above script, my movie clip doesnt scale to the the stages width. Any thoughts?

View Replies !    View Related
Get Object Width After Scaling It With Tweener
Howdy,

I'm doing my first project using AS3 and Tweener and ran into a small problem. All i want is to get an objects width after it has been scaled with the scaleX propriety in Tweener. It gives me the width prior to the tween which i can't work with. I really don't know how the scale factor applies to the width or height of an object so i cant really calculate that separately.

Heres my code:

Code:

function foo():void
{
   var squareMenu:Square = new Square();

   squareMenu.x = stage.stageWidth/2;
   squareMenu.y = 270;
   squareMenu.scaleX = 1.3;
   squareMenu.scaleY = 1.3;

   addChild(squareMenu);

Tweener.addTween(squareMenu, {scaleX:30, time:1, transition:"easeOutElastic"});
trace(squareMenu.width);
}


So initially i scaled the object by a factor of 1.3 on both axis, because the objects size in the library is kinda small, then when i apply the tween and scale the object in the X axis by a factor of 30, the trace statement doesn't return the current object width, instead, it returns the objects width after the scale factor of 1.3 was applied.

Hope someone can help me out here, also if you know how the scale factor is applied to an objects width or height i would be happy to know about it.

Thanks in advance for any help.

meck

View Replies !    View Related
Making An Mc Span 100% Width Without Scaling Or Distorting?
hey all,

i'm wondering how you would go about making a movieclip span 100% width of the stage?? for example in a full browser flash site??

Cheers

View Replies !    View Related
Scaling Background Pic. How Do I Make It Effect Not Only Width But Height As Well?
Hello,

My background pic proportionally scales when the user adjusts the browser windows width but when it comes to height, it does nothing.

How do I make it propotionally adjust to height as well as width.


Code:

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

Stage.addListener(this);

// position menu
menuMc._x = Stage.width - 100;
menuMc._y = Stage.height / 2;

// Store the original dimensions of the image
var original_width:Number = this.BgPicMc._width;
var original_height:Number = this.BgPicMc._height;

// Call it manually at the start to initialise anything you have in there, otherwise it doesn't get called at all until the screen is resized.
this.onResize();

// position the contents according to background dimensions
function onResize():Void
{
// scale background image to browser windows width
trace("Resized: " + Stage.width + "x" + Stage.height); // trace dimension output
this.BgPicMc._width = Stage.width;
this.BgPicMc._height = Stage.width / original_width * original_height;
menuMc._x = Stage.width - 100; // x adjustment
menuMc._y = Stage.height / 2; // y adjustments
}

View Replies !    View Related
Scaling By % In 2004
Just trying out MX2004. Is it still possible to scale by percentage still?

~DrJ

View Replies !    View Related
Image Scaling In MX 2004
Hi

could somebody tell me if scaling images in MX2004 is better than in MX?

Im trying to emulate the scaling effect seen in the MacOSX screensavers (for a screensaver) but when I animate to a smaller size the picture jogs and doesnt look smooth at all

Id take a look myself but my demos run out

thanks alot for your help

View Replies !    View Related
[mx 2004 Pro]scaling Problem
I've got a empty movie clip(empmov) in which I load an image. This empty movie clip belong to another movie clip(movie1).

When I try to scale from the timeline using tweening, I can determine the center of the scale process and the movie clip(movie1)scaled as I wish but the empty movie clip is not effect by the scaling effect.....!!!.
I thought that the child inherit the behaviour of the parent but It doesn not..!!!.

I tried to do the same using action script with the _xscale and _yscale function and with interval, both of the movies scaled but as they scale they move in direction of the registration point (0,0)..things that not happens from timeline with tweening. I have tried to compensate (is that english...???..)the movement adding stuff like _x+10 or y+10 but It is not work very clean....and it's crap programation.

I don't want to move the registration point because it change all of precedant effect.
Someone can help me ?
the web site in progress is here :
www.ifrance.com/azerty7/flash/index.html
(click on the empty square)..when an iamge get close it moves on the left due to the registration pbl.

View Replies !    View Related
[mx 2004 Pro]scaling Problem
I've got a empty movie clip(empmov) in which I load an image. This empty movie clip belong to another movie clip(movie1).

When I try to scale from the timeline using tweening, I can determine the center of the scale process and the movie clip(movie1)scaled as I wish but the empty movie clip is not effect by the scaling effect.....!!!.
I thought that the child inherit the behaviour of the parent but It doesn not..!!!.

I tried to do the same using action script with the _xscale and _yscale function and with interval, both of the movies scaled but as they scale they move in direction of the registration point (0,0)..things that not happens from timeline with tweening. I have tried to compensate (is that english...???..)the movement adding stuff like _x+10 or y+10 but It is not work very clean....and it's crap programation.

I don't want to move the registration point because it change all of precedant effect.
Someone can help me ?
the web site in progress is here :
www.ifrance.com/azerty7/flash/index.html
(click on the empty square)..when an iamge get close it moves on the left due to the registration pbl.

View Replies !    View Related
Screen Width And Height In MX 2004 Pro
Firstly, I did search for this, but search wasn't working.

Now, I have my flash file set to 100% width and height in the HTML window with no scale. Can flash determine the width and height of the flash file in the HTML window?

Thanks in advance.

View Replies !    View Related
Help With Scaling Action Script Mx 2004
I have a problem with a scaler script that I have created with some help but I am having problem in that I cannot see the scalling object when the swf is launched I need to declare some sort of initial size preferably the size on button one below. The main object 'shirt6' becomes visable when I mouse over the buttons of the scaler so the scaler works I need help with the initial size.

This is the script I have on the frame;

current_x = _root.shirt6._xscale
new_x = Number(_root.new_X)
diff_x = current_x - new_x
move_x = diff_x/3
_root.shirt6._xscale = Number(new_x)+Number(move_x)
current_y = _root.shirt6._yscale
new_y = Number(_root.new_y)
diff_y = current_y - new_y
move_y = diff_y/3
_root.shirt6._yscale = Number(new_y)+Number(move_y)

This is the script I have on the buttons of the would be scaler;

button 1.

on (rollOver) {
new_x = 50
new_y = Number(new_x)
}

Button 2

on (rollOver) {
new_x = 55
new_y = Number(new_x)
}

Button 3

on (rollOver) {
new_x = 60
new_y = Number(new_x)
}

and so on up to

Button 10

on (rollOver) {
new_x = 100
new_y = Number(new_x)
}

I dont know where I'm going wrong or how to solve this problem

any help at all is well appreciated.

snowie

View Replies !    View Related
Help With Scaling Action Script Mx 2004
I have a problem with a scaler script that I have created with some help but I am having problem in that I cannot see the scalling object when the swf is launched I need to declare some sort of initial size preferably the size on button one below. The main object 'shirt6' becomes visable when I mouse over the buttons of the scaler so the scaler works I need help with the initial size.

This is the script I have on the frame;

current_x = _root.shirt6._xscale
new_x = Number(_root.new_X)
diff_x = current_x - new_x
move_x = diff_x/3
_root.shirt6._xscale = Number(new_x)+Number(move_x)
current_y = _root.shirt6._yscale
new_y = Number(_root.new_y)
diff_y = current_y - new_y
move_y = diff_y/3
_root.shirt6._yscale = Number(new_y)+Number(move_y)

This is the script I have on the buttons of the would be scaler;

button 1.

on (rollOver) {
new_x = 50
new_y = Number(new_x)
}

Button 2

on (rollOver) {
new_x = 55
new_y = Number(new_x)
}

Button 3

on (rollOver) {
new_x = 60
new_y = Number(new_x)
}

and so on up to

Button 10

on (rollOver) {
new_x = 100
new_y = Number(new_x)
}

I dont know where I'm going wrong or how to solve this problem

any help at all is well appreciated.

snowie

View Replies !    View Related
1000px Width Flash In 500px Width Div Problem
Hi

I've got one problem here...
I have 00px width flash, which goes in to 500px width div.

everything is ok. just flash is left aligned... i can't make it to laign to center.

div style overflow is hidden. so no scrollbars. just flash has to go center aligned... not left aligned, as it is now...

align="center" does not help...

thanks in advance

View Replies !    View Related
Scaling Images In Flash To The Scaling Of The Browser Window - Anyone?
Does anyone know how they are scaling these images to the size of the browser window but keeping all of the graphics the same scale?

Check out the portfolio section of this site to see what I mean.

Any Help??

http://www.paprika.com/

View Replies !    View Related
Basic Difference Between Flash Mx 2004 And Flash Mx 2004 Professional Version.
Could someone plz point out the basic difference between Flash Mx 2004 and Flash Mx 2004 Professional version?

View Replies !    View Related
Flash MX 2004/2004 Pro - Bring Back The Old Undo - Petition To Macromedia
Many of you will know that the removal of the movie clip specific undo is causing us enless hassles and this isn't one of those features that we just get used to, this is a serious workflow hindrance.

We have been discussing in this in more detail here if you want to read more first http://webforums.macromedia.com/flas...hreadid=709486

I don't want this thread to become another discussion about it as it has already been done, but I do want to get a petition together of emails or names which we can send to macromedia or maybe they will take notice here, so If you feel the same way that I do then reply here.

View Replies !    View Related
[I]Free Brainbench Flash MX 2004 / Dreamweaver MX 2004 Exams
Got it from one of the blogs and you should try it... I've got one myself... Not sure what I am going to do with it though...


Free Brainbench Flash MX 2004 / Dreamweaver MX 2004 exams ONLY for TODAY

http://www.gunthersoft.com/brainbenc...tional_special

"... ONLY TODAY, that's February 28th, Brainbench certification tests for MacroMedia Dreamweaver MX 2004 and Flash MX 2004 are sponsored, meaning, these tests which are normally $49.95 each are free for the TODAY ONLY!"

View Replies !    View Related
Integrate Flash MX 2004 And Director MX 2004
This is a dedicated thread for discussing the SitePoint article 'Integrate Flash MX 2004 and Director MX 2004'

View Replies !    View Related
Listbox Width = Longest Text Width How? Please Urgent.
hi there

i want to make the listbox as wide as the longest textentry, but i only have

_lb.setWidth()

and

_lb.setSize()

and those two are for pixel size???

does someone of you know how to do that

thx a lot

cheers marcel

View Replies !    View Related
Set Width Of A ComboBox Component Without Changing Width Of Arrow
Hi,

With actionscript I have put a few ComboBoxes on the stage and than tryed to change the width with:

setProperty(_root.container[ComboBoxName],_width,150);


It works, However the arrow-part in the combobox expands also. I don't want it to expand.

I want it to behave like when a put a combobox on the stage myself and adjust the width of it in the properties window.

In this case only the text-part expands... the size of the arrow doesn't change!

How can I do this?

View Replies !    View Related
Internal Clip Width Bigger Than Movie Width?
i have a movie that is 750 pixels wide. i have a movieclip inside this main movie called "menuBack" that is just a bit less wide than the main movie. this movieclip has several other clips inside of it. i set a variable on a keyframe in my main movie getting the width property of "menuback". of course i expected it to be just a bit less wide than my main movie, maybe 720 pixels wide. when i test the movie and then check debug/list variables, it say it is 1095 pixels wide...how is this possible?

flash 5 btw...

View Replies !    View Related
Dynamic Background Width/static Foreground Width?
I am trying to make a site with elements that resize dynamically depending on the browser width, but have the foreground element stay the same size all the time?

The first part is easy to do. If I set the height and width of the Flash file in the HTML to 100%, when the browser is resized, the Flash will also resize.

But I can't figure out the second part.

An example of what I'm trying to do is at Rilo Kiley's website

Another example is gskinner.com

No matter what your browser size, the background scales and the foreground is always the same width and height.

I am using Flash MX 2004.

View Replies !    View Related
Loaded Image.width Be Stage.width On Resize
Hello... I am trying to make a loaded image.width be the stage.width on resize... the same for the height... I'm tweening them also... and that seems to be working... well on the yx... not so much on the width.... If I use Stage.width directly in the tween it seems to not load the image... little lost here... thank you for any help...

jeremyBass

here is what I have which is the whole file

ActionScript Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;


// ***Stage aligned top left
Stage.align = "TL";
// *** Stop the stage from scaling with the browser window.
Stage.scaleMode = "noScale";
Stage.showMenu = false;
stop ();


image_mc1.loadMovie("http://hellscanyonsportfishing.com/images/testhead.png");
image_mc2.loadMovie("http://hellscanyonsportfishing.com/Scripts/flash/bk.jpg");
image_mc1._quality = "BEST";
image_mc2._quality = "BEST";
// initiate postitions and scaling values for objects

v = Math.random() * 6 - 3;
v = Math.random() * 6 - 3;
var curStageheight = Stage.height;
var curStagewidth = Stage.width;
imageHolder._height = curStageheight;
imageHolder._width = curStagewidth;
//var xScaleT:Tween = new Tween(image_mc1, "_rotation", Elastic.easeOut, 0, 10, 4, true);

var xScaleT0:Tween = new Tween(image_mc1, "_x", Bounce.easeOut, 0, -2*v, 3, true);
var xScaleT1:Tween = new Tween(image_mc1, "_y", Bounce.easeOut, 0, -6*v, 4, true);
var xScaleT4:Tween = new Tween(image_mc2, "_width", Bounce.easeOut, imageHolder._width*1.1, imageHolder._width*1.15, 3, true);
var xScaleT5:Tween = new Tween(image_mc2, "_height", Bounce.easeOut, imageHolder._height*1.1, imageHolder._height*1.15, 3, true);
var xScaleT2:Tween = new Tween(image_mc2, "_x", Bounce.easeOut, 0, 0-2*v, 2, true);
var xScaleT3:Tween = new Tween(image_mc2, "_y", Bounce.easeOut, 0, 0-8*v, 2, true);
xScaleT0.onMotionFinished = function() {
    this.yoyo();
};
xScaleT1.onMotionFinished = function() {
    this.yoyo();
};
xScaleT2.onMotionFinished = function() {
    this.yoyo();
};
xScaleT3.onMotionFinished = function() {
    this.yoyo();
};
xScaleT4.onMotionFinished = function() {
    this.yoyo();
};
xScaleT5.onMotionFinished = function() {
    this.yoyo();
};


image_mc1._y = 0;
image_mc1._x = 0;
image_mc2._y = 0;
image_mc2._x =  0;

//create a listner that checks to see if the browser window is resized
sizeListener = new Object();
sizeListener.onResize = function() {
    // change movieclip properties when the window is resized.
var curStageheight = Stage.height;
var curStagewidth = Stage.width;
imageHolder._height = curStageheight;
imageHolder._width = curStagewidth;


//create a random velocity for x and y direction
};
Stage.addListener(sizeListener);

View Replies !    View Related
Adjusting Text Tool's Width To Screen's Width
Hi all,

I'd like to know howshould I do to adjust text tool's width to screen's width automatically?

Because I want to insert my flash into a Visual Basic screen saver.
Regards,

Phil

View Replies !    View Related
Urgent Help Horizontal Xml Menu Width Needs To Be Text Width
Please could someone help me with the following. I have been through this tutorial http://www.kirupa.com/developer/act...opdown_menu.htm of the xml drop down menu. Made some adjustments with help from other posts to make it horizontal.

but the width of the buttons (menu items) need to be created/adjusted according to the text. and not according the movie it created.

Could someone help me solve this problem? I just can't get it done.


the as:
// generates a list of menu items (effectively one menu)
// given the inputted parameters. This makes the main menu
// as well as any of the submenus
GenerateMenu = function(container, name, x, y, depth, node_xml, direction) {
// variable declarations
var curr_node;
var curr_item;
var curr_menu = container.createEmptyMovieClip(name, depth);

// for all items or XML nodes (items and menus)
// within this node_xml passed for this menu
for (var i=0; i<node_xml.childNodes.length; i++) {
// movieclip for each menu item
curr_item = curr_menu.attachMovie("menuitem","item"+i+"_mc", i);
curr_item._width = childNodes.length;


if (direction == "horizontal") {
curr_item._x = x + i*curr_item._width;
curr_item._y = y;
}
if (direction == "vertical") {
curr_item._x = x;
curr_item._y = y + i*curr_item._height;
}

curr_item.trackAsMenu = true;

// item properties assigned from XML
curr_node = node_xml.childNodes[i];
curr_item.action = curr_node.attributes.action;
curr_item.variables = curr_node.attributes.variables;
curr_item.name.text = curr_node.attributes.name;

// item submenu behavior for rollover event
if (node_xml.childNodes[i].nodeName == "menu"){
// open a submenu
curr_item.node_xml = curr_node;
curr_item.onRollOver = curr_item.onDragOver = function(){
var x = this._x + this._width - 186.3;
var y = this._y + 26;
GenerateMenu(curr_menu, "submenu_mc", x, y, 1000, this.node_xml, "vertical");
// show a hover color
this.name.textColor = (0xFFFFFF);
var col = new Color(this.background);
col.setRGB(0x008185);
};
}else{ // nodeName == "item"
curr_item.arrow._visible = false;
// close existing submenu
curr_item.onRollOver = curr_item.onDragOver = function(){
curr_menu.submenu_mc.removeMovieClip();
// show a hover color
this.name.textColor = (0xCCCCCC);
var col = new Color(this.background);
col.setRGB(0x008185);
};
}

curr_item.onRollOut = curr_item.onDragOut = function(){
// restore color
this.name.textColor = (0x004445);
var col = new Color(this.background);
col.setTransform({ra:100,rb:0,ga:100,gb:0,ba:100,b b:0});
};

// any item, menu opening or not can have actions
curr_item.onRelease = function(){
Actions[this.action](this.variables);
CloseSubmenus();
};
} // end for loop
};

// create the main menu, this will be constantly visible
CreateMainMenu = function(x, y, depth, menu_xml){
// generate a menu list
GenerateMenu(this, "mainmenu_mc", x, y, depth, menu_xml.firstChild, "horizontal");
// close only submenus if visible durring a mouseup
// this main menu (mainmenu_mc) will remain
mainMenu_mc.onMouseUp = function(){
if (mainmenu_mc.submenu_mc && !mainmenu_mc.hitTest(_root._xmouse, _root._ymouse, true)){
CloseSubmenus();
}
};
};

// closes all submenus by removing the submenu_mc
// in the main menu (if it exists)
CloseSubmenus = function(){
mainmenu_mc.submenu_mc.removeMovieClip();
};

// This actions object handles methods for actions
// defined by the XML called when a menu item is pressed

Actions = Object();
Actions.loadSWF = function(targetMovie) {
if (section != targetMovie) {
section = targetMovie;
_root.transition.gotoAndPlay("closing");
};
}

Actions.newMenu = function(menuxml){
menu_xml.load(menuxml);
};

// load XML, when done, run CreateMainMenu to interpret it
menu_xml = new XML();
menu_xml.ignoreWhite = true;
menu_xml.onLoad = function(ok){
// create main menu after successful loading of XML
if (ok){
CreateMainMenu(1, 110, 0, this);
}else{
message_txt.text = "Error Loading XML";
}
};
// load first XML menu
menu_xml.load("menu2.xml");


// preload function and transition
this.createEmptyMovieClip("temp", 1000);
function preload() {
this.transition.txtPercentage = "";
temp.onEnterFrame = function() {
var t = this._parent.content.getBytesTotal(), l = this._parent.content.getBytesLoaded();
if (t) {
var percent = Math.round(l*100/t);
if (l == t) {
this._parent.transition.gotoAndPlay("opening");
this._parent.transition.txtPercentage = "Done Loading";
delete this.onEnterFrame;
} else {
this._parent.transition.txtPercentage = percent+" %";
}
} else {
this._parent.transition.txtPercentage = "";
}
};
}




the xml:

<?xml version="1.0"?>
<menu name="example">
<item name="MISSIE" action="loadSWF" variables="home.swf"/>

<item name="OVER het bedrijf" action="loadSWF" variables="shutter2.swf"/>
<item name="EXPERTISE" action="loadSWF" variables="shutter2.swf"/>
<item name="BENADERING" action="loadSWF" variables="shutter2.swf"/>
<menu name="WERK DAT WERKT">
<item name="Graphic Design" action="loadSWF" variables="graphics.swf"/>
<item name="Flash Design" action="loadSWF" variables="flash.swf"/>
<item name="CSS/HTML/JS" action="loadSWF" variables="css.swf"/>
</menu>
<item name="MENSEN" action="loadSWF" variables="shutter2.swf"/>
<item name="WERKEN BIJ het bedrijf" action="loadSWF" variables="shutter2.swf"/>
<item name="CONTACT" action="loadSWF" variables="shutter2.swf"/>




<menu name="MISSIE">
<item name="Graphic Design" action="loadSWF" variables="graphics.swf"/>
<item name="Flash Design" action="loadSWF" variables="flash.swf"/>
<item name="CSS/HTML/JS" action="loadSWF" variables="css.swf"/>
</menu>

<item name="Careers" action="loadSWF" variables="careers.swf"/>

<menu name="Downloads">
<item name="Application" action="loadSWF" variables="appform.swf"/>
<item name="Other Forms" action="loadSWF" variables="other.swf"/>
</menu>


<item name="Contact" action="loadSWF" variables="contact.swf"/>
</menu>[/quote]

View Replies !    View Related
Loaded Image.width Be Stage.width On Resize
Hello... I am trying to make a loaded image.width be the stage.width on resize... the same for the height... I'm tweening them also... and that seems to be working... well on the yx... not so much on the width.... If I use Stage.width directly in the tween it seems to not load the image... little lost here... thank you for any help...

jeremyBass

here is what I have which is the whole file

Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;


// ***Stage aligned top left
Stage.align = "TL";
// *** Stop the stage from scaling with the browser window.
Stage.scaleMode = "noScale";
Stage.showMenu = false;
stop ();


image_mc1.loadMovie("http://hellscanyonsportfishing.com/images/testhead.png");
image_mc2.loadMovie("http://hellscanyonsportfishing.com/Scripts/flash/bk.jpg");
image_mc1._quality = "BEST";
image_mc2._quality = "BEST";
// initiate postitions and scaling values for objects

v = Math.random() * 6 - 3;
v = Math.random() * 6 - 3;
var curStageheight = Stage.height;
var curStagewidth = Stage.width;
imageHolder._height = curStageheight;
imageHolder._width = curStagewidth;
//var xScaleT:Tween = new Tween(image_mc1, "_rotation", Elastic.easeOut, 0, 10, 4, true);

var xScaleT0:Tween = new Tween(image_mc1, "_x", Bounce.easeOut, 0, -2*v, 3, true);
var xScaleT1:Tween = new Tween(image_mc1, "_y", Bounce.easeOut, 0, -6*v, 4, true);
var xScaleT4:Tween = new Tween(image_mc2, "_width", Bounce.easeOut, imageHolder._width*1.1, imageHolder._width*1.15, 3, true);
var xScaleT5:Tween = new Tween(image_mc2, "_height", Bounce.easeOut, imageHolder._height*1.1, imageHolder._height*1.15, 3, true);
var xScaleT2:Tween = new Tween(image_mc2, "_x", Bounce.easeOut, 0, 0-2*v, 2, true);
var xScaleT3:Tween = new Tween(image_mc2, "_y", Bounce.easeOut, 0, 0-8*v, 2, true);
xScaleT0.onMotionFinished = function() {
this.yoyo();
};
xScaleT1.onMotionFinished = function() {
this.yoyo();
};
xScaleT2.onMotionFinished = function() {
this.yoyo();
};
xScaleT3.onMotionFinished = function() {
this.yoyo();
};
xScaleT4.onMotionFinished = function() {
this.yoyo();
};
xScaleT5.onMotionFinished = function() {
this.yoyo();
};


image_mc1._y = 0;
image_mc1._x = 0;
image_mc2._y = 0;
image_mc2._x = 0;

//create a listner that checks to see if the browser window is resized
sizeListener = new Object();
sizeListener.onResize = function() {
// change movieclip properties when the window is resized.
var curStageheight = Stage.height;
var curStagewidth = Stage.width;
imageHolder._height = curStageheight;
imageHolder._width = curStagewidth;


//create a random velocity for x and y direction
};
Stage.addListener(sizeListener);

View Replies !    View Related
Adjusting Text Tool's Width To Screen's Width
Hi all,

I'd like to know howshould I do to adjust text tool's width to screen's width automatically?

Because I want to insert my flash into a Visual Basic screen saver.
Regards,

Phil

View Replies !    View Related
Vector .eps Into Flash
I'm using mac g4, flash mx

I'm trying to import a vector graphic from illustrator, but every time I do so my flash movie freeks out and just shuts down with no explanation....
What's up??
I have never imported a vector graphic into flash before,
so please help...
I have read the help section in flash & follwed it, see below:

These are the steps I have followed so far:

1)Converted the vector graphic from CMYK to RGB within Illustrator

2)File-Import,

3)In the import dialog box :
Adobe Illustrator from the Show(macosX) files of type(windows)
pop-up menu

4)navigated to the illustrator file and selected it

5) then OPen in mac

6)For convert layers it gives you a couple of options: I just leave it on the default settings becasue I only have one layer to import.

anyway, i tried them all, but flash freeks out and closes and when i open it back up it reverted to the last saved state.

WHATUP??

View Replies !    View Related
Difference Between Flash MX 2004 And MX 2004 Pro
What exactly is the advantage over MX with MX Pro?

View Replies !    View Related
Flash MX 2004 And Dreamweaver MX 2004
Please help,,, Im doing a flash AD. when you click on the add it disappers... now when i run i through my webpage done by Dreamweaver it dosent disapper or clear... this is the webpage address http://users4.ev1.net/%7Esuzuki9/
this is what i write but it doesnt close or quit...

on(press){
fscommand("quit");
}

anyone has an idea how to do it....
by the way when i run this flash movie by itself as SWF and press on it it works i mean close, but from Dreamweaver it doesnt.....

View Replies !    View Related
No Resize/scaling A Movie Clip On The Scaling Stage...
I know this has probably been answered here already, but I've search through all the threads with "scaling" and "resizing" and can't find the solution.

Basically I have a GUI element on a gallery that I don't want to scale, while the rest of the page is free to resize/scale.

I think I need to add a listener of some sort to the stage, but I'm not sure how to do this. If you can point me to a thread where this has already been answered, great! Otherwise I would be grateful for any help you could provide here.

View Replies !    View Related
Need Vector Art For Flash Movie
Hey, i'm making a flash movie and i need some pre-made objects, i'm not very good at fine art vector drawing in Flash! I need things like a Cat, Stove, dishes, jars with Mineral Water, Stationary etc.. Is there some place or some way i can get these things/objects that i can use in my movie and animate them perhaps. I don't want Images. I want vector art that can be perhaps modified in flash if required!

thanks!

View Replies !    View Related
Flash MX And OS X: Vector Degradation
Flash MX is chewing up my vector artwork when I use it in Mac OS X. Complex artwork created in Illustrator and imported or copied and pasted into Flash MX looks fine in OS 9.2, but terrible in OS X. It looks like the vectors have been crudely re-traced.

I'm also having problems printing from FlashMX/OS X. I get the same"re-trace" artifacts on my fonts.

Is there a fix for this? I''ve been working around it for 4 months by sticking with OS 9.2. But I'm now stuck with a printer that only works with OS 8 or OS X. And sooner or later, I'm going to have to switch to OS X full time.

Thanks,

-Nina

View Replies !    View Related
Photoshop Vector To Flash (MX)
I have made a vector path in Photoshop and would like to get it into Flash... Is there any way to do this? Ive tried exporting to .eps and importing it, but it claims the file is missing something or everything

View Replies !    View Related
Copyright 2005-08 www.BigResource.com, All rights reserved