ActionScript 3.0 :: Resize All The Elements Independently?
Mar 8, 2011
I am currently working on a project that needs to be resized depending on the size of the browser. I do not have much trouble in terms of coding it, but I have some 'good practice'
I cannot just resize the background of my swf et change the position of the elements on the scene; I need to resize all the elements. So I'm wondering about the text... My main swf is contained in a loader, so I could simply resize it ( the main swf) and all the elements would follow. The problem is I will end up dealing with half pixels and I guess my swf will look filthy...especially the text! Do you think it would be better ( but a lot more fastidious) to resize all the elements independently?
How would I make only some elements of my movie resize to fit the screen?For instance: I have a 2000 px wide movie and inside it a centered 1000px wide MC which will aways fit the screen while other elements (the background for examle) won't resize.
I am trying to create a fullscreen chat program using Flash AS3, and so far, everything is going well, except for when the window is resized, the whole thing is proportionally resized.I would like it to ONLY resize the chat text area, when the resize is done vertically, keeping the controls the same height consistently, also I would like the buttons for sending the chat to maintain their size, with the input box increasing in width when the size is increased horizontally.Obviously the SWF resizing will be done by JavaScript/jQuery .onResize() and thus I will be able to set a mimimum width and height for the swf, maintaining usability.
I'm new to flash, so I am sure I am missing something basic, but I have not been able to reference movie clips independently in code. I have set an instance name on each symbol, but when I reference in code it is undefined.
If it matters my project is set up this way:Using Flash 4 Pro. Layer one: Static Background Layers two-five: individual movie clips Layer six: transparent buttons over the movieclips.The buttons work fine, but I wanto to play the movieclips on mouse over.
I am new in Flash actionscript, and I have a very simple request. I have a Flash file with one button on it. When I click on the button, it will play a small clip. Now what I want to do is to have that small clip as a separate Flash movie; so it will load only if I click on the button. How do you do that
I have 5 or so mcs on the same layer. I would like each one to preload, and then show when they have loaded - so you might see each mc appearing in cannon, or staggered. All five will not show at once.However, it doesnt seem like the preload code is working for each mc, everything just appears. I have simulated download when I view the mc. Is my problem with the code or how I am testing the movie?Within each mc i have this code on frame one :
I am (trying) to build a Banner for my companies website in AS3. I am currently using CS5 with the Greensock TweenLite package.
I want product images to slide in from the right of the screen, pause for 5 seconds, and then reverse() out of view.
The 11 different product images are assigned to variables a - j .
I also have an independent timer function that I would like to fire 5 seconds after the image has been on screen.
My problem is that I cant get the Timer to work independently with each function without writing a function for each variable (which pretty much defies the point of functions and variables...amirite?)
Does anyone know the best way to have Flash cycle through each image 1 at a time?
a.reverse() works...but is there anyway to say, like...currentMc.reverse instead?
I want to make these kind of game [URL] but in more compleks route, and i want to make the car can choose direction (straigt, turn left of turn right) but 1st thing 1st. i need a logical state for the timeline how the car works? how can i set the car run independently? because it can't be done in the main timeline. i'm guessing it has something to do the the action script, but i have no idea. i'm kinnda new to flash, this is the 1st time i want to create a AI-like programing with flash.
I have two movie clips embedded on my timeline each with a button that on release plays the clip. I want them to play independently so that when i click on the first video it just plays that video and not both. The same for the second video for it to just play the second video.
I'm working on a project in which sound plays an important part. I want to be able to adjust the volume of two sounds independently, �nd have access to the position in the soundfile. The code below plays 2 soundfiles ("L36 Bass.wav" & "L36 Perc.wav"). The sounds are declared as 'new Sound' with qualifiers("L36Bass" and "L36Perc" recpectively) in line 03 & 04 within empty movieclips, to allow individual volume-adjustments. The volume-mix between the 2 is then governed by the x-mouse position (line 10 - 16):
[Code]...
This works just fine (as long as the WAV-files are in the library and the option 'Export for Actionscript' is selected). However, when I try to access the position within a soundfile with the statement SndBass.position; this results in an 'undefined-error'. When I remove the qualifier in line 03, and go for 'SndBass = new Sound()' in stead of 'SndBass = new Sound("L36Bass")', the property SndBass.position is available, but, as expected, the individual volume-control is lost.
My question. How do I control a movie clips FPS independently of the main time line. I believe in the previous version of Flash this was not possible but I think it can be done with CS4 with AS3.
I have five images with motion add to them. One fades out while the next fades in. To get this to work slower then the main time line I would have to add a lot of frame for that movie clip to not run so fast. Which this will make the file size larger.
I need this movie clip to run at say 12 FPS instead of the 24 the main timeline is running at.
Using Away3D, I've successfully displayed a cube. So far, if I want to display a texture on each side of the cube independently (different textures on each side), I'd have to put them all in one texture, kind of like a sprite map. Is there a way I can do this so I can apply a different bitmap to each side of the cube? Here's my code so far:
[Embed(source = "texture.png")] private static var _texture:Class; var texture:Bitmap = new _texture(); cube = new Cube(new BitmapMaterial(texture.bitmapData),240,240,240); cube.material.smooth = true; cube.material.mipmap = (texture.width == texture.height);
I'm finding lots of ways to change the "speed" of a loaded mp3 file. However, is it possible to only change the pitch or tempo (and not both at the same time)?
I have this problem...no worries it is only about ActionScript! I have created two movieclips: one is called "sun_mc" (with a nice smile) and a ring of sunrays (short and long ones) called "ring_mc".the ring is situated around the sun.
The user clicks the sun and drags to rotate it.The user can click the ring to rotate that too.When the sun is rotating...the ring should not be...and vice versa.
I have three problems...
1) I can't get the two mc's to move independently 2) When rotating the mouse position always jumps to a certain point on the movieclip...not the point where you clicked it first 3) The ring is also rotating when the mouse is outside the ring...
What should I do?I tried to obscure a part of the ring_mc with some masking...That didn't work.Should I try hitTest? And how should I do that? That only works with squares doesn't it?
I've had to work on a god-awful Flash movie with lots of nested hand animated movieclips and sub-clips, all with their own timeline.Every time I'm asked to update it, I wince trying to test it and spot details for tweaking.Does anyone know of a way to stop playback of every movieclip? irrespective of how its nested and without addressing them all using dot notation.
There are loads of movieclips you see, and I want a pause control to freeze everything, I've tried this with onEnterFrame events on each movieclip looking at a _root variable called "playState", but some movie clips ignore this, and keep playing.Is there an easy way to do this other than pasting my code into everything? Is there a way of making code affect all movieclips simultaneously - halting their own timelines? Then resuming?
I would like to attach (using A3) a movie clip to a draggable movie clip. I has set up a movie clip using startDrag() all works fine. But I would like to be able to dynamically place a movie clip inside it so that it too drags. Ive got it to partly work you can drag the original movie clip around and the attached movie clip (using aadChild) moves too. But if I grab the attached movie clip instead of the original clip it moves independently.
Is there a way of getting a movie clip inside the draggable movie clip and have it fixed in place and not move if you happen to attempt to drag it.
I am trying to draw circles dynamically with actionscript, duplicate/create multiples, have them move randomly around the stage independently of each other, and have them bounce off each other if they come in contact. The hit test for the latter has not been written yet. I can't get the circles to move independently of each other. My code is below.
** CHANGE STAGE COLOR TO SOMETHING OTHER THAN WHITE
Here I try to make 9 movie clips, draw circles inside of them, and apply the moveRandom function to one movie clip.
I need to develop small flash aplication which will upload photos, videos and other files to server. But is it possible to upload these assets without serverside scripting like php or coldfusion? I mean that flash should independently upload images to server. Is it possible?
I would like 2 objects that I can drag up and down indipendantly with the mouse (vertically only) between set limits. I would also like a line between the two objects that stretches like a piece of elastic.
When I animate the color of any shape that has a stroke, the whole thing changes color. I'm using "tint" and "removeTint" for that. I'd like to animate either the stroke or the fill independently.I'm using TweenMax.
I made a .as Class where some graphical elements are spawned into the stage. However, the Flash (.fla) have some internal graphics that are supposed to be over the graphical elements spawned from the custom class.I tried to make another layer over the layer where the as3 Class is being called, but unfortunately it doesn't do anything, the graphic from the .as still appearing over the internal .fla graphics.
I have been at this for about 19 hours straight! I am going to go to bed immediately after this post, but for crying out loud, I have NEVER had this problem before today! Before anyone reads ahead and says 'you have to attach your sound object to a completely separate mc to be able to control it independently from all other sound/root volumes.' see if the following code accomplishes just that:
I am working on image and i like to scale or resize the image by dragging and resize option.same working as "free transform tool" in flash (design part); i need same functionality in application.
I'm having a bit of a problem here. As per the title, my flash swf file works fine when tested from the IDE, but when I publish it and open it through the browser, the stage doesn't seem to resize along with the window.I post below a bare-bones example. The "back" movie clip should resize, only it remains at the starting dimensions
I have Buttons which I have rotated vertically within a Canvas, that is working fine. The problem occurs, when the user resizes the window to a small size a vertical scroll bar appears, I would rather have each button squashed upto a smaller size.