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








Can I Resize A Flash Movie To User Defined Variables?


Hi Everybody,

I'm using Flash MX. I'm looking for a way to resize a flash movie from within flash, using a X and Y variable. So far I can figure out how to scale a movie to fit a screen, but not to a specific number. Anyone have any idea as to how I would go about doing this?

-Plasnid




FlashKit > Flash Help > Flash ActionScript
Posted on: 07-23-2004, 11:31 PM


View Complete Forum Thread with Replies

Sponsored Links:

Flash Menu Buttons And User Defined Variables
Okay--maybe somebody can help me on this bugger. My brain is fried over it. I will email the fla file and a giant cookie to anyone who can help. I have two issues for a flash navigation menu that contraols a non-flash page:

1)I want to show the current page as "active" by altering the corresponding MC. I am trying to reference instance names of seprate mc's (totally seperate, not duplicates) in order to change their appearance according their state (active, as in the HTML page it is pointing to is active VS. inactive). I have 12 mcs named mc1-mc12. Each mc has a button inside. The code for the MC is:

Code:
onClipEvent (load) {
skal = 0;
}
OnClipEvent (enterFrame){
if (skal ==1){
_xscale = _xscale+(150-_xscale)/3;
_yscale = _yscale+(150-_yscale)/3;
}
if (skal ==0){
_xscale = _xscale+(100-_xscale)/10;
_yscale = _yscale+(100-_yscale)/10;
}
if (skal ==3){
_xscale = 150;
_yscale = 150;
}
}
The code for the button in the mc is:

Code:
1 on (rollOver, dragOver){
2 skal = 1;
3 }
4 on (rollOut, dragOut){
5 if (Active ==1){
6 skal = 3;
7 }else {
8 skal = 0;
9 }
10 }
11 on(release) {
12 Active = 1;
13 GetURL("help.htm","_self");
14 }
Basically, the buttons expand and contract as you roll over them and link to a specific URL. I would like to address the problem of indicating which page on the nav menu the user is currently visiting. My idea was to insert these lines between line 13 and 14 of the button:

Code:
tellTarget(mc1){
Active = 0;
}
//repeat for each button instance name
Each button would have to be addressed so that when you click on a button, it sets the variable "Active" to 1 for the button you clicked and 0 for the rest of the buttons.
Basically, the button is supposed to freeze at _xscale = 150 until another button on the menu is pressed.

It's not working. Is there a beter way to do this? I just want the button to stick out to make it pbvious that that is the page they are looking at.

2)My bigger problem arrose when I was told to nix the frames on the website. Now when a button is clicked, it goes to a new page with the same swf file on it, but it reloads the file. Is there a way to prevent reload and allow it to maintain it's state whil the even when the page changes?

The beginings of the menu are on (The page is in SERIOUS overhaul mode, so pardon the ugliness) this link still uses frames. I have not uploaded the non frames version yet, but the problem is easy to visualize...the movie retarts when you nav to a different page:
http://www.themitchellcentre.ab.ca/T...e/testpage.htm

Thanks for any help.

PS--I tried everything to make the individual buttons stick out, I tried making the text dymanic and chaniging the color, I tried stopping th emovie, I tried, all I could think of, but nothing worked while maintaining the rollover movement. Thanks.

http://www.taigraham.com


Email my personal account

View Replies !    View Related
User Defined Variables
help?

i was wonderin: is there a way to make a flash movie where the user defines the text variables? I am using flash 5, and think this will be a REALLY simple thing 2 do, but im a newbie

any help will be greatly appreciated

View Replies !    View Related
User Defined Variables
How can I have the user define a global variable via an input/ dynamic box?

View Replies !    View Related
User Defined Variables
How can I have the user define a global variable via an input/ dynamic box?

