ActionScript 3.0 :: Controlling Objects In A Loaded Swf At Any Given Time

Jul 13, 2010

I want to communicate with an object within a loaded swf. I know I can use this event listener and function to do so right when the swf has completed loading:
 
imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadSections)
function loadSections(event:Event):void        {            event.target.content.mc.y+=2
}
 
But I want to be able to manipulate a given object from the loaded swf at any time not just when the loading is complete. So basically as long as the swf is loaded, is there a way to manipulate objects and call functions within that swf?
 
Both the external and host swf are AS3.

View 11 Replies


Similar Posts:


Controlling Sound Objects Across Scenes

Nov 14, 2007

I'm doing a project that I have to use scenes in, I have a sound object that i want to be able to control in all scenes. I set up global variables for the sound object and a boolean to check if the sounds currently playing like this :
PHP Code:
_global.sound1= new Sound();
_global.sound1.attachSound("song");
_global.soundplaying = 0;

In each scene I have two buttons a stop and a play button, Heres my code for play:
PHP Code:
if(!_global.soundplaying){
_global.sound1.start();
_global.soundplaying = 1;
}

And stop:
PHP Code:
_global.stewielaugh.stop();
_global.soundplaying = 0; 
Doesn't seem to work, if I press play in scene one and go to scene 2 and then return to scene one the sound can be played again on top of the already playing sound object.

View 2 Replies

ActionScript 3.0 :: Controlling Time In Each Frame?

Jun 27, 2010

Instead of adding more frames in my timeline in order to get the perfect timing pe keyframe, how can I control the amount of seconds at each keyframe using actionscript 3

View 27 Replies

Controlling Scalability Of Certain Objects In Flash File

Jan 9, 2007

How to control the scalability of certain objects in a flash file. I'm trying to create a full page flash site where the scale of the certain objects stays the same, but a background image scales to how large a user's screen is. A great example of this is at "[URL]."

View 7 Replies

Actionscript 3 :: Controlling Objects Of Another Class That Are Already On The Stage

Mar 3, 2011

Let's say that I've a button object (instance of Flip) and a coin object (instance of Coin) on the stage. The coin object has two frames: one showing Heads and one for Tails.

MyCoin class is as following:

package
{
import flash.display.MovieClip;
public class Coin extends MovieClip

[Code]....

Problem: How do I reach the coin object on the screen via onMouseClick function? Let's say that the object on the stage has instance name of myCoin. I suppose that had I not done this with an external class and simply used actions from the frame I could just use the instance name as a variable. I couldn't figure to do the same it in an external class. Do I first create the object which is already on the stage?

View 1 Replies

ActionScript 2.0 :: Controlling Objects (Sounds) Across MovieClips

Sep 9, 2003

I have a few movie clips running swf's and I need a play/stop button in one clip to control the audio in another clip. The buttons are in the _root clip and the audio is contained in an swf I load into an empty 'content' movie. I have labelled the frame containing the audio but can't seem to use the object hierarchy to access it. On a somewhat similar note, is there a way to have the root movie display the bytes loaded/bytes total of a swf loading over top of the root movie, i.e. in a content empty movieclip?

View 1 Replies

ActionScript 3.0 :: Controlling Speed Of Falling Objects

Feb 19, 2011

I have randomly placed 40 pennies on the stage using a for loop, as well as making some of them smaller. They all start at the top of the stage and, right now, all fall down the stage at the same time.My trouble is trying to get the larger pennies to fall faster than the smaller pennies. I'm not sure how to single them out by size to control the speed.here is the code I have. I am only 3 weeks into ActionScript so please be specific (maybe provide an actual sample of code to use).[code]

View 2 Replies

ActionScript 2.0 :: Controlling Time Of Day To Sync To Image

Jul 22, 2005

I am building a flash movie that will have a image of a building that changes according to the time of day. Which variables to use to tell it when to go to the specific frame the new time of day image is.

Code:
onClipEvent (enterFrame) {
myTime = new Date();
nSeconds = myTime.getSeconds();
nMinutes = myTime.getMinutes();
nHours = myTime.getHours();
[Code] .....

I've managed to get it to switch if I set it to just a number by just adding:
Code:
if (nHours>=1) {
_root.day.gotoandPlay("day")
} else {
_root.day.gotoandPlay("night")

How exactly can I tell it to go according to 7am-8pm and 8pm-7am? Once I figure this part out I'll be able to start adding in more images and detailed times of day, and possibly integrate weather etc in the future.

View 2 Replies

ActionScript 2.0 :: FlashMX - Controlling Multiple Sound Objects?

Jan 6, 2004

I am having problems controlling my sound objects. When the user clicks on a mc on the stage a sound (voice over) starts to play. But if she decides to listen to another sound, she can click on another movie clip...Problem is that when the user clicks on the second movie clip the first sound is still playing while sound number two starts playing as well. I would like the second sound object to replace the first...shouldn't this be possible by using the mySound.stop(); before initiating the new sound object.

Here is part of my code:

Movie Clip one:

on (press) {
mySound=new Sound(this)
mySound.attachSound("voice_one")
mySound.start(0,1);

[code]....

View 3 Replies

Actionscript 3 :: Controlling The Mc's Of A Loaded SWF?

Apr 26, 2010

I have a controller.swf which loads an external swf into a movieclip.

news_mc = loadEvent.currentTarget.content as MovieClip;

the swf is called "news.swf" and has a movieclip on the maintimeline, frame 1 called "sb".

I have tried everything to access this such as

mews_mc.sb.alpha = 0;

but nothing works?

View 1 Replies

ActionScript 3.0 :: Controlling The Loaded SWF?

Jan 20, 2010

I'm loading a SWF into a main SWF using the code bellow, from senocular tutorials:

Code:
var request:URLRequest = new URLRequest("home.swf");
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loadProgress);

[code]....

I have buttons inside a movie clip, at the main movie (parent) and I want to control the home.swf movie that I just loaded. How can I do that?I'm trying this, without any result:

Code:
function botao_clique(e:MouseEvent):void{
MovieClip(root).window_mc.textos_mc.gotoAndStop(2);
}

View 4 Replies

ActionScript 3.0 :: Controlling Audio In Loaded SWF

Jan 23, 2009

I have several flash swf's that are about 10 - 20 min. each. I load these in a player that I have created as the user selects them from a menu in the main swf (a swf player basically). I can pause start and stop the swf's with no problem, but I can't seem to get a handle on controlling the audio. I have the audio in the loaded swf's timelines because I need to sync the audio with the animation taking place in those swfs. I could, take the audio out of the timeline (after syncing it), and then load it separately, but it would be much cleaner for me to just have it in the timeline.

I've resorted to the SoundMixer of the main swf to mute and change the volume, but I can't get hold of the Sound(), soundTransforms etc. of the loaded swf. To assign a play location for the soundChannel I need to access the loaded swf's Sound().Play() function, but I can't seem to do that. I have exported the timeline audio in it's actionscript, supplied a name (same as it's class name), and then tried to access it, but I can't seem to do it (yes I wrap the loaded.content variable in a MovieClip cast--that's how I can control the pause and play of the animation). Tutorials I have found only seem to work with sounds loaded into variables, and none refer accessing timeline sounds in a loaded swf.

View 5 Replies

ActionScript 3.0 :: Controlling Loaded Swf Rewind?

Aug 2, 2009

I need to bring the playhead to the begining (rewind) each time the onsound button is clicked. But a loadimage function was used to load the swf.

View 10 Replies

Professional :: Controlling MovieClip Loaded From SWC

Aug 25, 2011

I'm loading assets from a swc and I need to loop through every frame of the movieclip and find a certain instance so I can colorize it. Is this possible? It seems that with a swc I loose the ability to control the movieclips playback. It just plays and repeats no matter what I do.

View 4 Replies

ActionScript 2.0 :: Controlling Externally Loaded Swf?

Feb 23, 2012

the .FLA files are attached at the bottom. intro.swf is the actual movie and introLoader.swf is the preloader and it loads intro.swf into it.the problem with the actionscript previously was that itd start playing the external movie halfway through the preloader bar as if it was streaming..however i found a workaround that doesnt really work.. i used xyz.stop(); and xyz.play(); functions to control when the external movie plays.The problem with those functions is that i need a check for them i.e if(percentage <100) etc. which causes problems like if the flash movie is already watched once and cached and you reload the page it wont play.

View 9 Replies

ActionScript 2.0 :: Controlling Sound In Loaded SWF

Apr 26, 2004

I have a button on my main scene which creates the varaiable "soundoff", then if one of the placed swf's when loaded detect the variable it stops all sounds,

if(soundoff == true){
stopAllSounds();

This works fine but does not target sounds placed in movieclips in the loaded swf's timeline. I've tried targeting them with the _root. command and using linkage but I can only stop the sound in the main timeline level.

View 2 Replies

ActionScript 2.0 :: Controlling Loaded SWF From Another One On Different Level

Feb 7, 2005

Is it possible to control one loaded SWF File e.g.,(MOVIE-1.swf) from another loaded SWF file e.g., (MOVIE-0.swf) on a different level? E.g. with a syntax like:
onRelease
_MOVIE-1.SWF.gotoAndStop (4)
or:
onRelease
gotoAndStop (MOVIE-1.swf, frame4)

View 1 Replies

ActionScript 2.0 :: Controlling An Externally Loaded .swf's?

Oct 7, 2005

I am loading a .swf that a previous developer made (don't have the .fla) but the actionscript at the end of the movie is resolving to home.html. Instead of it resolving to home.html I would like for it to instead have gotoandPlay.

View 4 Replies

ActionScript 2.0 :: Loaded Swf Controlling Main Swf?

Oct 25, 2005

is it possible for a loaded swf to control the timeline of the main swf or even to tell the main swf to unload the loaded swf just by pressing a button in the loaded swf.

View 2 Replies

ActionScript 2.0 :: Controlling Externally Loaded Swf's?

Nov 1, 2005

i had made a image gallery using xml in flash MX 2004. some of the images are jpgs and some are swfs. i'm trying to get it so that once the external file, be it jpg or swf, is loaded, it would recenter itself in the middle of the page.so i attached the following code to the container clip that the files were loaded into:

onClipEvent(load){
this._x = ((304 - this._width)/2);
this._y = ((304 - this._height)/2);

[code].....

View 11 Replies

ActionScript 3.0 :: Controlling Loaded Swf In Website?

Feb 27, 2010

I'm creating a flash site, navigation is simple, or so I thought. Buttons along the top load external swf's to the stage. As they are loaded and unloaded the swf's animate in and out again on button clicks so the next one can come in.

I have suceeded in controlling the loaded swf's to get them to animate onto the stage, but what I have added to animate them off again does not work. I don't even get error messages, it is just ignored.

I have indicated below what I have added to try and 'animate out'

Actionscript:

stop();
//////// HOMEPAGE CONTENT LOADS ON PAGELOAD ///////////
addChild(loader);
var swfloader:URLRequest=new URLRequest('contentboxhome.swf');

[Code].....

This is a sample of two of the 5 buttons, I have tried using both the 'if' function on all buttons and the 'event complete' function on all of them, and both are just ignored. No error messages, no unusual occurrences at all. The code is just skipped over and the swf I have requested to load, just animates in and replaces the one there currently. Only funny thing is that, despite the 'loader.unload();' being WITHIN the 'complete' function, it still seems to be fired. The swf's never overlap each other.

View 1 Replies

ActionScript 3.0 :: Controlling Loaded Swf Files?

Apr 30, 2010

trying to create a universal fla file (shell.fla) in which I can load any swf file and control it from buttons in the shell itself. The buttons being play, pause, rewind, magnify etc.I�ve done all this in AS2 and now I have to do it in AS3. See my website [URL] E-Training - Motor to get a better idea of what I mean.The shell file has three buttons so far with instances called playMovie, stopMovie changeMovie and a dynamic text field - movieNumber. It is bound to the class Shell. The swf files to be loaded are numerical 1.swf, 2.swf, 3.swf etc. If I can get playMovie, stopMovie to work I can then do the rest.Here is my code so far for the class Shell.as:

package {
import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.events.Event;

[code]....

1. How can I kill, unload, removeChild the preceding swf file which has been loaded? When I load a swf file it creates a new loader.

2. On the onPlayClick and onStopClick buttons I get the following error message:

TypeError: Error #1009: Der Zugriff auf eine Eigenschaft oder eine Methode eines null-Objektverweises ist nicht m�glich.at Shell/onPlayClick()

View 2 Replies

ActionScript 2.0 :: Possible To Controlling Loaded Swfs?

Apr 21, 2004

What I'm trying to do is create buttons in one swf that load another swf and also give instructions to begin playing from a certain frame in that swf. The target swf has a preloader on frame 1 and then a movie clip that contains a video in frame 2. Depending on which button the user presses the video will be cued up ready to play at different frames. think it may need an if statement ie if x=34 then goto frame 34, but I can't seem to pass the variables to the loaded swf.In the zip file is an example of what I'm trying to do.

View 10 Replies

ActionScript 2.0 :: Controlling Loaded Swf-File?

Jan 23, 2005

I load a movieclip via:

on(release){
loadMovieNum("detection.swf", 1);
}

So I load it in my current timeline on level 1. Now in the detection.swf is a button that has to controll the first movie. (that loaded the swf)

[Code]...

View 1 Replies

ActionScript 3.0 :: Controlling Main Timeline From Loaded SWF

Nov 2, 2010

I have a simple swf called site.swf that loads a menu with UILoader called menu.swf, from menu I'm able to navigateToURL but I also need that it goes to frame 50 in menu.swf.

View 1 Replies

ActionScript 3.0 :: Controlling Sound Of Externally Loaded Swf?

Feb 5, 2011

how to assign a volume control component available in the video components library to an externally loaded swf once it's loaded into my main flash movie? I want to feature the volume control at the bottom of my main flash so that when you click a button to load the swf that volume control will be able to start controlling it's volume. Also, I want to be able to load several swfs and once each one is loaded--only one playing at any given time--into the main flash that same volume control can control them. Is this possible and, if so, how do I do it?I'm using CS5.

View 1 Replies

ActionScript 3.0 :: Controlling Loaded SWF Inside A Child?

Oct 19, 2008

I have loaded a SWF and attached to a MovieClip which exist in my current movie using the following code, and now I just want to access the loaded SWF to send it orders like play() or gotoAndPlay(); I have tried also: container= MocieClip(loader.content); instead adding child, but it trhows an error

View 10 Replies

ActionScript 3.0 :: Controlling The Sound Of The External Loaded SWF?

Aug 18, 2009

I  have a Loader that loads external SWF. The external SWF has sound. I'd like to stop, pause and play the sound.

[Code]...

This only mute the sound only and the sound is still runnung.

View 4 Replies

ActionScript 1/2 :: Controlling An Externally Loaded .swf File?

Jan 8, 2010

Another question regarding externally loaded .swf's!
 
In my externally loaded swf.s are a pause and play button which work perfectly using only:
 
on(release){yanm.play();}
 
(yanm being the name of my movie file containing my movie!!) and obviosuly the stop is with a stop!
 
Now I want to add a 'Mute' button so that the user can turn off the audio. What script would I use for this?
 
I also want to use a 'Rewind' or 'Restart' button to return to the beginning of my movie and begin playback again. What script would be used instead of .play?

View 3 Replies

ActionScript 3.0 :: Controlling Timeline With A Loaded Swf File?

Jul 21, 2010

I have a loaded swf file that is a short animated intro I am using he addChild method. I wold like it to simply move  the timeline to a label "menu" after it has played. This is the cde on my main Timeline:

stop();import flash.display.*;import flash.events.Event;import flash.media.SoundMixer;
var Xpos:Number=0;

[Code]....

View 7 Replies







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