Actionscript 3 :: Prevent External Translation Of A Movieclip Object On Stage
Mar 19, 2010
I have a MovieClip object, which is exported for actionscript (AS3) in an .swc file.When I place an instance of the clip on the stage without any modifications, it appears in the upper left corner, about half off stage (i.e. only the lower right quadrant of the object is visible). I understand that this is because the clip has a registration point which is not the upper left corner.If you call getBounds() on the movieclip you can get the bounds of the clip (presumably from the "point" that it's aligned on) which looks something like (left: -303, top: -100, right: 303, bottom: 100), you can subtract the left and top values from the clip x and y:[code]matrix has a tx value of 748 (half of stage height) ty value of 426 (Half of stage height)concatenatedMatrix has a tx value of 1699.5 and ty value of 967.75That's also obviously where the movieclip is getting positioned, but why? Where is this additional translation coming from?
View 1 Replies
Similar Posts:
Mar 28, 2011
I need to move between (rotated) object in flex along x, y, or z as an independent observer. The movement relative to x, y works ok, but when I go along the z axis, the observer behaves as it was apart of the xyz system of the objects and doesn't go straightforward to the object but in diagonal for example. Here is some tryout code
[Code]....
View 1 Replies
Apr 15, 2010
OK so inside one of my object classes i have this function
[Code]....
My preferred simple way of having animations in flash (im not fond of flashes drawing tools ) TA is a movieclip inside the Movie clip that the class is linked to, and TP is the one inside that one which contains the bitmap. Running this function in my enter frame gives me a
[Code]....
View 4 Replies
Nov 15, 2004
know how I can resize the stage to match the size of an external graphic/movieclip which is loaded into an empty movieclip,
View 3 Replies
Dec 28, 2010
I have an swf file, in which on (release) simultaneously:
1) another external swf is loading: loadMovieNum ("file.swf",2);
2) hidden before object on stage is appearing: _root.object._visible=true;
All is ok, excluding that the object becomes visible 'under' that external swf. How to put it above the swf instead?
View 6 Replies
Sep 6, 2011
I have a media player that I am codging together, one that will play either videos or MP3s depending on the variables it is passed. The video player part works fine. The MP3 player controls are all actual physical MCs on the stage; each one has its own AS class file as part of the package, but there is also a lot of AS that is happening in the main FLA as well. Messy, I know, but it mostly works great.
The MC on the stage in the main FLA is properly linked to the class file via Actionscript linkage, and the control itself works. However, I am trying to make some aspects of the control respond to variables that are set within the AS on the timeline of the main FLA, and I cannot seem to pass values to the control no matter what I do.
[Code]....
View 2 Replies
Mar 20, 2008
I'm trying to make a function for centering movieclips to other movieclips, or centering the movieclips to the stage. My problem is movieclips use _width & _height and the stage uses width & height without the underscore.I'm passing the 2 objects as parameters to the function "center" (reference for centering, and the object I want to center), but I don't know how to make the function know if I'm passing a movieclip or the stage
View 1 Replies
Apr 22, 2008
I'm trying to make a function for centering movieclips to other movieclips, or centering the movieclips to the stage. My problem is movieclips use _width & _height and the stage uses width & height without the underscore.
I'm passing the 2 objects as parameters to the function "center" (reference for centering, and the object I want to center), but I don't know how to make the function know if I'm passing a movieclip or the stage.
I tried typeof which returns [object object]....
View 4 Replies
Jan 8, 2009
I have a dynamic textfield called neighName on my Flash stage. I also have a movieclip that I call a region on my stage. When I mouseover the region, I want a word to display in a little popup *and* I want some text to display in my textfield. I have an external .as file for handling the region. I can make the code "see" my region, but I can't seem to make it see my textfield, although no errors are being thrown.
View 1 Replies
Oct 14, 2011
I have an external AS3 class file which is loaded up on the first frame of the Flash movie.
How can I reference the stage object in the AS3 file without having to pass it as a parameter?I mean it seems to me like the stage object is in the global realm - or am I incorrect with this assumption?
View 1 Replies
Sep 6, 2011
I have a media player that I am codging together, one that will play either videos or MP3s depending on the variables it is passed. The video player part works fine. The MP3 player controls are all actual physical MCs on the stage; each one has its own AS class file as part of the package, but there is also a lot of AS that is happening in the main FLA as well. Messy, I know, but it mostly works great.The MC on the stage in the main FLA is properly linked to the class file via Actionscript linkage, and the control itself worksHowever, I am trying to make some aspects of the control respond to variables that are set within the AS on the timeline of the main FLA, and I cannot seem to pass values to the control no matter what I do.The following variable is set in the main AS:Code:var notPlayedYet:Boolean = true;I also have some flashVars being passed in from the html, and these I can reference with no trouble from the main AS - the relevant one is:
View 1 Replies
Nov 3, 2009
Basically what im doing is making a whole bunch of movieclips using a loop and loading an image into them..The movieclip is a success, but no object is there or seen on stage...
[Code]...
View 2 Replies
Oct 16, 2009
I have movie clip(1) on the stage, all I want to do is using another movie clip(2) as a button that when you click zooms the movie clip(1) bigger, then clicking movie clip(2) again takes it back to the original place.
_root.zoom.onEnterFrame = function() {
if (mouse_over_zoom) {
_root.zoom.nextFrame();
} else {
_root.zoom.prevFrame();
}};
I tried _parent and it will not let me save the file as flash 8 anymore.
View 0 Replies
Nov 21, 2011
Having trouble with this one, let's say I have a 800x600 stage with a movieclip on stage. Now inside this mc I have a red dot thrown randomly somewhere inside. How can I make my mc move so that it centers that red dot to the center of the stage? I need the animation to be dynamic but I can't figure out the formula to do it
View 4 Replies
Sep 9, 2009
I have created an accordion object and within the timeline of the accordion, I have a data element that I want to pass to a dynamic text field on the stage, but can't seem to do it.
View 2 Replies
Aug 16, 2010
I'm just creating a movieclip from a text field object on the stage, giving it an instance name and setting some timeline animated over and out states for it. I'm then setting it up in AS3 to work like a button, so nothing complicated at all. But I am getting errors I have never seen before. Code is very simple basically I have a button called 'hair' contained within the mc 'menu', here it is:
Code:
menu.hair.addEventListener(MouseEvent.MOUSE_OVER , itemOver);
function itemOver(e:Event):void {
trace(e.target);
e.target.gotoAndPlay('over');
}
So I noticed there are some new text options in CS5, but none of them give the result I want. If I leave this as the (now default) TLF text, it gives a couple of errors related to this no longer being a movieclip;
Code:
ReferenceError: Error #1069: Property gotoAndPlay not found on flash.text.engine.TextLine and there is no default value.
at CL022_fla::MainTimeline/itemOver()
[object SimpleButton]
ReferenceError: Error #1069: Property gotoAndPlay not found on flash.display.SimpleButton and there is no default value.
at CL022_fla::MainTimeline/itemOver()
[object TextLine]
If I change it to classic, there are no errors, but the gotoAndPlay does not work. If I change the text to outlines, it works as per normal.
View 2 Replies
Oct 18, 2010
I am trying to load an external .swf (actually it is only an image that I published as a swf file, not a complicated movie) but I get errors. I am trying to load the .swf into a movieclip and the movieclip appears on the stage. I have put the code in frame 1 where the image should appear (in the movieclip). The code that I used is below and works fine with a .jpg and when I load it directly on the stage, that is to say, when I put the code in a frame on the stage. Why does it not 'work' right now?
I have added 'parent' in 'parent.event.target.content.y = 200;' in the first frame of the movieclip timeline, to make sure that it will appear on the (main)stage. The error that i get is this one:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at galerie2010_fla::mcBallon1_11/frame1()
This is the code in frame 1 in mcBallon1:
var imageRequest1a:URLRequest = new URLRequest("images/SWFoverig/ballon1_702x368.swf");
var imageLoader1a:Loader = new Loader();
imageLoader1a.load(imageRequest1a);
addChild(imageLoader1a);
imageLoader1a.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete1a);
function onComplete1a(event:Event):void{
parent.event.target.content.y = 200;
parent.event.target.content.x = 205;}
View 2 Replies
Apr 15, 2012
I want to load my external SWF file using the following code in "Panel4_mc" instead of on stage. How can I do it" function btnClick(event:MouseEvent):void {
[Code]...
View 4 Replies
Feb 2, 2011
I am creating a movieclip in which when my character reaches the half of the stage another movieclip will play.
package{
import flash.display.MovieClip;
import flash.events.Event
public class chesteragain extends MovieClip{
private var chesterback:MovieClip = new mcChesterback;
[Code] .....
View 3 Replies
Jul 7, 2011
In the code below, I have created an instance of the DrawLineChart class called LineChart1.When I test the movie, it shows up on the stage just fine and when I click on it, I can use a trace command to get a string statement written to the output window. However, now I want to be able to click on LineChart1 on the stage and have it be removed. When I do that, I get an error message 1120: Access of undefined property LineChart1.
why I'm unable to refer to my instance LineChart1 and what I need to do so that I can refer to it and remove it when it gets clicked? why the trace statement works when I click on LineChart1 during runtime, but not the removechild command.
package{
import flash.display.*;
import flash.events.*;[code]....
trace("hello"); // This works. When I click on the LineChart1 MovieClip on the stage during runtime, I get "hello" as an output. removeChild(LineChart1); // throws an error 1120: Access of undefined property LineChart1.
View 2 Replies
Jan 7, 2009
I am loading an external swf file/movieclip onto the main stage - it is a simple transition and once it has finished playing, I want to jump to a frame in the main stage.I've loaded the movieclip onto the stage, but don't know how to jump to another frame after it has played and stopped...what's needs to be added to this to goto a frame on the main stage........
on (release) {
loadMovie("black.swf", holder);
}
View 2 Replies
Nov 21, 2010
I've been searching around all afternoon, and am pulling my hair out. 1) I have a movieclip instance on stage (simple graphical element that represents platforms for a hero to run and jump along). I have placed it on the stage with an external class engine.as and in this class it is called myPlatform and is an object of Platforms.as. The movieClip is called platforms and from a trace(myPlatform.name) the instance name is instance3.
2) I am attempting to access the properties of myPlatform in an Enterframe event loop in my character control and collision class (called hero.as)
Basically here is the bit of code I am trying implement within Hero.as :
[Code]...
This all worked when I was writing actionscipt within the FLA file, on the timeline frame 1. I simply don't know how to access myPlatform from within the external Hero.as class! Do I need to create a variable? Is there a really easy way to do this with some syntax/command that I have not learned yet?
View 3 Replies
Oct 16, 2009
I think there is a simple solution to this question, just not simple enough for me to find it.Question:How do you constrain a TitleWindow in Flex 3 from being dragged off the screen/stage? Is there a way to restrict the TitleWindow to the viewing area? Example: Let's say I have an application that take 100% of the screen. Next, I create a TitleWindow via the PopUpManager. I can then proceed to click and hold (drag) that window off the screen, then release the mouse button. That window is now lost off-screen somewhere. Is there a way to keep the window from being dragged beyond the viewing area?
View 6 Replies
Nov 15, 2004
Does anyone know how I can resize the stage to match the size of an external graphic/movieclip which is loaded into an empty movieclip
View 3 Replies
Mar 3, 2011
in flash AS1,2 you just input this code Stage.scaleMode="noScale";
on a frame of the main stage to prevent scaling of movieclips on fullscreen.I tried the same thing in AS3 and its not working for me. so my question is how would i apply this in AS3?
View 8 Replies
Sep 29, 2011
I have two SWFs: a Loader SWF, and a Loaded SWF. I need to add the Loaded SWF to the display hierarchy, but I don't want to give it free access to the stage. It may, for instance, attempt to change the scaleMode, and I don't want that to happen. What are some good methods for restricting loaded content's access to the stage? I may, for instance, want to allow it to access the stageWidth and stageHeight, but not the scaleMode or align.
Additional Constraints. I can't change anything about the Loaded SWF. Both SWFs are in the local-with-file-system sandbox. These SWFs are both Flash Player 10, ActionScript 3, made in Flash Professional. Not AIR, not Flex. I'd love to be able to implement a proxy class or a getter to somehow intercept calls to the stage, but I don't believe there is any way to.
I don't believe, for example, that you can subclass the Stage class and use that subclass in place of the normal Stage object referenced by the stage property in all MovieClips. The stage property is read-only, so it can't be cross-scripted by the Loader to point to something different.
View 2 Replies
Jan 14, 2010
I created a custom scroll bar, you can see it here [URL] My scroll dragger is not working. First, I have removed all of my code except my scroll bar code and my scroll dragger still doesn't work. If I remove all of my stage elements and leave my custom scroll bar on the stage, the scroll dragger works. If I try to add an object back onto the stage the scroll dragger stops working. It doesn't seem to matter what object I add back to the stage. There are no compile errors or output errors to fix. I even created a new fla and I am getting the same issue. Adding movie clips from the library to the stage prevents the dragger from working. I am really puzzled by this. I am using Flash CS3. I have added a zip file of my fla.
View 3 Replies
May 27, 2009
I have a TextInput object that highlights when it is focused...I would like it not to highlight when it is focused. way to stop it?
View 2 Replies
Feb 13, 2012
Is it possible the JS object object doesn't exist when the flash calls? Here is all the source and the issue ticket for the SWF project this is happening on: http:[url]....
PS - I have the swf mp3 player working with some custom JS that removes the need for the swf to call the JS, but I'd love to understand why IE9 does this while the other browsers work as expected.
View 1 Replies
Oct 11, 2010
I would like to know the way to prevent a child swf from referencing its parent swf stage width/height?
for example, i created a child swf that loads image and center it on it's stage. As a stand alone its fine but i loaded it with parent swf, it centers on the parent swf instead.
View 3 Replies