View Replies !    View Related
Accessing User Defined Variables In A Text File...
I have a text file (let's call it "test.txt") which has a string of variables and their corresponding values. In my flash application, I have a TextInput component for a user to type their name, and a ComboBox component for the user to choose a value.

I want to be able to use the name the user typed in to jump to the variable in the test.txt file and modify its corresponding value.

I figured something like this would work:

code:
var result_lv:LoadVars = new LoadVars();
var login_lv:LoadVars = new LoadVars();

login_lv.username_ti.text = combobox.value;

login_lv.sendAndLoad("test.txt", result_lv, "POST");


However, the big problem is, it doesn't seem to like "login_lv.username_ti.text" -- using 'trace', it's always showing up as undefined.


Basically, if the user types 'Bob' as his name, I want to modify login_lv.Bob, but I don't want to have to do this with a whole bunch of 'IF' statements. Is there something I'm missing, or is there a better way to do this altogether?

Thanks!

-Tom

View Replies !    View Related
User Defined Variable Sets Which Movie Loads...
I am getting frustrated on this i am hoping one of you would be nice enough to help me out.

I have a movie that starts with an input text field and a submit button. This is asking the user for a promotion code. When the user types in a code and hits submit or types in no code and hit submit the movie plays.

At the end of the movie, I am trying to write a script that will basicly load a movie onto another layer if there is a corresponding file named after that promotion code they entered...

Another words if they entered "promo35" in the input field. At the end of the movie the script would try to fire promo35.swf. If this promotion doesnt exist the movie will just end. If this promotion is valid the corresponding swf would load onto a layer.

Please help i cant re-use the user input properly its driving me mad.

//D

View Replies !    View Related
Can VB Call A Flash's User Defined Function?
Hello,

I know there are a lot of questions about VB-flash communication, but unfortunately, they don't match my problem

I have a function in Flash, named processIt()

I want to call this function by VB.
Code:

Call ShockwaveFlash1.processIt(); => doesn't work
but:
Call ShockwaveFlash1.SetVariable("myVar", "aaa"); => will work

Could you explain me why? An please give me an example of calling user defined function.

Thanks a lot,
Sathish

View Replies !    View Related
Calling A User Defined Flash Function From A Web Page
Can someone tell me if this is possible. I've got a flash navigation movie in the top frame of a 2 frame web page. Inside the swf I've written a function called "open menu" that takes 3 parameters and does what it sounds like it does within the flash navigation.
My question is ..
Can I call this function and pass in parameters from an html page and have the flash navigation react the same way as inside the swf itself ? I've got an "href only" nav bar on the bottom of the page in the main frame that has
the same navigation elements as the flash navigation and I'd like the top navigation to react accordingly.

Is this possible and if so how.
Thanks in advance

View Replies !    View Related
How To Control Flash's User Defined Function From JavaScript?
please help,...i can send variable from javascript...but dont know how to make flash do function

View Replies !    View Related
Calling The User Defined Function In The Flash From The Html
if we write a function in flash...
how could we invoke function from the html..

View Replies !    View Related
*Help* Letting The User Resize Movie Clips
Hello

I am currently designing a drag and drop game for children for my degree. I have the drag and drop bit sorted but i also want the child to be able to resize number of shapes (which are movie clips) as well as drag them. I am currently using flash 8 and I was wondering if anyone knows any code to resize movie clips? also rotation would be helpful! Hope someone can help! Cheers

Rich

View Replies !    View Related
How To Auto Resize The Movie Depeending The The User's Resolution?
How to auto resize the movie depeending the the user's resolution?

View Replies !    View Related
Anyway To Resize The Swf Movie When The User Changes Browser Window Size?
Anyway to resize the swf movie when the user changes browser window size? Thanks!

View Replies !    View Related
User Defined Text
Can anyone point me in the direction of a tutorial on how to : I want the user to be able to enter text into an entry box and then define colour and apply it to the design the have coloured.

View Replies !    View Related
User Defined Text
Can anyone point me in the direction of a tutorial on how to : I want the user to be able to enter text into an entry box and then define colour and apply it to the design they have coloured.

View Replies !    View Related
User Defined Images?
Hey all,

A potential client of mine is interested in selling T-shirts online. He wants an online "t-shirt designer" that I would really, really prefer to do in Flash (as opposed to plain html with jscript, etc). Basically the user would see an image of a blank tshirt, select the color, slogan, and choose an image from a selection of choices that would then be superimposed on the shirt.

There are several thousand gif images that need to be options for the shirt design. Obviously I don't want a Flash movie to have to preload several thousand gifs as objects that aren't going to be used. What I had in mind was having the user pre-select the image via php, then have the image passed to the flash movie, but I'm not sure if this is possible.

So my question is:

Is it possible to pass images from an html (php/jscript) window to a flash movie?

Maybe Flash isn't the way to go about doing this project. Any suggestions, options, directions to relevant tutorials, are welcome. Hope I made this clear enough.

Thanks.

View Replies !    View Related
User-defined Customizations
Hi,

this my first post.

I am designing a flash site where it allows the user to customize the interface, including, background, colors, buttons, styles, etc...

Anyone know a goot tut for that subject?

I am currently intermediate with flash and any help would be most excellent.

jbonham

View Replies !    View Related
User-Defined Data
I need to build a website for a client who is a golfer. He wants to be able to upload his stats daily from his website to his website. I'm not new to Flash but coding is not my thing. I use Flash 8.

View Replies !    View Related
User Defined Converter
This seemed simple to me but am having difficulties finding a solution. All I want is an input text box that the user can type into. When a button is clicked it takes this data and does a sum on it, then displays it in a results, dynamic text field. Any ideas. I'm sure other people will find this code very useful.


So for an example how could i times the inputBox number by 10 and divide by 2?

Thanks

View Replies !    View Related
User Defined Pop Up Messages
I remember doing this in my very brief VB scripting days, but is there a way to have a message pop up in actionscript. Or is it a case of making your own and adding it is a child?

View Replies !    View Related
User Defined Components
Hello pls help me, does any one know how to create a user defined button in FlexBuilder3.0 using mxml. if any one knows help me.
Like buttons, radio buttons, etc... user components
what ever shape we want

View Replies !    View Related
User Defined Components
Hello pls help me, does any one know how to create a user defined button in FlexBuilder3.0 using mxml. if any one knows help me.
Like buttons, radio buttons, etc... user components
what ever shape we want

View Replies !    View Related
User Defined Colour Scheme
Ok people here is something to really challenge you Flash gurus. Im not even sure this is possible but Ive no doubt that if it is this is the place to find out! Anyway what I am tying to do is have a user defined interface so at the start the user chooses what colour background they want (which is definately possible, check out www.bda.co.uk for proof) and also what colour boxes there are etc. What im wondering is if there is any action script or other methods for changing the colours of symbols? perhaps some kind of tint command or something better! Any ideas would be great but like i said im not even sure this is possible!

Many thanks
Croogish
www.kormagraphics.com

View Replies !    View Related
[F8] Game - User Defined Controls
I wanted to add user defined keyboard commands for my flash game, I was wondering if there was any tutorial out there on this subject. So far I have not figured out how to do it on my own. So im up for some learning.

Thanks homies!

View Replies !    View Related
[CS3, AS2] Typeof With User Defined Classes
Hi,
I'm trying to check the data type of some parameters. one of the parameters will be a class I defined. I read though, that using typeof on a user defined type will just return "object"
is there any way I can extract the actual user defined class's name from the parameter?

View Replies !    View Related
User Defined Email Button
I've got a good one for you.

I want to pull an email address from a dynamic text field (email) and assign it to the "getURL:mailto" action of a button.

Is this possible?

I have created a website template that the user cusomizes via external text files. When someone goes to the website - I want a button to open the default mail program (getURL:mailto) and setup an email to whomever the dynamic text field displays.

My thought would be to create a variable that captures the email address from the (email) dynamic text field. Then apply that variable to the button action.

View Replies !    View Related
User Defined Fills In Actionscript?
I have a simple drawing program where the user can draw lines of varying widths on the screen.

I have seen some tutorials about defining the fill of lines that you set in the script but would it be possible to have the user, for example, select a paint brush and click on an enclosed object that they have drawn and fill it with whatever color they choose?

if so, does anyone know where a good tutorial is?

View Replies !    View Related
How To Expose User Defined Functions
Hi everybody...!!

My question is very simple: how can i make available from JavaScript my own function, defined inside a Flash movie?

I need to access this function as the SetVariable is accessed from JavaScript.

Example:

document.MyFlashMovie.MyDefinedFunction("","");

thanks in advance for the replies!!!!!

View Replies !    View Related
User Defined Random Amount
i want to have an input amount that a user can put it to define how much random there is.

Code:
on (release){
var i:Number = Math.ceil(Math.random()*//i want this to be whatever the user enters in the input box\);
gotoAndStop(i);
}
any help would be appreciated

View Replies !    View Related
User Defined Scaling Of Movieclips
I was wondering if it is possible in Flash CS4 to have a movieclip that can be scaled by the user once the file has been posted on the web. Scaling by dragging the corner of a loader or something?

View Replies !    View Related
User Defined Scaling Of Movieclips
Is it possible to have a movieclip in FlashCS4 that can be scaled by the user once the file has been posted on the web? Scaled by dragging the corner of a loader or something?

View Replies !    View Related
Trouble Assigning A User-defined Value For A Var
I'm creating a psychology experiment. I have a setup that adds a movie clip and then the user rates the picture. When the user clicks a button, the score will be sent to a database file using Flashstudio pro. I haven't written the code to send to the database yet; right now I'm just trying to assign the value of the rank to a variable so it can be sent to the database.


I'm having trouble setting the value of a variable. I think it would be easier to download my fla to see what I'm trying to do rather than explain in words in this message. Below is the fla file and the actionscript file included on the first frame. I set up a few tracers. The part I'm talking about is in the _root.trialcycle.alpha movie clip on frame 6 of the main timeline.

So again, my question is how do I assign the value of the score to a variable?


http://web.mit.edu/gmarz/Public/flash/alien_exp.fla
http://web.mit.edu/gmarz/Public/flash/marzlovia.as

Any help would be appreciated. Thanks.

View Replies !    View Related
Export With User Defined Conditions
Hello,

I was wondering if Flash MX 2004 has a user defined export option? I am trying to find a customizable version of "omit trace actions". I have a debug function, that i don't want in the code when I send it to the client. Is this possible?

-matt

View Replies !    View Related
Scope Of A User Defined Function
i want to manipulate the value of a variable passed as a parameter of a function, the problem is there is some sort of scope issue that won't update the variable outside the function. here is the example:


Code:
//there's the variable i want to manipulate
fakeVar=100;

function mult(whichVar){
//let's multiple the variable by 2.
whichVar*=2;
trace(whichVar) // traces 200...correct.
trace(fakeVar) //traces 100, the original value, not correct
}

box.onRelease=function(){
//call the function with the variable i want to update.
mult(fakeVar)
}
the problem is that the function passes the variable correctly and uses it in the script, but when the function ends the variable i passed in isn't updated to the new value anymore as demonstrated by the traces...

any clue how to make a function change a value of a variable outside its scope?

View Replies !    View Related
Problem With User-defined Functions
i was making a funtion that loaded external movie clips
i had some trouble figuring out how to pass the movie name into the function.

would it be better to pass the movie name as x and have loadmovie("x.swf", 1) or would it be better to have x = 1 to someting and then use if, then statements to select depending of what number wat movie to load

if anyone could hlep, mad props, thax

View Replies !    View Related
How Do I Jump To A Frame Number Defined By User HELP
What I am developing is a kind of ebook, with each page of the book corrosponding to a frame number. ie. page 12 is frame 12. I wish to incorporate a 'go to page number ...' option. This is to allow the user to skip to a certain page/frame, without having to skip one page at a time.
What needs to be done is to save the user input as a variable 'x' and to get flash to gotoandplay 'x'. One can only enter actual numbers into the gotoandplay command and this makes the above quite tricky.
I look forward to any suggestions.

Thank you,
Will

View Replies !    View Related
User Defined Custom Keys For Games?
How can I take input text and make it a key that is used to do an action in a game?

I have a fighting game at http://www.spiritonin.com/stuff/capoeiragame.html
it's lots of fun, but several people have requested to be able to customize buttons. Please HELP!!

View Replies !    View Related
Can We Call A User Defined Function From Javascript ?
Hi!
Can we call a user defined function in a flash movie from a java script call. to my knowledge it(javascript) doesn't let us call user defined function. But....I badly need it to call one!
Is it possible ?

Thanks!
-mav

View Replies !    View Related
Font Color In User Defined Function
Hi,

I am loading text from an XML file with 500 records. This works fine, but these records average three links in each one. I am forced to create user defined functions for most of these links due to the length of the url. I would like to add the font color blue to each of the functions instead of inserting over a thousand font tags into the xml document.

I hope that's clear. Here's one of functions:

function L19550() {
getURL("http://samplelinkthatgoesonforever.htm");
}

The link works, but it would save me a ton of work if I could include the font color inside each of these functions.

Thanks a bunch,
Debbie

View Replies !    View Related
User Defined Remote Image Display?
this post can be deleted i found a solution.

View Replies !    View Related
Calling A User Defined Function In Imported Swf?
I'm a c# dev and done lots of PHP, but this is confusing the **** out of me, i cant figure out how to call a simple function.

This is the deal. i am making a menu that also has a mp3 player on it, and when a user clicks a "video" link on the menu, it pauses the mp3 player.

The menu uses actionscript and the layer 1 : Frame 1 simple includes this external like this - > #include "menu.as"

The mp3 player is purchased, i dropped it into the menu, i imported all the stuff and i dropped it in. If i play the video as a "test movie" it works perfectly, so i know that the functions are executing as expected.

What i need to do is call my child object with the function that is included within it called "pauseplayer".

From my actionscript "menu.as" - i expected to be able to do this.

if(this.mc_Text.tText.text = "THEN")
{
//This is where we need to stop the mp3 player (set it to pause).
mp3_player_without_skin_small_mc.pauseplayer();
}

But this is not working, no matter if i make the function in the child swf public or what not. The child is showing up as a Symbol definition and its really confusing how to use the internal functions to that movie.

PLEASE help me.

View Replies !    View Related
User Defined Background By Color Picker
Is there a way I can present the option of letting the users of my page pick the background color (or a symbol covering the background)? I found a component by Leadesignuk.net that shares a component, but it has a limited pallette.

I am selling framed photographs and i want the user to have the option to pick the background color behind the frames to see how it matches.

you can see what I mean at www.stevenewport.com and go to "prints"

is there a way I can code this?

View Replies !    View Related
Creating A EmptyMovieClip With A User Defined Class
I have a class fully defined, and Im populating an array with emptyMovieClips... How would I go about doing that?
I tried seting the superclass of my class to the MovieClip class, and than just populating the array with instances of my class... after that I called the class method that loads a Jpeg into the clip but it does not function.
Any suggestions? I appreciate it.
thanks

View Replies !    View Related
Font Color In User Defined Function
Hi,

I am loading text from an XML file with 500 records. This works fine, but these records average three links in each one. I am forced to create user defined functions for most of these links due to the length of the url. I would like to add the font color blue to each of the functions instead of inserting over a thousand font tags into the xml document.

I hope that's clear. Here's one of functions:

function L19550() {
getURL("http://samplelinkthatgoesonforever.htm");
}

The link works, but it would save me a ton of work if I could include the font color inside each of these functions.

Thanks a bunch,
Debbie

View Replies !    View Related
User Defined Class - Properties & Methods
If I create a class and set up one property which is a variable initiated at the start of the class but not within a function or a constructor and I reference the property from the .fla in a for loop as:

Book is the class and myBook is the new object.

myBook:Book = new Book(); // (fla script).

for(var prop in myBook) {
trace(prop);
}

the .AS contains

Class Book
{

var myProp:Number = 0;

function Book() {
}

}

The trace does not return anything. However when I include myProp (the class variable) in a function (other than Book function) and call that function from the .fla then the trace works and I can see myProp.

I would be grateful if someone could explain: Do I need to include Class variables in called functions (methods of the Class) in order for them to be properties of the Class?

thanks in advance

View Replies !    View Related
Calling Encapsulated User Defined Functions
Im currently trying to write an Area Replacement piece of code, simply a loadmovie instance with a loader, but entirely encapsulated within an MC

that i could use numerous places within my projects, and to keep the code neat an elegant..

the problem atm im having is, i am trying to call a function declared within the MC, from the main movie..

at current im simply trying to call it like so:

instancename.functionname( arguments );

instancename being an instance of the MC that contains the Function {} declaration and code..

however, its just not working.. it doesnt call the function at all, as i have tested with various debug methods, and nothing is happening..

can anyone shed some light on where im going wrong ? Or if there is any other way to pass arguments into an MC, as id like to keep the entire loading code within this movie clip if possible

Cheers, Maz

View Replies !    View Related
Providing A User-defined System Language
I have ask a day before how to define system language, and I didn't found any solution. So googling is good thing .

I think the easy way for beginers and for noncoders to make a multilanguage is to use string panel. It makes xml's and you can add custom language . String panel is designed to set language from system language, but I found a "hack" that allows you to set manually language. link

Here is a tut in livedocs how to use String Panel.

I had problem, I solve it and I think that is good to share it

gotoAndFlak();

View Replies !    View Related
How To Pass The User-defined Fuction To/from The Movieclip?
On the _parent timeline, I created an user-defined function, so that it can be accessed by the script inside one of the movieClip and be able to reach out to tweak the property to the other movieClip. I wonder how to do that? I know that I can do the _global but it only work with the variables. I have no idea how to do that with the function. So, any example here that would be very helpful. I did the Google search and it only talk about the object and class.

Thanks..
FletchSOD

View Replies !    View Related
Importing A Picture To A User Defined Target Size
I need some help specifying a targets dimensions so that when I load a picture (which is a movie) into it, it will be the size I want it as and not scale to a bigger size.

Thanks you in advance.

View Replies !    View Related
Sorting User-defined Numbers Largest To Smallest?
Hi,

I am looking for a way to sort numbers enterred by a user, prefferably in order smallest to largest or vice verser - but at very least to find the smallest & largest numbers of the ones enterred.

There are approximately going to be 15 numbers or so.

So for example:

Enterred A = 56
Enterred B = 7
....
....
Enterred H = 72

then it should display:

Enterred B = 7
....
....
Enterred A = 56
....
....
Enterred H = 72

when sorted or the other way round (largest to smallest).

this could be done with comparrisons but for 15 numbers it would be A LOT of comparisons.

Does anybody know an algorithm or a way of doing this more simply ?

Array.sort may do it but not sure if it works for numbers?

Any help is much appreciated!

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