ActionScript 3.0 :: Setting A Position Of Movieclip Called Red X And Y Position?

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


Similar Posts:


ActionScript 3.0 :: Fluid Layout Stop Changing Resize Position When Movieclip Is At Certain Position?

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

ActionScript 3.0 :: Movieclip To Move To The Position Of Each Of Buttons From Any Position?

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

ActionScript 3.0 :: Set That Movieclip X And Position According To Stage Position

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

IDE :: Way To Get 'MovieClip' To Move From Position A In Keyframe 1 To Position B

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

ActionScript 2.0 :: "if The Movieclip Is At Position 3 Stay There - Otherwise JumpTo Position 2"?

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

Flex :: Should UpdateDisplayList Layout And Position Every Time Render Is Called?

Jan 6, 2012

So updateDisplayList is for laying out, positioning and sizing a component's children. It seems a waste to me, however, to have all that code running every time a render is called, even if no changes have been made to the relevant properties or child properties.The way I get around this for performance's sake (working on mobile) is to set a flag inside of my overridden updateDisplayList that lets a big part of my own sizing/positioning code run only the first time.Is this a bad idea/ big mistake? I just can't see the benefit to letting it run every time otherwise if I don't expect anything that affects sizing/positioning to change.

View 1 Replies

AS3 :: Setting Scroll Position For ScrollPane Component?

May 19, 2009

I ve got a series of frames, each with its own instance of a scrollPane called actionText. When navigating from frame to frame I want the vertical scroll position of actionText to reset to 0.For some reason these separate instances of the component are inheriting scroll positions from one another,for example,if I scroll to 50% in one frame, jump to a new frame with a new instance of actionText, that new instance starts at 50%, not 0.

I should be able to set the scroll position by actionText.vPostion = 0 but I get Position is an undefined property of the object actionText .Roll over either the star one or star twotabs and select any action item, scroll the text down (actually a pdf converted to swf), then navigate to another action item and the new scrollPane does not default to 0. Only stars one and two are coded.[url]......

View 3 Replies

ActionScript 3.0 :: Setting Cursor Position Programmatically?

Oct 22, 2009

In my app, the user clicks on an object, which centers the object on the screen. The user's cursor stays where he/she clicked. I find that it is kind of disorienting to have the object move without the cursor. For the user's convenience, I would like to move the cursor to the center of the stage as well.

View 14 Replies

Flash :: Setting Initial Position Using SharedObject?

Aug 8, 2011

I have created a simple audio player to play continuously even if the page is refresh it will play continuously.This is my code to store audio position in flash Temp memory

MySharedObject.data.audioPos = mySndChannel.position;
MySharedObject.flush();

MyProblem,When the player starts the sndPosition is null, so it was not playing. If I set some value, when I am refreshing it will not continue from the last position. How can I set the initial position to play from the start?

View 1 Replies

ActionScript 2.0 :: MP3 Player - Song Position Not Setting To Zero

Apr 2, 2010

I am create a flash mp3 player. In that I am displaying the song.position(time completed played). The song.position is not setting to zero, when a new song is played. It is continuing with the previous song. For example, if the previous song time is 30 seconds. the song.position is started from zero and comes to 30 seconds. After that song is completed and a again a new song is started, the song.position is starting as 30 seconds and gets increasing. It is not setting to zero at the start of the second song. I even set the song.position=0, when the previous song is completed.

View 1 Replies

ActionScript 2.0 :: Setting Random X Position From Array

Mar 8, 2009

I've creating a drag and drop card game in AS 2.0 and need to set the cards randomly in set positions every time the game is played. no two cards can be in the same space, so the taken position needs to be taken out of the array.I am not concerned about the Y value just X . I think this needs to be an array containing the positions. then using slice to remove the value from the array. I'm not sure how to assigned the array position to the movie clip.

View 6 Replies

ActionScript 2.0 :: Logging And Setting Scrollpane Scroll Position?

Sep 20, 2010

I have a scrollpane with a very long list of images stacked vertically. The user can scroll around, click on an image, and it will take them to another part of the application. There, there is a back button so they can return to the list of images. Instead of jumping back to the top, I want the back button to return them to where they were in the list of images beforehand. how do I log the value of the scroll position, and then set it to that value when the page is loaded again?

