ActionScript 3.0 :: Flex Accessing Timeline Of A Container
Apr 21, 2009
I don't understand how to access Timeline of a container correctly, if its nested in another Container etc for Menu buttons:
on main stage:
MovieClip Products_mc , subContainer
----------------|----------------------------------|---------------------------
|
|
var dMenu:MovieClip = new SPC();
[Code].....
How can I access the SPC's TimeLine (its a MovieClip) I have tried getchildByName,by Index, saying its MovieClip works only for questioning the parameters of the parameters etc, but it will not get to the TimeLine
View 1 Replies
Similar Posts:
Oct 19, 2006
Using MovieClipLoader, is it possible for the loaded swfs to access movie clips in the container swf movie? In building a preloader for a previously produced flash app (originally made for CD), I was running across huge problems with some dynamically created masks (created using attachMovie and setMask). My solution (not ideal, I guess) was to move the masks and the masked objects into the preloader ("container") movie. But still need to move them around by code located inside the swf being loaded.
Relevant code from inside the preloader:
myMCL.onLoadInit = function() {
_root.attachMovie("screenText12", "screenText12", 15)
_root.attachMovie("internalMask", "internalMask12", 17)
_root.screenText12.setMask("internalMask12");
}
And from inside the swf being loaded:
_root.screen12.onMotionFinished = function() {
screenText12InY = new Tween(_root.screenText12, "_y",mx.transitions.easing.Regular.easeOut, 463, 403, .5, true);
The red is where I'm not sure of how to get in contact with the movie clip in the preloader.
View 1 Replies
Jul 2, 2011
In a Flex Mobile project I have a simple itemRenderer where I'm trying to create an "bubble" texting effect, similar to ichat or iphone (just so you get what im going for). But if the text is longer than the screen it runs off, rather than just going down a line.
If I set Group thats holding the rectangle(to create the bubble effect) and the label to 100% it works and keeps it from exceeding the list containers bounds, BUT the group is always at 100% and looks bad, I'm trying to keep the "bubble" JUST AROUND the text.
Anyway so, at the top of my itemRenderer I tried specifying:
<s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" width="100%" height="100%">
And here's my layout I figured since msg_container has a width of 100% I was hoping bubble_lable_group would just not exceed that but...it doesnt...it just runs off. I tried setting a max width but that does not allow you to input percents. And just to say it 1 more time. I know if i set bubble_lable_group width to 100% it works, and keeps it from going off the edge, but then the rectangle "bubble" stretches all the way across and just looks bad.
<s:VGroup id="main_container" horizontalAlign="left" paddingBottom="10" paddingTop="10"
verticalAlign="top" width="100%">
[Code]....
View 1 Replies
Jun 8, 2011
Basically, I have a menu created using XML. Each menu item has a fill that fades in and out as the user scrolls over them. What I want to happen is that when an item is clicked, it stays highlighted. The problem comes when I click on the second item. I can't get the first item to "unselect."Here is the menu code and functions.
Code:
var menuHolder:MovieClip = new MovieClip();
menuHolder.x = myMask.x;
[code].....
View 6 Replies
Sep 21, 2011
I have a loop that goes through data from a book and displays it. The book is not consistent in it's layout so I am trying to display it in two different ways. First way(works fine) is to load the text from that section in to a panel and display it. The second way is to create a new panel (panel creates fine) and then add collapsable panels(nested) to that panel. Here is the code from the else loop.
else if (newPanel == false){
// simpleData is just for the title bar of the new panel
// otherwise the panel has no content
[Code]....
The error I get is: ReferenceError: Error #1069: Property panel4.4 not found on components.readTest and there is no default value.
I have tried setting the "name" property instead of the "id" property.
View 1 Replies
Dec 23, 2010
I have a viewstack container w/ 3 views: red, black, and blue. How can I completely hide the black & not include it?
[Code]...
View 2 Replies
Jan 13, 2012
I am creating an flex Air project,so mxml file will run. I have circles in one Big circle at one side and will be same on other side.
Now how to drag any circle from any Big circle to other side. Or it could be like any two container having circles, then how to drag and drop circle?
For one circle i am able to do drag and drop.But I want one Big circle on left hand side and one big circle on right hand side .And small circles with class names will be in these big circles.Now i want to drag and drop those small circles in big circles.Big cicles should not move. Even i have tried this code in actionscript
package
{
import flash.display.Sprite;
import flash.events.MouseEvent;
[Code].....
But in this i want big circles should not move and small circles should only be dragged.
View 1 Replies
May 19, 2009
I have 3 movieclips on the main stage.
btn1, 2, 3
I have this code in the maintime line, that when i click a button, the btn the stays static (like its on), when i click another btn, it switches on the next button and loads an external swf.
Each button's instance name is button1, 2, 3..and more buttons I add the stage I would increase the button number, so for 3 buttons on stage I have up (var buttonNum:Number = 3
code//
var buttonNum:Number = 1;
for (i=1; i<=buttonNum; i++) {
this["button"+i].onRollOver = function() {
[Code].....
This all works fine.
I have built a scroller with thumbnails as movieclips and would like to add this code to movieclips.
The thumbnails are indivdual moviclips and are inside a movieclip (productscroll), as the dragbar i am using targets the clip (productscroll) to scroll the thumbnails.
I basically need the same actions as the buttons. When I click a thumbnail I need to load an external swf.
View 3 Replies
May 1, 2005
I want to create a container MC on the main timeline and have different buttons that load a different navigation within the same container, and also has a preloader.
View 2 Replies
Aug 5, 2009
I have a container movieClip that is centered whenever the browser resizes. In the container, I have a preloader MC and my content MC. But for some reason I can't get the preloaderMC to work. Does the preloader have to be on the main timeline? Would somebody mind taking a look at the preloader code to let me know if there is anything I can change?
Here is the code:
Code:
//set mask
grad.setMask(percentage_mc2);
onEnterFrame = function () {
//Get bytes loaded of _root timeline and calculate percentage loaded based on total bytes
loading = _root.getBytesLoaded();
[Code] .....
View 9 Replies
Jan 27, 2010
I'm currently working on a custom component which extends Canvas (let's call it SuperCanvas) ; it's basically a container that let you zoom & pan its contents. It would be too long to explain why, but I can't use scrollRect, so I was forced to declare a Canvas object (called innerCanvas)... inside my SuperCanvas (I know, not very nice =/) I would like to know if there's a proper way to "redirect" the creation of my component's children in this canvas.
[Code]...
View 1 Replies
Dec 27, 2010
I have an AS2 .fla with all of my stage items on the timeline as opposed to inside a container swf. I must chose Center vertical and Horizontal options in the HTML alignment options when publishing in order for my movie to be perfectly centered in the middle of the browser. I would like to have a FULL Browser Background Image, however when I try using the following code, my background ("bg") does not fill the entire browser.
what I am doing wrong and if it is even possible to have a full browser background image while still using CENTER alignment in the HTML publish settings? I have tried the following code with and without the Stage align settings and with the xy coordinates centered-still no luck!
bg.Stage.align = "TL";
Stage.scaleMode = "noScale";
bg._width =Stage.width;
bg._height =stage.stageHeight;
bg.x = 0;
bg.y = 0;
View 30 Replies
Jun 5, 2009
How to access the timeline of a movieclip from inside ANOTHER movieclip (both MCs are placed on the root timeline BUT in different frames)
(if not possible, AS3 instead?)
View 5 Replies
Oct 23, 2009
I'm trying to write a class that somehow emulates the old AS2 gotoAndPlay(); function, but i'm failing to find a way to reference the timeline that is calling the Class Constructor.
this is what i am using to call the class, i'm placing this code in the frame of the timeline i want to control. but it always gives me a null error.
I Know senocular adressed the timeline issues in one of this forum's post, but i can't figure out what to do in order to register this class in the specific timeline in order to control it.
the frame goes like this:
[Code]....
View 3 Replies
Jul 15, 2011
I'm using flash CS 5.5 and AS 3.0 . I've a movieclip that contains 3 more moviclips that are acting as toggle buttons. I want to change frame number / label of main time line upon click of these buttons. With _root no longer available I dont know know how to do it.
View 2 Replies
May 8, 2009
I have multiple instances of a movieclip (a1) within the main timeline. These instances move around via tweening within the main timeline. The instances also appear (are added) and disappear (are removed) while the main timeline is playing.
Within the movieclip is this actionscript:
[Code].....
How can I access the main timeline from each instance (even when it is not currently on stage)? how I can keep all of my code within the movieclip?
View 2 Replies
Jul 11, 2010
I have a very simple fla consisting of a picture and a sound on separate timelines. In AS3, I want to determine the sound is complete and go to another URL. I have the code for changing URLs working in a separate function. What I can't figure out is how to get the soundComplete to work when I'm not playing the sound with ActionScript
View 11 Replies
Feb 1, 2011
I have a variable declared in AS code on the main timeline, which I want to access from the timeline of an underlying movieclip. How do I do this?
View 4 Replies
Nov 20, 2010
everyone comes across when switching from AS2 to AS3. I have two movieclips (on the same timeline)- character and walls. on the timeline inside walls, I want to access the x and y coordinates of character. How can this be done without the convenience of _root or _parent?
View 1 Replies
Jun 9, 2011
number = '12345' I'm trying to hook my counter up to a PHP script that echo's a DB query. Now I've had no issue passing the variable and I can even display it in a dynamic text field but no matter what I try I cannot get the "number" varibable to use my PHP variable The dynamic text field shows the correct value clear as day but the counter just shows "undefined".
[Code]....
View 9 Replies
Jun 5, 2009
How to access the timeline of a movieclip from inside ANOTHER movieclip (both MCs are placed on the root timeline BUT in different frames) (if not possible, AS3 instead?)
View 3 Replies
Jan 26, 2008
I have multiple instances of a movieclip (a1) within the main timeline. These instances move around via tweening within the main timeline. The instances also appear (are added) and disappear (are removed) while the main timeline is playing. Within the movieclip is this actionscript:
(code)
addEventListener(Event.ENTER_FRAME, ef);
function ef(evt:Event):void
[code].....
View 2 Replies
Apr 28, 2005
I'm trying to access this function from another timeline. This function resides on the root level and I want to access it from a button within an MC on the main timeline. How can I do this?
Code:
vol_onBTN.onRelease = function() {
vol_offBTN._visible = true;
[Code].....
View 1 Replies
Apr 29, 2010
I'm definitely more designer than flash developer (as most of you might know. At least those that hang in the lounge or Arena). I need to know how to allow a loaded .swf file to control the main timeline in AS3.
I have a container .swf that includes global controls (jump menu/volume control) and branding. Loading a swf for the dialogue boxes (timeline animated ... although I realize there may be better ways to handle it). Another swf for a simcity-ish illustration that has animated elements with various states. I need all to be able to communicate with each other. I was able to load the movies no problem. Even communicate with the loaded ones from the main timeline. Just need to be able to go the other way.
View 2 Replies
Jun 25, 2009
i use MovieClip(this.parent) to access a variable that's outside of the movieclip i'm currently writing code in. However, this doesn't work within two functions.For example:
function editMainText (e:Event) {
MovieClip(this.parent).headline.text = "Hello"[code]....
doesn't work.There are probably a few small errors in my code, but i essentially need to know how to modify MovieClip(this.parent) to work within the second function.
View 4 Replies
Sep 23, 2009
this is the scenario:main class loads a lot of SWF, each with a timeline streaming sound (need this way for sync with animation) I need to access swf-sound peaks to control volume of a main class dynamic loaded mp3.
all loaded swf are added to main swf as "Page" class that extends MovieClip
How can i access sound channel of loaded swf ?
View 2 Replies
Feb 18, 2008
I have some variables declared on the root timeline that I need to access from some MovieClips. In AS2 I would do something like this _parent.myVar from within my MovieClip. I intend on getting fully up to speed with AS3 but right now I need a quick fix.on the root timeline I have a variable : var myHitTest:Boolean = false;My MovieClip needs to access this var so I tried it several ways listed here. I've had no success.
parent.myHitTest:Boolean
root.myHitTest:Boolean
Stage.myHitTest:Boolean
[code].....
View 6 Replies
Aug 17, 2009
im attempting to keep it as portable as possible so its easier to edit later, and i dont have to go around copying/pasting too much code. - i'll cut to the chase..
On my main timeline, i load all the image-file names, as variables.. using loadvars into thumbnails, which ive given instancenames Loader_1 to Loader_20, inside these thumbnails is the Loader component Thumb_1. Here is the code on the main timeline, to load these variables.
Code:
BigLoader._visible = false;
var my_lv:LoadVars = new LoadVars();
// load variable function
[Code]....
how i could make this more portable without -completely- changing the format its in [so i can still understand it]
View 9 Replies
Jun 8, 2010
i have a mc in wich timeline i put (manually) a mc called joe_mc. The first one (the container) holds all the code: A timer function slows down joe_mc and when it reaches its last frame its suppossed to play the next frame on the container mc timeline. Here�s the code:
[Code]...
View 5 Replies
Mar 11, 2009
I have a question about accessing functions or variables on the main timeline from a loaded swf. I know that there are a few ways to do this
1. Casting the timeline as a movie clip
Loader SWF Script
var testText:String = "Test";
var myLoader:Loader = new Loader();
loadData("loaded.swf");
function LoadData(aURL){
myLoader.load(new URLRequest(aURL));
addChild(myLoader);
}
2. Cast the timeline as a generic object
var parentObj:Object = this.parent as Object;
parentObj.unloadSWF("loaded.swf")
Why can you not just reference the main timeline of the container swf directly.
View 5 Replies