Actionscript 3.0 :: Load And Position Swf In Movieclip?
Mar 22, 2010
I have the following AS3 code and I can't seem to figure out how to either connect it to a movie clip on stage or position it using X & Y.
Code: Select allvar thisRequest:URLRequest = new URLRequest("preview.swf");
var thisLoader:Loader = new Loader();
thisLoader.load(thisRequest);
stage.addChild(thisLoader);
I thought I could just add the following but it doesn't do anything
Code: Select allLoader.x=47
Loader.y=7
View 2 Replies
Similar Posts:
Aug 10, 2010
I'm triyng to use the attachmovie command to load and position a movieclip. It doesn't show anything when playing movie. I'm using Flash MX.
_root.attachMovie("Symbol", "mcp", 0);
_root.mcp._x = 100;
_root.mcp._y = 100;
View 7 Replies
Aug 10, 2010
Im triyng to use the attachmovie command to load and position a movieclip. It doesn't show anything when playing movie. I'm using Flash MX.
_root.attachMovie("Symbol", "mcp", 0);
_root.mcp._x = 100;
_root.mcp._y = 100;
View 5 Replies
Nov 19, 2009
I added a Menu_mc on my stage. Initially, this should be at the center of the stage and when I click on it, it will tween on the upper left corner of the browser. However, when I resize the browser, the Menu_mc goes back to the center of the screen.
I have tried separating a different actionscript file where it is specifically for initialization of the object and another one for resizing. And then when I call it on my main AS file it goes like this:
Code:
// Add the symbols to stage
var Menu_mc = new Menu_MC();
addChild(Menu_mc);
[code]...
But it seems futile.
View 6 Replies
May 13, 2010
I'm hoping someone can solve this headache. Basically, I want a movieclip to move to the position of each of my buttons from any position along my x axis. Therefore, the movieclip needs to 'flip' to face the way it is traveling.At the moment I have the movieclip moving to the mouse x axis when I ROLLOVER the button and stop following the mouse when I ROLLOUT but the code won't flip the movieclip so I must have something wrong...
btn.addEventListener(MouseEvent.ROLL_OVER,followCa t);
btn.addEventListener(MouseEvent.ROLL_OUT,stopCat);
btn02.addEventListener(MouseEvent.ROLL_OVER,follow Cat);
btn02.addEventListener(MouseEvent.ROLL_OUT,stopCat );
[code]....
View 0 Replies
Jul 3, 2009
setting a position of movieclip called red x and y position within a movieclip called background
Code:
background.redsquare.x = 300;
background.redsquare.y = 300;
comes up with TypeError: Error #1010: A term is undefined and has no properties.
setting a position of movieclip called red x and y position withen a movieclip called background
Code:
redsquare.x = 300;
redsquare.y = 300;
This works fine but how can that be when surely you must access the red withen the background rather then just accessing red?
View 3 Replies
Nov 3, 2009
lets say i have a sprite on the stage and one movieclip inside it. now i want to tween or just set that movieclip x and/or y position according to stage position. so for example i want to set mc.y = - 100; (by which i mean -100 to stage, not sprite which mc is in.)
View 2 Replies
Feb 3, 2010
What i'd like to do is have a menu/site map that adjusts when you click on a certain icon. For example, I have a AS3.0 flash file with, say, 5 keyframes with 5 buttons that are in different positions on each key frame. The buttons are set to gotoAndPlay the various keyframes. I can set up a tween that links frame 1 to 2, 2 to 3 etc. but what I would like is a tween from, say, 1 to 3, then 3 to 5, then 5 to 1 - basically in a random order rather than sequentially through the key frames. I could set each of these tweens up individually but the site is for a portfolio that I would like to keep adding to and to do this individually would mean an ever increasing amount of tweens.Basically, is there a way to get a 'MovieClip' to move from Position A in keyframe 1 to Position B in another keyframe without a set of tween frames? I'm sure this is simpler than I am making it sound but I don't seem to be able to work it out.
View 1 Replies
Jun 27, 2006
using the following jumpTo script as a guide how do I write an if statement for a function that will basically ask "if the movieclip is at position 3 stay there, otherwise jumpTo position 2"?
Code:
var bg1x = new Array(0, -1280, -1014, 0);
function jumpTobg1X(number) {
gradientNav_mc.newX = bg1x[number];
}
I have tried a bunch of if/else statements but I can't get it working. I can't figure out how to write it properly. I tried something like this:
[Code]...
View 2 Replies
Jan 26, 2011
Okay I have a script in which I have added an image to the stage. It is absolute centered. I then have another with is on top but much bigger. I would like the big image to move opposite of my mouse position on the smaller image. ie: cursor is on bottom left corner the bottom left corner of the larger image is in the same spot. And the same thing for any other area.
I have tried many different ways but to no avail. I have done research but no one has been able to give me a solid answer. Anyone know of a way to accomplish this. Keep in mind this it needs to work regardless of the image size.
View 1 Replies
Feb 10, 2010
I have a movie clip called "myMC". I set its x value as such:
[AS]
var myMC:MovieClip = new MovieClip();
addChild(myMC);
myMC.x = 100;
[Code]....
I know I could proboly acheive this with a math equation but is there a function that can get the exact global position of "myShape"? So that I can position another movieclip or sprite around that movieclip?
View 3 Replies
Feb 10, 2012
is it possible for me to give a movieclip the same position as another movieclip. meaning they will be on top of eachother and when one moves the other moves as well.i know you can do it with the mouse:[code]It would be a great way to cheat the program as im having some problems, but this would fix it. the 2 movieclips though is in a class and the other is on the stage.
View 4 Replies
Sep 20, 2009
I want to know is that a way to get position of MovieClip A in MovieClip B.Let say in MovieClip B (MovB), I have an MovieClip A (MovA) moving around, and I would like another MovieClip C (MovC) to follow the MovA moving around inside MovB.
I tried below,
MovC._x = MovA_Instance._x;
MovC._y = MovA_Instance._y;
It get the position, but not the correct 1.
View 2 Replies
Apr 28, 2009
I have a Flash movie with a movieclip inside called main (main has been dragged into the stage).In main at certain frame I have[code]...
Which loads teletipo.swf but in a x=0 and y=0 position. As I need it in a x=320 and y=165 position I've done[code]...
View 2 Replies
Feb 12, 2011
I have the listed code to load swf file to the stage using action script 3 and I want to modify it to place the swf in (X,Y) place.what I should add to the code to have the swf file placed in the specify position.
var swfLoader:Loader = new Loader();
stage.addChild(swfLoader);
ar gURL:URLRequest = new URLRequest("test.swf");
[code].....
View 1 Replies
Jun 25, 2009
I have a SWF loading in right now, however it loads to the stages x:0 and y:0. Here's my code:
function craDone(e:Event):void {
trace("LOAD");
TweenLite.to (portfolioBucket_mc, 0.5, {x:-831, alpha:0, ease:Back.easeIn});
addChild(l);
}
How do I tell it to load to a certain Y position. The x doesn't really matter because x:0 is good.
View 1 Replies
Nov 22, 2004
i created an empty movie clip called 'iranmc' and i want to load a swf file into 'iranmc'. So, on 'iranmc', i applied this script
onClipEvent (load) {
loadMovieNum("iran.swf", "iranmc");
}
However, problem is..when previewed,it doesn't play in iranmc, but it pops up an Internet Explorer browser and plays the video in there.
[URL]
View 2 Replies
Sep 26, 2009
I am trying to load an external swf at a specific x& y pos. from a button. This is the code I am using :
on (release) {gotoAndPlay(4);loadMovie("gallery.swf",1); xpos="7", ypos="119";
}
The movie loads fine if I remove xpos="7", ypos="119";How do I get it to load at that specific position?
View 3 Replies
Oct 6, 2009
I've honestly tried to look everywhere and have no clue how to do this. PLus i've tried for hours and still have no success! As the post thread title states, I have a swf file and i want to import anothe swf file into a blank movie clip. Can it be % wise? And can the image's width be set to say 100 and the height be automatic? Also, what about the x and y positioning? also, I do not need or want a progress bar.
View 4 Replies
May 18, 2010
I want to load that SWF file in the center of the screen.
I got "loader(the variable that loads external SWF file)" and I don't know how to assign the X and Y position of that loader in the center of the screen.
here is my code.....
ActionScript Code:
var myStage:Stage = this.stage;
myStage.scaleMode = StageScaleMode.NO_SCALE;
myStage.align = StageAlign.TOP_LEFT;
[Code]....
View 0 Replies
Dec 22, 2005
The flash e reading from a XML file and all the works (portfolio company) are divided in 4 parts (multimedia, design, 3d animation and pos-production). In the beginning of the site I have all that 4 options (4 buttons), but no matter is my choice this is always loading in first place de multimedia content. Why? E.g. If I click the button design, goes to the layout position of design but the content is the multimedia one. Each area as a different layout position. Here goes the ActionScript code that I'm using to populate the content:
[AS]
var boxes:Array = new Array();
//Defines space between movieClips thumbnails
var gridx:Number = 32;
var gridy:Number = 32;
var isto = this;
function resetBoxes():Void {
[Code] ......
View 3 Replies
Mar 15, 2007
I'm building an XML based gallery, and I used the kirupa tutorials for that (both of them).but I wanted a grid look for the thumbnails and I found this great post by ikim just for that:So I managed to suit the code to my gallery and everything is going good.but there is one problem:when I press the button that loads the XML (WITH THE THUMBS), they load like they supposed to:but when I press again on the button, they load like this:and stays like this.. Why is that?here is the complete code I use to load the images and thumbnails:
Code:
function loadXML(loaded) {
if (loaded) {
[code].....
View 2 Replies
Feb 22, 2011
I'm trying to load an image with the following code but sometimes the image wont end up in the right place.
[Code]...
View 1 Replies
Apr 14, 2010
I'm trying to get a swf file to play in a main swf file. I can get it to play, but it always appears in the top left corner. I've tried several different methods to position it but every one of them either doesn't work or won't play the file.Here's what I'm using right now.
Actionscript Code:
stop();loadMovieNum("circles.swf", 1);var xset = 381;var yset = 179;
The swf plays just fine, but it won't take the coordinates.I also need to get it to stop when I go back and the command
Actionscript Code:
unloadMovieNum(circles.swf);
doesn't work.A tutor in my class showed me a method to place the swf into a box on the main stage without doing a lot of scripting, just putting in some file-name and size/position references, but he's not available right now to ask how he got that started.
View 5 Replies
Oct 17, 2006
Basically I have an XML file that contains the paths of a few mp3 files. I have a Play button that plays them and a Next button that plays the next song on the list. These buttons work fine. I actually even am able to obtain and manipulate the songs position using the mySong.position property in order to display the songs position in the form of minutes and seconds.My problem is that when you click Next to go to the next song, the mySong.position property does not reset back to zero, like it should. So if you are 12 seconds into a song and you click NEXT, the next song starts to play fine, but the display keeps counting up from 12 seconds. I realized the .position property is read-only, so I cannot change it. If this is the case, then how does it ever reset, what causes it to reset?
I am loading the songs via the loadSound() method. Which means my only code on the Next button (other than to update some other displays) is:Code:mySound.loadSound("file.mp3", true);I do not need to use mySound.stop() to stop the previous sound, or even mySound.start() to start the new sound playing, it starts automatically. I tried using those commands and got the exact same results, the position property still did not reset.Am i missing something? I sure hope its painfully obvious and I just overlooked something simple cuz im getting a headache
View 9 Replies
Nov 15, 2009
I'm working on this scroll from tweener [URL]. I've made a button that lets me reach the position I want on the scroll
Code:
this.bout.onRelease = function() {
this._parent.gotoPosition(4);
};
Now I'd like to load a movie when I move to this or that position. Maybe with if?
Code:
this.bout.onRelease = function() {
this._parent.gotoPosition(4);
if (_root.Position=4) {
loadMovieNum("test.swf", 1);
}};
but this doesn't work (it loads the movie alright but not because of the position).
View 1 Replies
Aug 6, 2010
How do I load ant set the position of a button, movie or graphic with actionscript only. Let's say I have an image that I want to display at a certain position with a certain size.
View 5 Replies
Apr 12, 2010
I've searched for ages on this and I can't see how it's done, I've got a set of images in my library and each one has been "exported for actionscript" with class names of stim1, stim2...stim12. Now, I have a bit of actionscript code that creates instances of these classes and will load the stimuli to the stage:
[CODE]...
View 1 Replies
Nov 22, 2010
I've got a set of images in my library and each one has been "exported for actionscript" with class names of stim1, stim2...stim12.Now, I have a bit of actionscript code that creates instances of these classes and will load the stimuli to the stage:
Code:
var BitmapDataLeft:stim1 = new stim1(150,150);
var imageLeft:Bitmap = new Bitmap(BitmapDataLeft);
[code]....
View 1 Replies
Nov 15, 2009
yesterday i got solution from murphy that to load the xml value in a duplocate movie clip.now i have done a math class to make it xml value in best fit in my screen.for the referance i have attached the source files 1.fla 2. xml and 3. uiDesign imag
View 4 Replies