View 3 Replies

Actionscript 3 :: Setting Caret Position In Text Layout Framework?

Jul 3, 2010

i'm attempting to simply set the caret position at the start of the text flow when it is first displayed, without having to click and activate the text to see the blinking caret.

googling returns that the solution is to do this:

textFlow.interactionManager = new EditManager(new UndoManager());
textFlow.interactionManager.setSelection(0, 0);

however, setSelection() is not a valid function of the selection or edit managers.

1061: Call to a possibly undefined method setSelection through a reference with static type flashx.textLayout.edit:ISelectionManager.

View 1 Replies

ActionScript 2.0 :: Setting Final Mc Position Depending On Text Height?

Jun 1, 2003

I have an empty mc called "attachmcextra".Into this empty mc is attached another mc called "mcnote" that contains a texto box named "loadnote". So it`s path would be:_root.attachextra.mcnote.loadnoteThe following code is set to the mc "attachextra":

onClipEvent (load) {
//set inicial position
this.posY = 20;

[code]....

View 1 Replies

ActionScript 3.0 :: Move The Vertical ScrollBar Position Of The ScrollPane To Top/initial Position

Jun 30, 2009

I am using a ScrollPane in my application(viz., instance name is: myScrollPane). When I view the contents of the ScrollPane, it shows them perfectly. My issue is: When I try to view data present inside the ScrollPane, if I move the Vertical-ScrollBar of the ScrollPane to middle(or somewhere from top to down) and then click on Submit button(viz., instance name is: submit_btn), then its Vertical ScrollPosition must be reset from middle(or any position where we leave it before) to top(or initial position). Hence, I need to move the Vertical ScrollPosition of ScrollPane to top (or) initial position. Everytime, I need to refresh the VerticalScrollBar Position when I click on the submit button. How to do it?

View 1 Replies

ActionScript 2.0 :: Move Punto_mc From Current Position To Random Position After Release?

Aug 29, 2009

how to make an actionscript to move punto_mc from current position to random position after release, and then from this new position to mevo to another randon position after release?

View 2 Replies

ActionScript 3.0 :: Flash - Tweening The Canvas Position While Keeping It's Mask Position?

Feb 3, 2012

I have simple image gallery, where images are placed one next to another and the mask is revealing only one of them. Now I want to tween position of the images, but when I do that the mask is "traveling" alongside with the images..

View 4 Replies

ActionScript 2.0 :: Full Browser Flash - Traced Its X Position And The Var StageXcenter Position And Like Suspected It Shows Different Values?

Nov 12, 2007

So I'm trying my hands on some full browser flash and after reading a couple of tuts I wrote this

Code:
#include "mc_tween2.as"
Stage.scaleMode = "noScale";
stageListener = new Object();[code]...

The trace's are because it didn't work like I thought it would.Etc the middle movieclip didn't center itself but rather positioned itself seemingly how it pleased so I traced its x position and the var stageXcenter position and like suspected it shows different values.

View 2 Replies

ActionScript 2.0 :: Take Button Position Half Width Of Own X Position On Stage

Feb 9, 2011

i want to take btn1 position half wwidth of own x position on stage

View 1 Replies

ActionScript 1/2 :: Get And Set The Scroll Bars Position (pixel Position)

May 5, 2011

I have a ScrollPane and I want to get and set the scroll bars position (pixel position). For example, if the user changes the scroll bars position and then refreshes the page, we need to take the user at the same point where he was before refresh. For this I need to get the respective scroll bars positions before refresh and then set it to the saved position after load. I have got the positions by hPostion and vPosition but now when I try to save the values back to the same properties after refresh it doent work.

View 2 Replies

Actionscript 3 :: Tween Position Relative To Current Position?

Jan 23, 2010

I have a tween set on a timer:

var manTimer:Timer = new Timer(1000,14);
manTimer.addEventListener(TimerEvent.TIMER, moveMan);
function moveMan(e:TimerEvent):void {[code]....

I just need to make the tween's position relative to it's current position, as opposed to starting at the stage's 0 position then moving the the stage's -40 position. It needs to start at its current position the move -40 from that position.

View 1 Replies

ActionScript 2.0 :: Mouse X Position To Control Movie Position?

Feb 1, 2006

Basically the x position of the mouse should control the play position of a movie. Do I need something like an event handler (I'm not sure exactly what these do, but I've seen similar scripts that seem to use them).

View 2 Replies

IDE :: Cursor Position Not Mouse Position In Input Text Box

Nov 12, 2009

I have an Input Text area that users can edit and then submit. I need to be able to show, on screen, the cursor's current position as they type. I don't need to know where the mouse is but all work-arounds I've found so far can only tell me the mouse position. The font for the text is 'courier' or 'courier new' and the Input Text area is scrollable.

View 8 Replies

ActionScript 3.0 :: Changing Y Position Results In Random Position

Nov 8, 2010

I've run into a new problem, this time with positioning. I've narrowed down the line that's causing it--"block.y = block.y + block.height;" in SetOfBlocks.shiftDown. When I take it out, no problem. But with it in, instead of just dropping each block down by a block height, the affected blocks sometimes move up, and also often move about randomly within the X axis--although their new positions always keep them lined up with the 'grid', which is to say, within multiples of the block height and widths.

[Code]...

View 3 Replies

ActionScript 2.0 :: Tween From One Position To Mouse Position?

Mar 28, 2010

tween from one position to mouse position

View 1 Replies

ActionScript 3.0 :: Z Position Impact On Stage Position?

Jan 13, 2011

I have a sprite that I zoom out using the sprite.z property. Once the z property has been modified the sprite x and Y values do not match the stage x and y real value. So far so good and what I was expecting!

What I want to accomplish is that when the user clicks the stage the sprite tweens to where the mouse was clicked but I don't know what x and y position to send to the sprite. ( since stage 200,200 is something like 400,400 for the sprite depending on z value)

I tried Utils3D.projectVector using Matrix3D of the perspectiveProjection of the stage without success. (i.e. I get Vector3D(Infinity, Infinity, NaN))

I could fallback to scalex/scaley but sprites.z gives me the correct scale, perspective projection, paralax scrolling since I have sprites on different z level all for free. I would have to recode all that.

View 5 Replies

ActionScript 3.0 :: The Y Position And X Position Is Not At The Left Top Of Monitor?

Sep 24, 2011

I am developing a video player, in that full screen mode option. I have given the following code for width and height of the video

ActionScript Code:
flash.system.Capabilities.screenResolutionX
flash.system.Capabilities.screenResolutionY

The problem is the y position and x position is not at the left top of my monitor. it is varying when I change the dimension of the file. I also tried with stage.stageHeight and stage.stageWidth etc. but no reaction.

View 3 Replies

ActionScript 3.0 :: Record The Current Position Of Any Of The Items Item In Order To Use That Data To Change The Position Of The Item After The User Clicks?

Jan 2, 2010

If I have several items that move across the screen but the user can click any of them at any time, how do I record the current position of any of the items item in order to use that data to change the position of the item after the user clicks?

This is what I am doing: I have 11 images that slide accross the screen. The user can click any of them at any time. When he clicks one I am scaling the image so it looks like it is comming forward (z axis) and then the rest of the images are scaled down so it looks like they are going back on z axis. So what I am trying to do is get the current position of the image when the user clicks the image so that I can use that to correctly estimate the scaling and moving of the image to make it look like it scales from the center and not from the top left corner. So if have a variable that gets the current position of the image being clicked I'm thinking I can change its position using something like: x = currentposition + -45;

View 9 Replies

ActionScript 2.0 :: Position Onloadmovie In The Right Position?

Feb 24, 2009

I am using loadmovie function to load movie in a liquid template.

Code:
nav5.onRollOver = incoming;
nav5.onRollOut = begining;
nav5.labelMC.labelTxt.text = "Reference";
nav5.onPress = function(){
loadGallery.loadMovie("NEWMOVIE.swf")
};

Movie loads fine in the right position but as soon as window gets resized everything moves out of its place even the main movie in which i have loaded this new movie . What can do here to make movie stay's in its place once the window is resized?

Also i have several buttons in this main movie to load several different external swf movies and all of them load right and stay in right position once window gets resized except on one which is video gallery. I am using flvPlayerpro to play my flv videos so i think the problem is with this video gallery not in my main movie as all other external movies stay in its position once i resize window...

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved