ActionScript 3.0 :: Can't Target Main Stage From Dynamically Loaded Swf?
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
Similar Posts:
Apr 14, 2004
Is it possible to target a loaded movie within the main timeline and stop sounds in that particular movie only?
View 4 Replies
Dec 9, 2003
I have two movie clips on the main stage: mcNav and mcContent1 (mcContent1 is located in the 2nd frame).
When I click btn1 which is a movie clip within mcNav, I want to go to the 2nd frame on the main stage where mcContent1 is located.
And then go to frame 10 within mcContent1 and stop.
Here's what I have:
btn1.onRelease = function() {
_root.gotoFrame(2).mcContent1.stop(frame 10);
View 2 Replies
Jan 1, 2004
I have a looped sound and some components in my main movie (scroll bar) which for some reason is really bogging down my swf and causing the preloader bar not to show up until like 46% or something ridiculous.So I am trying to solve the problem by having a preloader swf as suggested by Kode in this thread. However, now all my targeting is messed up in my main movie. Everything that was _root has to change but I can't tell what to load it into. I tried using _parent, _parent._parent, _root.container_mc (which is a blank movie clip created in the preloader swf that main is loaded into after the preloader is 100%) and others but nothing works. Even the simple looped sound which was originally just _root.backsound.start(0,999) can't be targeted.how to target things on my main stage based on the preloader swf?
View 14 Replies
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
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
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
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
May 15, 2009
I am trying to set value of a textbox inside a swf loaded dinamically in the main swf...i am using
Code:
this.getChildByName("nuvoletta").textbox_value.text = "something";
but i get error 1199
I am forced using getchildbyname
View 1 Replies
Apr 14, 2004
Is it possible to target a loaded movie within the main timeline and stop sounds in that particular movie only?
View 4 Replies
Nov 20, 2010
I want to load an external swf and dynamically attach the mc's in the loaded swf to the main movie. Is it possible to reference the linkage properties of the externally loaded swf in this way?
View 1 Replies
May 31, 2009
I'm doing quite a complicated game with a lot of code but one thing I can't quite figure out is how to trigger a function on the main stage from a dynamically added object.I've tried using custom events, but it doesn't work and doesn't throw any errors either.Here's the code for the CustomEvent class:
Code:
package
{
import flash.events.Event;[code]....
Here's the code part in the dynamically added child(CustomEvent is imported):
Code:
this.parent.dispatchEvent(new CustomEvent(null));
and here's the main timeline part of the code:
Code:
stage.addEventListener(CustomEvent.CUSTOM, checkMoney);
//more code here
function checkMoney(e:CustomEvent)[code].....
All of the above seems to work, because it doesn't throw an error, but it doesn't trace money when the event is dispatched.Before you ask, the event IS being dispatched or at least the if method it's in is entered.Any other method to tell the stage it's time to run the function is welcome also
View 6 Replies
Oct 11, 2010
i have a UILoader that loads an image from an xml list when you click its thumbnail ( in its thumbnails mc on mainstage aswell) thing is, i have another UILoader on the layer above that loads in a swf ( a slideshow that fades in and out the pictures when they change to the next, with all the coding on frame 1, frame 2 only has a stop and some code for when the mouse is idle for 5 secs it goes back to frame 1) so when you go to "portraits" it takes you to frame "x" where the slideshow ( loaded external swf ) starts playing automaticly right, if i click any thumbnail the slideshow goes to frame 2 ( wich is perfect and the mouse idle thing i wanted works great ) the ONLY THING IS
after the slideshow runs by default for the first time ( i enter the category portraits ) and i click any thumbnail ( moving slideshow swf to frame 2 enabling mouse idle event ) and the mouse is idle ( so it does the event and starts playing the slideshow again ( goes back to frame 1 ) ) I CANT MAKE THE UILOADER OF THE THUMBS IMAGE TO DISSAPPEAR!
View 5 Replies
Jun 16, 2009
I am uploading different size of images dynamically but at the same time I want the stage to be resized accordingly to image's height and width.
View 11 Replies
Apr 6, 2011
I have a heck of time here with an issue. I have an xml document that when a certain button on the stage is clicked it loads it's corresponding external swf into an empty movieclip on the stage. This empty movie clip is a holder for all external swfs.So what I'm trying to do is when an external swf is loaded that has buttons on it, I need those buttons to communicate with the main timeline and remove a mc that is on the Stage. I need the currently loaded swf(s) to be able to do this.So whatever the currently loaded external swf is that's loaded, I need it to talk to the main timeline. (I have quite a few external swfs that need to do this) So I imagine I need to somehow target the currently loaded external swf to get it to talk to the main timeline.The code below in summary doesn't work but it doesn't give errors either. I don't pretend to know what I'm doing and I haven't been successful in searching for a solution to this particular issue.
// main timeline object
var index:Object=this;
function loadComplete (e:Event) {
[code].....
View 3 Replies
Feb 7, 2006
Is there any way to check the currentframe or totalframes of a movie loaded into a 'holder clip' on the main stage? Everything i try just comes back with 1 frame despite there being more than that?
View 3 Replies
Apr 28, 2009
I have a stage with an external SWF loaded onto it. The stage scales dynamically to fill the size of the window.
Two problems: - I want certain items inside that loaded SWF to scale horizontally and vertically to fill the size of the stage.
- I want other items inside that movieclip to stay the same size, but be "attached" to the top and left of the stage.
View 3 Replies
Jul 28, 2010
I have simple file 550 x 450, in it there is one container 400x300, x:75, y:78. In the container I am loading images and there is drag and drop function for them. I also have added mask with size that matches the size of the container because when i load larger images i could move them. Everything is working fine, but If I set scaleX and scaleY to the container image, the drag and drop functionality is not working fine - I can't reach the edges of the picture.
Code:
with ( m_mask.graphics )
{
beginFill( 0x000000 );
[Code].....
It behaves like there is not enough space to move the image right, left, top or down.
View 1 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
Dec 16, 2010
The issue I'm having is that I have a main "wrapper" 100x100 (but it could be any size) - it's just there to hold and display whatever content, swf, gif, etc we may want to throw into it. As long as the loaded content doesn't have 3D animation like rotationY going on, it displays fine. But when it does, the 3D "anchor" properties (like projectionCenter) of the loaded swf inherit those of the main timeline (i.e. 100x100 (main) vs 728x90 (loaded)). If I change the dimension of the main "wrapper" in Flash IDE to match what's coming in - the 3D behaves fine, but I won't know what the dimensions of the content will be until it comes, so I need a way (if there is one) to dynamically alter the main "wrapper" or root display object through AS. Stuff like "this.width = loader.width" or "stage.width = loader.width" or "root.width = loader.width" etc doesn't work. Flex has the hBox and vBox
View 1 Replies
Oct 16, 2011
what I'm trying to do is accessingsnapText = scrollPane.source.textSnapshot;from an external swf. I've tried:
trace("-->: "+scrollPane.source.textSnapshot.getText(0, 1000));
trace("-->: "+myLoader.content.textSnapshot.getText(0, 1000));
trace("-->: "+mc.textSnapshot.getText(0, 1000));
[code].....
View 3 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
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
Nov 1, 2011
What I am trying to do is to make a moveclip change the frame of the main timeline.Right now, I have a moveclip on frame 5 with the code:
on (keypress "1") {
_root.gotoAndStop(10);
}
[code].....
View 1 Replies
Jul 29, 2003
Ok this is probably obvious and real dumb but...I can't seem to target a MC from my main timeline. I wanna tell my movieclip to start playing from frame 2 when an on (release) event handler is invoked from the main timeline. This is what I got but its not working. Help anyone?
[AS]
on (release) {
this.maskedimaged.gotoAndPlay(2);
}
[/AS]
View 10 Replies
Apr 14, 2009
how to return to the main time line from within my movie clip. I thought it was something like _root.gotoAndPlay(4); but all I'm getting is errors.
View 1 Replies
Apr 5, 2010
I have 7 buttons on the main stage that go to different parts of the main timeline, all of which have the same movie clip with 7 different frames. Right now it always goes to the first frame of the movie clip, but I need the second button to go to the second frame, and so on. I was originally trying to have the button itself find a frame label inside the movie clip, but now I realize I probably need to attach something to the key frames of the main timeline that tells it to go to a specific part of the movie clip. The problem is I can't figure out how to address the movie clip from the main timeline. The book I started learning from had a short section on declaring movie clips, and I cobbled together this bit of code and put in on a key frame in the main timeline.
Code: Select allvar viewwork:MovieClip = root.viewwork
viewwork.gotoAndStop(2);
I'm pretty sure that's completely wrong, as it gives me the error: 1119: Access of possibly undefined property viewwork through a reference with static type flash.display:DisplayObject.
So how do I properly reference a movie clip from the main timeline? Also, I'm using an external .as file for most of my actions, but I'm sticking this directly on the frame because I haven't even thought about trying to figure out how to target a specific frame from an external file. Is that going to cause problems?
View 1 Replies
Oct 1, 2009
I have some submenu buttons in a movieclip on the mainline. My first level of navigation in on main timeline. The submenus are grouped in movieclips on the main timeline. I basically used the same code on the main navigation for the sub navigation except the code for the submenus is in that movie clip. My trace statement reads the button is clicked (which was a quantum leap for me) but I know I need some kind of _parent code in there so it knows to go to label back on main timeline. I feel like I am so close.
Also is this an ok way to set this up? I couldn't figure out how to do it in one frame. I didn't realize this basic framework was going to be so difficult.
[Code].....
View 5 Replies
Dec 10, 2009
So here's the run down. I'm trying to target a timer that is declared on the main time line (frame1) from within a movieclip. So here is the code for the timer on the main timeline:
ActionScript Code:
var timer1:Timer = new Timer(1000);
timer1.addEventListener(TimerEvent.TIMER, timedFunc1);
timer1.start();
The name of the movieclip is ssRightMask_mc. I'm trying to get the currentCount from timer1, but I'm having some targeting issues. I've tried:
[Code]...
View 7 Replies
Mar 30, 2012
Im trying to load my external swf which is a drop and drop swf into the main swf but when i load it only the drag works and the target is not detected so it doesn't drop.the pop up also stops working in the main swf when you type test1 or test2.heres the code i use to load swf in the main swf :
myContainer2.loadMovie("externaldrag.swf");
View 9 Replies