ActionScript 3.0 :: Cuepoint Listener Can't Target Dynamically Loaded Swf
Mar 15, 2011
I'm having trouble adding a cuepoint listener to a dynamically loaded .flv which targets a dynamically loaded .swf. I'm also adding cuepoints via actionscript.
Basically everything loads okay but I get a compile error in the the function cuePointHandler when referencing mc_slideLoader.
Scene 1, Layer 'Actions', Frame 1, Line 601061: Call to a possibly undefined method gotoAndPlay through a reference with static type flash.display:Loader.
I'm still a rookie with AS3 so I'm thinking the Loader class doesn't have a gotoAndPlay property and some how I have to get it to act like a MovieClip?
Here's the actionscript.
ActionScript Code:
// using Flash version CS5
import fl.video.*;
import fl.video.FLVPlayback;
[Code]....
View 7 Replies
Similar Posts:
Jul 30, 2010
A part of the Flash app. I'm working on right now does the following -Main stage loads an external swf using the following function:
function loadAsset(evt:String):void{
var assetName:String = evt;
if (assetName != null){
[code].....
View 25 Replies
Jan 3, 2007
I have a script that loads images and text from an XML file into movieclips.The following code is what creates the movieclips that contain the elements:
Code:
var thumb_mc:MovieClip = _root.mc_conteudo.createEmptyMovieClip("thumb"+(1+i), _root.mc_conteudo.getNextHighestDepth());
var img_mc:MovieClip = thumb_mc.createEmptyMovieClip("img", 0);
I can't seem to find a way to target the thumb_mc or the img_mc so they have rollover effects and actions (they are created for each set in the xml file, so there are multiple mc's)mc_conteudo is the content mc that scrolls.The swf is here: http:[url].....
View 13 Replies
Aug 4, 2009
However, either I'm declaring my variables at the wrong bit/way or there is another problem, as I have been able to add the child I want to from the display list (sidepoint: is it right to call the display list everything in the library on stage at runtime plus those things you have exported for actionscript usage??!)...but when I want to remove it at the next cuepoint nothing happens. I feel this is a basic principle that is alluding me here.
Code:
vid.addEventListener(MetadataEvent.CUE_POINT, cueText);
function cueText(e:MetadataEvent): void{
[code]....
View 1 Replies
Oct 4, 2010
Code:
var buttons:Array = new Array(
_button1,
_button2,[code]........
I have 3 buttons on my stage (this is a small part of a larger project), named _button1, _button2, _button3 declared in an array so I can dynamically assign listeners and use a substring of the instance name to determine which button was clicked for other functions.My problem is that trace(e.target.name); returns the value _button1 on ROLL_OVER and ROLL_OUT as expected. However when clicking the button it returns "instance9" instead of the actual instance name I gave it.Why is this happening and how do I make it return the correct name? Why the hell would my buttonClicked function return a different result from the buttonOver function where the target is the same button for each function?
View 3 Replies
Dec 23, 2010
How to target the MovieClip in the listener of its tween ? I have an Array of MovieClip and each one have its own Tween. Each Tween have its own Listener. I want to target the MovieClip in the listener. I search in many forums and tutorials and I don't find anything convincing.
[Code]...
View 2 Replies
Jan 22, 2010
I'm looking for an alternative to using:
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyFunction);
The problem I am encountering is that eventListener above works fine on its own(stand-alone swf), but when loading an .swf externally into another .swf, the listener fails with the following error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
How can you target the event listener when loading as an external .swf differently?
View 3 Replies
Jan 27, 2012
I'm trying to write a code and put an e.targaet in a event listener,here's the code,
interBut.addEventListener(MouseEvent.MOUSE_OVER, menuButOver);
function menuButOver(e:MouseEvent){
Object(root).e.target.name.gotoAndPlay(2);
}
what am I doing wrong,
View 2 Replies
Nov 14, 2008
So I have this code to create and load an external swf. I am trying to write a simple function to target the mc within the loaded swf. Once clicked I want it to load a new swf inside the same mc (container_mc). I'm having trouble even targeting that button though. Any thoughts?
[Code]...
View 3 Replies
Dec 6, 2010
Say you create a dynamic movieClip, and also dynamically add an event listener to it.Then you addChild the clip.Now it comes time to get rid of it - you want to get rid of the object and it's event listener.[code]What I'm trying to do is have a close button on each movieclip that when clicked, runs a function to remove the clip and it's children from display and also remove references to it so that it can be ready for garbage collection.
View 2 Replies
May 13, 2010
how can i access event.target outside event listener method.say for example
my_mc.addEventListener(MouseEvent.CLICK, onC);
function onC(e:MouseEvent):void
{
var m:MovieClip = e.target as MovieClip;
}
trace(m.totalframes);/// not working
now what if i want to get totalframe property of m instance, in short for every movieClip clicked.
View 11 Replies
Jul 30, 2009
I have these buttons in a movie clip and I would like to have only one event listener for the parent, using event.target to point to the children. I have also tried event.currentTarget, and it didn't work.here is the code that works:
test01.abtn.addEventListener(MouseEvent.ROLL_OVER, mouseHandler);
test01.bbtn.addEventListener(MouseEvent.ROLL_OVER, mouseHandler);
test01.cbtn.addEventListener(MouseEvent.ROLL_OVER, mouseHandler);[code]....
It is only targeting the movie clip, not the buttons inside the movie clip.
View 4 Replies
Sep 20, 2011
I've worked out a way to get the proper instance name in stored in a variable (called listName), and I've got a SOUND_COMPLETE listener applied to my sound channel. What I need to happen is, when the function called by the SOUND_COMPLETE event fires, the object on the stage with the instance name that matches the string currently stored is affected.[code]...
View 3 Replies
Sep 3, 2009
I am learning AS3, and I am trying to understand how to target dynamically created objectsI have the code:
Code:
for (var i:Number = 0; i<5; i++) {
var boton:CreateButton(stage.stageWidth/5,30,0,1,colors[i],test,0xFFFFFF,"English");
[code].....
View 6 Replies
Apr 8, 2005
I attached some movieclips dynamically from the library, and the MC contains a button symbol called "myBtn", I would like to let it load another swf on _level3...below is part of my Actionscript.
[AS]
stop();
//-------------------------
this.container.myText.html = true;
[code]....
How would I go about targeting the button instance and tell it to load an swf?
View 8 Replies
Aug 29, 2010
I'll present my problem in a few steps:
- I have a constructor method which is trigerred automatically once the program starts
- The method's argument determines whether or not an enter frame event is to be added(move:Boolean = true)
- If true, add the event listener
- there are getters and setters created to access the variables from another class
The problem is that the event listener is run only once - at the initial phase, so it checks the move's value just once (true - add, false - don't add), so it can be turned on and off only in this class. I want to allow a user to change its value from an external class, which is impossible even with getters and setters, because it adds the listener before the user even gets a chance to change it. I want the listener to be added only if the user wants it to. I know it looks complicated,
View 2 Replies
Mar 22, 2011
I have a preloader that is being served from a CDN, and I want it to load the target SWF also from the CDN but when it uses loaderInfo, it returns the hostname of the html file.[code]Is there some way that I can get the URL that the preloader was served from which is the CDN?
View 1 Replies
Jul 10, 2007
Short version: I'm trying to load an external .swf from a URL and add event handlers to the movie clips (or it's movie clips sub-MCs) on its stage. I can't find a THING online on how to do this.Details:I've been tasked by my employer to build a simple control interface in flash, with just a few buttons to do things like display some info or images or maybe an associated MP3. I've written little test apps to do all of these individual things & managed to fake my way through.But the sticking point is that I'm now trying to place all the UI controls into an external .swf, which I then load into the canvas by a URL. The goal is to be able to load it into a variable named, say, 'private _ui:MovieClip' and then add event handlers to mivie clips within that bynamelike:_ui.someButton1.addEventListener(MouseEvent.MOUSE_ UP,handlerFunction1);_ui.controlStrip.someButton2.addEventListener(Mous eEvent.MOUSE_UP,handlerFunction2);The goal is that if we want to swap out the UI for a particular client, we just export a new .swf with all the correctly named MC instances & use the new URL to load the UI.I seem to be able to load the .swf OK and trace the movie clips "Main Timeline" like so:
_ui2.contentLoaderInfo.addEventListener(Event.COMP LETE , uiDidLoad);
function uiDidLoad(evt:Event){
trace("UI2 LOADED");
[code].....
View 14 Replies
Apr 17, 2009
So I have an object, generated on each click of the mouse. It's set up as a series of points with properties, with values for position randomly calculated, and set around where the user clicks the mouse. Lines are drawn from where the mouse is clicked out to each of these points, so it kind of looks like a star, but only lines, rather than a solid shape (like those old 50's atom clocks?). So once clicked there's an enter frame event listener on the object so that each of the points 'wobble' (using a randomly generated number) up and down around the original point.
For some reason, I can either set it so that on each new click of the mouse and newly generated object, the last one stops "wobbling" and only the new one does, or each new object moves to where the new object is, and maybe is still wobbling(?), but is underneath the new object. This way has the event.target as a new object in the wobble function, so I think it may be just a case of where the centre point is - i.e. saving the mouse x and y for each object individually, or perhaps I have too much of the setup function code repeated in my "wobble"function?
[Code]...
View 3 Replies
Feb 10, 2011
I've dynamically created event listeners in the usual sort of way:
Code:
myText.addEventListener(MouseEvent.MOUSE_OVER, hover(nameLabel));
function hover(nameLabel):Function
{
[Code].....
The problem is how to remove the event listener later in the program as the usual code isn't working. I'm guessing I should have done this in a class but I'd like to understand this problem better.
View 5 Replies
Feb 5, 2010
I have a swf called anim1.swf acting as a preloder and loading anim2.swf. anim1.swf is attached to a document class called Racine.as. Once anim2.swf is loaded, how can I target the root of anim2.swf?
For example, anim2.swf contains 2 clips called clip1 and clip2. clip1 contains a child called clip1_1. How can I access clip2 from within clip1_1 by using an absolute way (I don't want to use the parent property)?
N.B : a way would be to have a document class attached to anim2.swf, but here there is none.
View 5 Replies
Jan 26, 2007
I'm loading a swf into a container clip and I'd like to target this swf for control such as gotoAndPlay, etc.
I thought targeting the container clip would do it but it's not. Here's my script so far:
var mediaMenu:MovieClip = this.createEmptyMovieClip("mediaMenuHolder", 1);
mediaMenu._x = 15;
mediaMenu._y = 175;
var mediaMenuLoader:MovieClipLoader = new MovieClipLoader();
mediaMenuLoader.loadClip("mediaMenu.swf", "mediaMenuHolder");
this.mediaMenuHolder.gotoAndPlay(2);
The swf is loading but I can't seem to give it any instructions.
View 2 Replies
Nov 17, 2009
I have a swf loaded into another swf , is there a way to monitor the errors that accur in the loaded swf and trace them outside ?
View 1 Replies
May 30, 2009
Can someone help me out and tell me how i can set the size of an external swf i have loaded into a target movieclip.ive got the external swf loading into the target ok but its too big.
View 3 Replies
Jun 15, 2009
i have creating an image gallery of sorts. I have loaded my thumbnails through an xml like so:
Code:
function loadThumbs(){
for (var i = 0; i < totalElements; i++){
var thumb_url = elements[i].@thumbSrc;
trace("totalElements: " + totalElements);
[code]....
now i want to have it so that when u click a thumb, it re-layers them. I am able to get the one u click to the front of the order, but how can i tell the others to layer as i want? I guess the problem is that I cannot use the name of the display object and i can't user image_loader to setChildIndex with.
Code:
function replaceElementAndMoveThumb(event:MouseEvent):void{
setChildIndex(event.currentTarget, numChildren - 1);
trace(event.currentTarget);
}
I am thinking that in AS2 I would use the movieclip instance name, but don't think this works in AS3.
View 2 Replies
Oct 1, 2010
I'm trying to somehow target a MC being loaded into an empty container MC. I've tried everything I could think of.
Basically, I'm making a movie editor. Right now clips are added to the stage on initial load, then when they are clicked on they are added to the "reel" and they can be previewed in the order that they are added. Now, I'm trying to get it so that when they are on the "reel" they can be click and dragged and rearranged.
Here's how the clips are added to the stage in a function called loadClips():
ActionScript Code:
addChild(clip1);
clip1.name = "1";
Here's how they are being added to the "reel" in addClips():
ActionScript Code:
if (currentTarget.name == "1")
{
clipCopy = new Clip1();
[Code]....
Now, I just want the clips that are on the reel to be click and drag-able (along the X axis but I'll worry about that later). I realize now they're all being added as clipCopy. That's going to be an issue huh? Is there a way that I can target the container and make that mobile?
View 2 Replies
Aug 8, 2002
is it possiable to target/query a specific frame in a movie that i am loading into an empty MC...?
eg:
on (release){
if (loadedMoviePath._currentframe == 10);
loadedMoviePath.MC1.play();
}
loadedMoviePath - what would the path to the MC in the movie that has been loaded be?
whatGoesHere.MC1
View 2 Replies
Nov 5, 2006
I'm trying to target a .swf that I loaded into a movie clip (mc_container) but it seems like I'm missing something. Can you take a look and see where I went wrong?
Code:
mc_container.loadMovie("mc_photoSwap.swf");
//homepage Animation Swap Images
function photoSwapAni(){
switch(random(3)){
[Code]...
Also I see I'm going to have an issue with the random part because it could call the same animation twice or more times in a row. Should I ad some sort of if statement or is there a better way to do this random part of the code?
View 10 Replies
Jun 27, 2009
how i can set the size of an external swf i have loaded into a target movieclip ive got the external swf loading into the target ok but its too big.
View 2 Replies
Oct 18, 2011
I'm using buttons to send the playhead to frames in which swfs are then loaded into an otherwise blank movieclip called "stage_target_mc" ...how can I then flush out the previously loaded swf so only a newly loaded swf displays in "stage_target_mc"?For example, after clicking upon the 'about' button the 'about' swf loads...then if the 'concepts' button is clicked the 'concepts' swf loads -- but the previously loaded 'about' swf still plays...I would like to be able to flush the 'about' swf so only 'concepts' is display, in this example.code associated with buttons used to send playhead to frames "concepts" or "about":[code]
View 1 Replies