Resize attached movie clip
Hi,
I have a movie clip to which I attach several others always
at the same depth so one replaces the other. I was trying to change
the size of the attached movies by setting the ._width and ._height
properties and also by using the xscale without any luck. I finally
experimented with a tutorial example and got it to work and saw
that the only difference between the code in the example and my own
was the depth which I had set to 1 and the tutorial had set to 0. I
changed my depth to 0 and it worked.
I didn't see anything specifying that the depth had to be 0
and believe I am still missing something. If anyone cna help me
figure out what's going on I would appreciate it.
Thanks
Chris
From the location of the code, the relative path to newSlide
is
full_mc.newSlide as newSlide is in full_mc.
Thus you want:
function updateStage() {
full_mc.attachMovie(mySlide, "newSlide", 0);
full_mc.newSlide._width = 561;
full_mc.newSlide._height = 421;
full_mc.newSlide._x = 0;
full_mc.newSlide._y = 0;
Also note that you can do:
full_mc.attachMovie(mySlide, "newSlide",
0,{_x:0,_y:0,_width:561,_height:421});
Look up attachMovie for the optional initObect
parameter.
Similar Messages
-
Attach movie clips to scrollPane using attachMovie
Hi
I tried to attach movie clips to scrollPane using attachMovie
but could not do it
I tried the following code:
sp.contentPath="emptyMovieClip"
sp.content.attachMovie("boxesRow","boxesRow1",1)
trace(sp.content.boxesRow1)
Im able to trace the sp.content.boxesRow1 , but not seen in
the scrollPane
Can any one suggest me , how can I do this
Pleaseeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
Thank you very muchhi,
The code is correct....
But, what i want to know is, are using the Identifier name of
the moviclips ???
"emptyMovieClip" should be an Ideintifier name for an empty
clip in the library.
and "boxesRow" should refer an identifier name of another
movie clip in the library...(its should also contain some object
for the visibility check)... -
Attach Movie Clip to ScrollPane
Hi
I tried to attach movie clips to scrollPane using attachMovie
but could not do it
I tried the following code:
sp.contentPath="emptyMovieClip"
sp.content.attachMovie("boxesRow","boxesRow1",1)
trace(sp.content.boxesRow1)
Im able to trace the sp.content.boxesRow1 , but not seen in
the scrollPane
Can any one suggest me , how can I do this
Thank you very muchhi,
The code is correct....
But, what i want to know is, are using the Identifier name of
the moviclips ???
"emptyMovieClip" should be an Ideintifier name for an empty
clip in the library.
and "boxesRow" should refer an identifier name of another
movie clip in the library...(its should also contain some object
for the visibility check)... -
Attaching movie clips to other movie clips
I have mc1 nested like this
_root.mc3.mc2.mc1;
If i want to attach the mc1 from within mc2 timeline to the
_root timeline how can I do this?... I don't want to reattach it
from the library it must be the nested mc1 that is attached to the
root timeline.
Is there a way to attach movie clips to other m.c's in this
way?
regards JI've spent nearly a year creating this site... I just taken a
glance at AS3. And sizeable isnt wrong... mamouth is closer. Other
than having to learn AS3 it would take me months to rewrite
everything. Is AS3 actually that much better than AS2? Either way
im gonna finish the site in AS2 and try and find a work around for
my attaching mc's to other mc's. Maybe one day I will convert it,
but it just looks like an unnecissary headache.
Thanks for your help. J -
Attach movie clip + INVISIBLE
hey,
is there a way to attach a movie clip and make the object
INVISIBLE (i.e. make the object's alpha 0 as it is attached).
here's the line of code to attach the clip:
holder.attachMovie("frame1", "frame1_mc", 20, {_x: 30, _y:
35});
-donkeyboyyou can set any additional properties inside your brackets:
holder.attachMovie("frame1", "frame1_mc", 20, {_x: 30, _y:
35,_visible:false})
or
holder.attachMovie("frame1", "frame1_mc", 20, {_x: 30, _y:
35,_alpha:0}) -
Attach movie clips using seperate functions
I'm having a little trouble with the following code. I'm
calling two functions: init() and inittwo() to attach some movie
clips to the stage. If I comment one of them out, the other works
fine and the movement is okay. But as it is, only the "cloud" movie
clips are being attached. I need for the clips in the "dreamarray"
to be attached, and then for the "clouds" to be attached with a
second function. I'm probably not going about this the right way,
but I could sure use some help!
It would also be cool if I could attach the dreams at set "x"
values instead of random distribution. I'm not sure how to set a
seperate x value for each item in the array being attached.
var numClouds:Number = 10;
var fl:Number = 250;
var gravity:Number = .5;
var vx:Number = 0;
var vy:Number = 0;
var vz:Number = 0;
var friction:Number = .97;
var vpX:Number = Stage.width / 2;
var vpY:Number = Stage.height / 2;
var vpY:Number = 400;
var dreamarray:Array = new Array();
dreamarray[0] = "dreamone";
dreamarray[1] = "dreamtwo";
dreamarray[2] = "dreamthree";
init();
inittwo();
function init() {
for (var i:Number = 0; i<dreamarray.length; i++) {
var dream:MovieClip = attachMovie(dreamarray
, "dreamarray" + i, i);
//var dream:MovieClip = attachMovie("dreamone", "dreamone" +
i, i);
dream.x = Math.random() * 1600 - 800;
dream.y = 50;
dream.z = Math.random() * 800;
//trace("functioncall");
//tree.x = Math.random() * 2000 - 1000;
//tree.y = 50;
//tree.z = Math.random() * 10000;
function inittwo() {
for (var j:Number = 0; j<numClouds; j++) {
var cloud:MovieClip = attachMovie("cloud", "cloud" + j, j);
//tree.x = 400;
cloud.x = Math.random() * 1600 - 800;
cloud.y = 50;
cloud.z = Math.random() * 800;
function onEnterFrame():Void {
if(Key.isDown(Key.UP))
vz -= 1;
else if(Key.isDown(Key.DOWN))
vz += 1;
if(Key.isDown(Key.LEFT))
vx += 1;
else if(Key.isDown(Key.RIGHT))
vx -= 1;
if(Key.isDown(Key.SPACE))
vy += 1;
vy -= gravity;
vx *= friction;
vy *= friction;
vz *= friction;
for (var i:Number=0;i<dreamarray.length;i++) {
//i think there is a error here
var dream:MovieClip = this["dreamarray" +i];
dream.x += vx;
dream.y += vy;
dream.z += vz;
if(dream.y < 200)
dream.y = 200;
vy = 0;
if (dream.z <= -fl) {
dream.z += 1000;
else if(dream.z > 1000 - fl)
dream.z -= 1000;
var scale:Number = fl / (fl + dream.z);
dream._xscale = dream._yscale = scale*100;
dream._x = vpX + dream.x * scale/2;
dream._y = vpY + dream.y * scale/2;
//dream._x = dream.x * scale/2;
dream._alpha = scale * 60 + 40;
dream.swapDepths(-dream.z);
for (var j:Number=0;j<numClouds;j++) {
var cloud:MovieClip = this["cloud" + j];
cloud.x += vx;
cloud.y += vy;
cloud.z += vz;
if(cloud.y < 50)
cloud.y = 50;
vy = 0;
if (cloud.z <= -fl) {
cloud.z += 500;
else if(cloud.z > 10000 - fl)
cloud.z -= 10000;
var scale:Number = fl / (fl + cloud.z);
cloud._xscale = cloud._yscale=scale*200;
cloud._x = vpX + cloud.x * scale;
cloud._y = vpY + cloud.y * scale;
cloud._alpha = scale * 60 + 40;
cloud.swapDepths(-cloud.z);Hi Ive just taken a very quick look at your code and Ive
noticed at least one or two mistakes.
you are calling:
init();
inittwo();
before the actual functions have been declared.
Flash works from top to bottom when actioning code so by
calling:
init();
inittwo();
bofore the function has been declared and this will do
nothing as it cannot find the functions to call as they have been
declared AFTER the function calls.
The best thing to do is put any calls right at the bottom and
then you will know everything is ready to be triggered. -
Hello i asked this in my another topic but that topic was
mainly related with another problem.
my question is;
i have 3x3 square boxes ( "box_mc"s movie clips duplicated
from 1 "box" movie clip on stage)
I want to put a small box (that is movie clip "smallmc") in
front of bigger one(that is one of another mc "box_mc" already
placed on stage). When i click big box( i mean "box_mc") i want to
attach an instance of "smallmc" in front of big one.
i have this code in "box" mc ;
on (press) {
if (this.selected == 0) {
trace("box is selected");
selected = 1;
_root.attachMovie("smallmc","smallmc"+count,getNextHighestDepth(),{_x:this._x,_y:this._y} );
_root.count++;
trace(_root.count);
} else {
trace("unselected");
selected = 0;
_root.count--;
trace(_root.count);
but this code puts "smallmc" under "boxmc" :(( and 1 more
problem ;
i have 3x3 big boxes; and when i click a "boxmc" it puts 1
smallmc then i click another "boxmc" it puts "smallmc" but previous
one dissappearing.(but this is not prior problem i think first i
should put small boxes in front of big ones)
thank you for your all helps advicesNot sure if this will help but: getNextHighestDepth() is not
a standalone
method - it is a method of a MovieClip. You need something
like:
this.getNextHighestDepth() instead.
Dave -
Adobe Community Expert
www.blurredistinction.com
http://www.adobe.com/communities/experts/ -
Is this possible in flash CS3 or later to resize a movie clip but not its childern
Hi
I want to make a movie clip inside another on, and when I
resize the outer one by code or manually, the inner on should keep
it size as I created it first?
If this possible please give me the code for that (AS2.0 and
AS3.0)
thanks a lot.Hi,
I am not sure so I will just give some some "ideas" you can
try:
1) can you assign a "variable" to the size attribute? like
mclip.size=myvariable;
and then changing it?
2) can you use something to "record" the current size of the
"inside movie clip" like StoringVariable=this.size;
and then call it again later?
3)can you siply not "reassign" the size two times?
like for one "button click:
on (release)
movieclipparent.size=something;
movieclipinside.size=something else;
I think its definitely possible...
Have a look at the Keyword "_parent" or "this" for example...
or "_root.moviclip.movieclip" -
Hi,
Here is the scenario:
I have a document with the following dimentions: 1000x700 px. In Scene 1 I have a movie clip called mc_master. Inside mc_master I have all the other elements (buttons, movie clips, graphics, etc.)
I need to resize the whole document vertically, so in Scene 1 I resized the document to 1000px x 850px. This created a 150px empty space in the bottom of the document. I wanted to resize mc_master to include this space (basically mc_master should cover the whole document). However, when I selected mc_master and modified its height property all elements inside stretched instead of just including the blank space at the bottom.
To simplify the question: is there a way to enlarge a movie clip without distorting the element inside it? I am assuming that I can create a new movie clip with the new dimentions in Scene 1 and then copy all the elements from mc_master inside the new clip, but I wondered if there is a better method of handling this situation?
Thank you,
Daniel D.Thank you meqlomor,
This is what I was looking for.
Daniel D. -
Hi All,
I have a movie clip that contains a swf file in my .FLA file . How can i enable the movie clip so that when the screen is resized either bigger or smaller, the movie clip enlarges/shrinks accordingly.
Any help would be greatly appreciated
Cheers
SeanThink i have cracked it. If I change the settings in "Publish settings" to percent and specify 100% this works a treat!
Cheers -
Attaching Movie Clips at runtime from library
Dear All,
I have 6 different clips in Library with the Linkage class
given to following names: Class: mc0, mc1, mc2, mc3, mc4, mc5, mc6,
And I want to attach these clips dynamically at run time
using the for loop in AS3.0:
For( var i=0; i<6; i++)
What should be the code for this at runtime attachment?
Regards,
Sridhar BI looked to see if I could find a way to do this, and
convinced myself it's not possible. If it's important to do this in
a loop (I can't imagine why, but maybe you have a reason) you may
wish to add them explicitly with addChild(mc1) etc but locating
them "off stage" then you can reference them with this["mc"+i] in a
loop to change their coordinates to put them on stage. -
Attaching movie clips to buttons
I would like to design a portfolio site in which I have small
buttons that, when moused over, they display, a pic just above it.
Each button triggers a different pic above it.The best way to go about doing is is to use the MovieClip
class instead of the button class. Use the onRollover event. For
example, have a movie clip that displays the image on the second
frame. The use the actionscript: nameOfMovieClip.onRollover =
function():Void {
this.gotoAndStop(2);
If you want to use the button class to accomplish the same
task, then you will have to create an image that you want to
display then under the "over" frame of the button, place the image.
If you want the original image to be there and display the new
image, then just add a new layer and put the image in the new layer
while keeping to original layer. -
So I want to have a movie clip appear on the screen when I
click the mouse. So i click all over the screen and there are movie
clips everywhere.
Then when I click A, I want another movie clip to appear in
each movie clip, and move across the screen.
I can get the second movie clip to appear ontop of the first
movie clip, but only the most recently placed one will move.Thanks for the feedback, you helped me figure it out.
Ultimately is was the linkage that was the issue. I had them linked
as "01", and "02" etc.
All I had to do was change the link names to "1" and "2" and
presto! Thanks for your help.. -
Attach movie clip speed increase after 2 min
i am making a game in falsh as2
see this link to understand http://createview.in/try/game.html
this function for one fruit.
so there are 10 functions i want to increase speed of falling fruits after 2 min for making difficulties to user
makegd is function for bonus golden fruit it will come every 3 min
PLEASE HELP ME!!!!!!!!!!!!!!!!!!!!
function makeOne() {
if (seconds>0) {
clearInterval(ranOneID);
ran = (Math.random()*10000+8500);
ranOneID = setInterval(makeOne, ran);
One = _root.attachMovie('n_red', 'n_red'+depth, depth++);
nBalls.push(One);
//trace(allBalls);
One._x = Math.random()*500;
One._y = -350;
One.speed = (Math.random()*3)+2;
One.onEnterFrame = function() {
this._y += this.speed;
if (this._y>Stage.height+100) {
//updateScore(-5);
black=black+1;
for (i=0; i<allBalls.length; i++) {
if (this == allBalls[i]) {
allBalls.splice(i, 60);
this.removeMovieClip();
if(this.hitTest(slider_mc.kat)){
red = red+1;
function makegd() {
if (seconds>0) {
clearInterval(rangdID);
rangdID = setInterval(makegd, ran);
gd = _root.attachMovie('golden', 'golden'+depth, depth++);
goldenBalls.push(gd);
//trace(allBalls);
gd._x = Math.random()*500;
gd._y = -100;
gd.speed = (Math.random()*8)+3;
gd.onEnterFrame = function() {
this._y += this.speed;
if (this._y>Stage.height+100) {
//updateScore(-5);
for (i=0; i<allBalls.length; i++) {
if (this == allBalls[i]) {
allBalls.splice(i, 1);
this.removeMovieClip();
makeOne();
makeTwo();
makeThree();
makeFour();
makeFive();
makeSix();
makeSeven();
makeEight();
makeNine();
makeTen();
setTimeout(makegd,180000);Thank you Kglad for your quick response.
one thing that not happen
makegd is function for bonus golden fruit it will come every 3 min
it comes after 3 min but it's not single fruit that function work like other fruits.
function makegd() {
if (seconds>0) {
clearInterval(rangdID);
rangdID = setInterval(makegd, ran);
gd = _root.attachMovie('golden', 'golden'+depth, depth++);
goldenBalls.push(gd);
//trace(allBalls);
gd._x = Math.random()*500;
gd._y = -100;
gd.speed = (Math.random()*8)+3;
gd.onEnterFrame = function() {
this._y += this.speed;
if (this._y>Stage.height+100) {
//updateScore(-5);
for (i=0; i<allBalls.length; i++) {
if (this == allBalls[i]) {
allBalls.splice(i, 1);
this.removeMovieClip();
setTimeout(makegd,180000); -
On click remove attached movie clip
i wnt to onclick remove on satge movieclip
i apply this code on button thats not working!!!!!!!!!!1
on(release){
slider_mc.removeMovieClip();
gotoAndStop(121);_root.attachMovie('slider', 'slider_mc', -1);
slider_mc._y = Stage.height-182;
var speed:Number = 12;
slider_mc.onEnterFrame = function() {
if (Key.isDown(Key.LEFT) || Key.isDown(65)) {
slider_mc._x -= speed;
if (slider_mc._x>=60.0) {
slider_mc._x -= speed;
if (slider_mc._x<=695) {
slider_mc._x += speed;
if (Key.isDown(Key.RIGHT) || Key.isDown(68)) {
slider_mc._x += speed;
Maybe you are looking for
-
I am working with a client that currently has an ASA 5505 with two ISPs for failover using a tracked interface. I would like to configure logging so that the ASA will email us when the Primary ISP goes down and fails over to the backup. Here is wha
-
Special Characters in SAP R/3 System
Hi All, I need some help to handle the below situation. I need some help in XI. Below is the message from SXMB_MONI This is FILE to BAPI UPLOAD Scenario. The bolded characters above have special characters (First letter of the Bolded part). The value
-
Fix for Thunderbolt OTA firmware update , when receiving an error message
Hi, my name is Lou, and I'm not sure if this is the right place to post a solution or fix for Thunderbolt users that are unable to get their firmware update OTA.. For the last 2 weeks, when i got word that the (OTA) Over The Air firmware update shoul
-
Item Conditions in ISA b2c catalog
Hi, I need to get the item conditions for the porducts in the web catalog and show them in the catalog page in ISA b2c 5.0. Any pointers how to achieve that ! Regards, Kunal
-
Bridge meta data handling and filtering
It would be great if you could add two features: 1. adding keywords to multiple files currently if two files share the same keywords but not in the order, adding new is impossible without overwriting the existing keywords 2. filtering by location