Control Flash8 swf movie in Flex 2
I have a swf (output from OpenOffice, created from a
PowerPoint presentation) and i want to control it from Flex 2 (i
don't have the .fla file of the swf).
Is this possible at all? I can load the swf and display it,
but no way of accessing it as a MovieClip to use gotoFrame and so
on. Anyone?
Hi - I have a swf8 file that loads external swf- files - all
in FL8 - and my main interface is in flex -
In my fl8 swf i would hav a variable: var global_mc:MovieClip
- my swf file will se them as being in the _root or level0 when the
file first loads - but then they start to get messed up with flex -
i.e. - the file loaded will show up as
fl8: 5. created _root.testMC10
on a test - but when I call the global_mc variable again
later it gives me:
_level0.Presentations0.mainPanel.contentPane.HDividedBox6.VBox41.mainTabCanvas.contentPan e.mainTab.contentPane.VBox47.swfLoaderMain.FlexLoader171.instance186.testMC10
as its name - the problem is that I can still access
properties like _x and _width, _name - but i cannot run functions
on the MovieClip from within swf - i.e. global_mc.stop() and so
on... Any solution????
thx
Similar Messages
-
Control over .swf movie in browser
I have a question.
What should I change in the code of .swf movie clip to achieve the following:
- .swf picture appears through fade-in effect at the first load in web-browser,
on the page named e.g. /index.html (this is possible with the current code as below);
- the same .swf picture appears without fade-in effect as static picture (appears the last frame of this .swf movie) on the page named, to say /index.fr.html
I.e. it's required to skip to the last frame of the movie by clicking on /index.fr.html link.
The code is as following:
var picTotal:Number = 1;
var lightSpeed:Number = 5;
var delay:Number = 5000;
var count:Number = 0;
function init():Void {
var white:MovieClip = this.createEmptyMovieClip("wh", 10);
with (white) {
beginFill(0xFFFFFF);
lineTo(Stage.width, 0);
lineTo(Stage.width, Stage.height);
lineTo(0, Stage.height);
lineTo(0, 0);
endFill();
white.blendMode = "add";
showNext(white);
function showNext(clip:MovieClip):Void {
clip.onEnterFrame = function():Void {
this._alpha -= lightSpeed;
if(this._alpha<=0){
delete this.onEnterFrame;
init();Hi - I have a swf8 file that loads external swf- files - all
in FL8 - and my main interface is in flex -
In my fl8 swf i would hav a variable: var global_mc:MovieClip
- my swf file will se them as being in the _root or level0 when the
file first loads - but then they start to get messed up with flex -
i.e. - the file loaded will show up as
fl8: 5. created _root.testMC10
on a test - but when I call the global_mc variable again
later it gives me:
_level0.Presentations0.mainPanel.contentPane.HDividedBox6.VBox41.mainTabCanvas.contentPan e.mainTab.contentPane.VBox47.swfLoaderMain.FlexLoader171.instance186.testMC10
as its name - the problem is that I can still access
properties like _x and _width, _name - but i cannot run functions
on the MovieClip from within swf - i.e. global_mc.stop() and so
on... Any solution????
thx -
SWFloader loads SWF movie within Flex but not when compiled
When I run my app in Flex, SWFLoader loads the SWF okay as a movie clip but as soon as I Export/Release Build, the new app SWF that is generated won't show the movie clip anymore. If I take another SWF that is an app (not a movie clip) and give it the movie swf name, my compiled app will show the sub app in a frame. Why would running something within Flex be any different than running a compiled version?
Here is some of the code:
button1 loads the swf.
button2 loads a sound and when the sound is loaded, the sound is played and the swf is played in onSoundLoaded();
public function onSoundLoaded(event:Event):void{
var localSound:Sound = event.target as Sound;localSound.play();
var clip:MovieClip = MovieClip(swflodr.content);
clip.play();
private
function button1Handler(event:Event):void {Alert.show("test 1");swflodr.load(
"dog.swf");Alert.show(
"test 2");}
private
function button2Handler(event:Event):void
var s:Sound = new
Sound();s.addEventListener(Event.COMPLETE, onSoundLoaded);
var
req:URLRequest = new URLRequest("test.mp3");
s.load(req);
private function SwfLodrEventHandler(event:Event):void {
var clip:MovieClip = MovieClip(swflodr.content);clip.gotoAndStop(1);
Alert.show(
"The event loader is ready");}
thanks, MikeMaybe timing? The child SWF may not be fully loaded. Sounds and SWFs are asynchronously loaded.
Alex Harui
Flex SDK Developer
Adobe Systems Inc.
Blog: http://blogs.adobe.com/aharui -
I am still getting used to scripting from within Flex. I have
a very simple flash movie that indicates a value from 0 to 100% -
one frame for each percent. I want to embed that movie into a Flex
application and control the swf's position in the timeline from
within the Flex application.
I know that I cannot just use:
"SWF.gotoAndStop(currentFrame)" or
"MovieClip(SWF.content).gotoAndStop(currentFrame)" ...
but I would like to find a simple solution - if one exists. I
do not want to create 101 separate swf files and change the source
every time I need to change the frame.You can communicate with a loaded SWF through the
SWFLoader.content property. This gives you access to any public
members of the swf.
If you implement a public method, like setPos(iPercent:int),
you should be able to call that method thropugh the content
property.
Note that there are timing issues wotking with content in a
loaded SWF. SWFLoader has to be complete, and you need to listen
for the Application.complete event before interacting with the swf.
If you have difficulty with this, I have an example on
www.cflex.net. Search for swfloader.
Tracy -
Can I load a swf into my Flex app that loads other swf's?
The code below loads an AS2 swf into my Flex mobile for IOS app and it works. If that AS2 swf has like a circle in it that runs across the stage, it loads and displays properly when run in FlashBuilder.
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
initialize="init()">
<fx:Script>
<![CDATA[
import mx.core.UIComponent;
private var request:URLRequest = new URLRequest("http://PATH_TO_AS2_SWF");
private var loader:Loader = new Loader();
private var myComponent:UIComponent = new UIComponent;
private function init():void{
myComponent.percentHeight = 100;
myComponent.percentWidth = 100;
loader.load(request);
myComponent.addChild(loader);
player.addElement(myComponent);
]]>
</fx:Script>
<s:Group id="player"
height="100%" width="100%"/>
</s:Application>
But if that AS2 swf loads other swf's, they don't load or display. My FlashBuilder debugger reports no errors or security sand box violations. I'm using the most elemental code in my AS2 swf so as to not cause problems. This is it in its entirety:
this.onLoad = function(){
_root.loadMovie("http://[PATH_TO_REMOTE_SWF]");
The paths to the remote content are fine because swf's load and display fine from AS2 swf when run on it's own - not embedded in Flex app. They also load and run fine if I cut out the AS2 swf and access directly from my Flex code. So I know there isn't a path issue. More likely not accessing the right layer in the AS2 swf from Flex or something. Or maybe security sandbox violation but I don't see anything reported in the FlashBuilder debug console. When run console just reports:
[SWF] SwfMobile.swf - 2,639,761 bytes after decompression
[SWF] assets/swf/AS2.swf - 1,470 bytes after decompression
Is there something inherently wrong with loading swf's that load other things? Even if I have the AS2 swf load jpgs they don't load so the format of the target content at the end of the chain doesn't seem to be the issue. Just the act of embedding a swf that loads other things seems to be the problem.Ah, yes. Using an AVM1 SWF could prove difficult...
I'm going on about 3 hours of sleep at the moment, but let me toss out a few thoughts I have and hopefully something will stick...
Ok, so my first thought what to try and cast the loaded content as a MovieClip and call methods on that, but the fact they are AVM1 throws that out the window.
That leaves LocalConnection, as you mentioned. But this would require you to have code on the receiving end to handle the connection... no good either.
But what if you created a "bridge" in AS2 that holds all the code for the receiving end of LocalConnection (or has the control logic itself, perhaps even eliminating the need for LocalConnection all together!). I think maybe this is what you were trying to do already by loading a SWF into a SWF? Well instead of loading your bridge at runtime, what if you statically linked it into your project as a class?
*a few moments later*
Well it looks like you can in fact link in a a symbol created for AVM1, but it will only come in as a SpriteAsset, and will not include any custom code (which makes sense, since they use entirely different class constructs).
To do the test, I created a symbol exported for actionscript (AS2/Flash8), then linked it in with a CSS style embed. I then instantiated the class and called describeType on it.
So in summery, it looks like calling custom code on the bridge is out (I did not test this extensively, that was just my first impression with this simple test). However, if you may be able to perform the actions you need by attempting to cast the loaded content into something AVM2 can recognize. Apparently it does this automatically when linked in statically, so maybe there is something there worth looking into... mainly, can you do what you need using only the base class and no custom code?
Keep me posted! -
I would like to load 2 swf movies. Here is the code
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
backgroundColor="white"
layout="vertical">
<mx:Script>
<![CDATA[
import mx.core.FlexMovieClip;
import mx.controls.SWFLoader;
]]>
</mx:Script>
<mx:SWFLoader id="m2" source="Movies/CompInt1a.swf"
scaleContent="true" />
<mx:SWFLoader id="m1" source="Movies/Lmovie1a.swf"
scaleContent="true" />
</mx:Application>
IE7 crashes.Adobe Newsbot hopes that the following resources helps you.
NewsBot is experimental and any feedback (reply to this post) on
its utility will be appreciated:
Loading and duplicating a MovieClip (using Senocular Tip of
The:
Dec 3, 2007 ... This is a simple swf in Flex:. PHP Code:.
<?xml version='1.0' ... xmlns:mx='
http://www.adobe.com/2006/mxml'
layout='absolute'>
Link:
http://www.kirupa.com/forum/showthread.php?t=282429
Example on how to load Flash 9 assets into Flex 2 [Archive:
I have a Flex mxml application that uses a SWFloader to load
a Flash 9 (alpha) exported file ... xmlns:mx='
http://www.adobe.com/2006/mxml'
layout='absolute'
Link:
http://www.actionscript.org/forums/archive/index.php3/t-132887.html
Flex Sharp Mind:
<?xml version=1.0 encoding=utf-8?> <mx:Application
xmlns:mx=http://www.adobe.com/2006/mxml layout=absolute width=349
height=319
Link:
http://kanuwadhwa.wordpress.com/category/flex/page/2/
Talk:Flex Component Kit for Flash CS3 - Adobe Labs:
The Flex Component Kit for Flash CS3 turns a movieclip into a
Flex component .... I know swfloader and module loader will work
but these are cumbersome.
Link:
http://labs.adobe.com/wiki/index.php/Talk:Flex_Component_Kit_for_Flash_CS3
Galvan on Flash: Flash CS3 Archives:
<?xml version='1.0' encoding='utf-8'?>
<mx:Application xmlns:mx='
http://www.<br>
adobe.com/2006/mxml' creationComplete='xmlService.send()'
layout='absolute'
Link:
http://blogs.adobe.com/rgalvan/flash_cs3/
Disclaimer: This response is generated automatically by the
Adobe NewsBot based on Adobe
Community
Engine. -
I need help with controlling two .swf's from third.
Hi, thanks for reading!
I need help with controlling two .swf's from third.
I have a problem where I need to use a corporate designed
.swf in a digital signage solution, but have been told by the legal
department that it can not be modified in any way, I also can't
have the source file yada yada. I pulled the .swfs from their
website and I decompiled them to see what I was up against.
The main swf that I need to control is HCIC.swf and the
problem is it starts w/ a preloader, which after loading stops on a
frame that requires user input (button press) on a play button,
before the movie will proceed and play through.
What I have done so far is to create a container swf,
HCIC_container.swf that will act as Target for the HCIC.swf, and
allow me to send actionscript to the file I'm not allowed to
modify.
I managed to get that done with the help of someone on
another forum. It was my hope that the following script would just
start HCIC.swf at a frame past the preloader and play button, and
just play through.
var container:MovieClip = createEmptyMovieClip("container",
getNextHighestDepth());
var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.addListener(this);
mcLoader.loadClip("MCIC.swf", container);
function onLoadInit(mc:MovieClip) {
mc.gotoAndPlay(14);
But unfortunately it didn't solve my problem. Because there
is a media-controller.swf, that is being loaded by HCIC.swf that
has the controls including the play button to start HCIC.swf.
Here's a link to a .zip file with all 3 .swf files, and all 3
.fla files.
http://www.axiscc.com/temp/HCIC.zip
What I need to do is automatically start the HCIC.swf file
bypassing the pre-loader and play button without editing it or the
media-controller.swf in anyway. So all the scripting needs to be
done in HCIC_container.swf.
I know this is confusing, and its difficult to explain, but
if you look at the files it should make sense.
ActionScripting is far from my strong point, so I'm
definitely over my head here.
Thanks for your help.Got my solution on another forum.
http://www.actionscript.org/forums/showthread.php3?t=146827 -
Issues adding swfs created in Flex to a Captivate project
The company I work with, ePath Learning Inc. has an online authoring tool called eActivity that we use to publish different eLearning templates. This online tool is built completely in Flex and uses the Flex compiler to ouput a swf file that can be used in many different products and online courses. Because it's an AS3/Flex created swf, we've had to wait for Captivate 4 to be released to support the generated swf file, so now we are testing it's compatibility and have run into some issues. It appears that swf files from our online authoring tool do not work correctly in Captivate. Further testing resulted in any swf published using Flex do not work properly in Captivate. Attempts at adding a swf file complied with Flex result in a variety of different errors as well as a performance issue causing the control bar as well as all other aspects of the Captivate project to work incorrectly.
I've attached 2 sample swf files, 1 built using our online authoring tool and 1 using Flex Builder 3. When added to a new blank project in Captivate 4 using AS3 settings we have the errors as explained above.Hi there
I just uploaded a small video to Jing. See if it helps you resolve the issue.
Click here to view
Cheers... Rick
Helpful and Handy Links
Captivate Wish Form/Bug Reporting Form
Adobe Certified Captivate Training
SorcerStone Blog
Captivate eBooks -
Using a swf generated by Flex from a Flash component
I know you can include and control a swf generated by Flash
within a Flex component. But can you do the inverse? Can you use a
swf generated by Flex within a Flash project/component?
We plan to develop a "core" module that would be used in a
lot of other Flash and Flex components we'll develop in the future.
This core would be a package of classes that could be easily
re-used by the components. There would be nothing visual in it,
only standard classes.
Even if this core would not contain any visual components, we
would like to develop it using Flex since we prefere Flex Builder
to the Flash editor to code and debug.
But I'm not sure if:
1) A core module like this, developped in Flex, could be used
by our Flash components or only by other Flex components?
2) If we use Flex to generated this core, will the resulting
.swf be bigger than if we would have used Flash to develop it?
Since there will be no Flex visual components in it, maybe it will
be as small? Is there a compiler parameter to tell Flex to only
include the minimum things possible in the generated .swf?
Any help or link about this would be really appreciated!
Thanks you in advance!
P.S. I apologize to those aware that this message was also
posted on another Flex related forum, but I received no reply on
it!try this. for me it has worked.
import flash.net.URLRequest;
import flash.utils.Timer;
var loader:Loader = new Loader();
var timer:Timer;
var myclip:MovieClip;
//load the Flex Component
loader.load(new URLRequest("IS.swf"));
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,
loaderDone);
addChild(loader);
function loaderDone(e:Event) {
timer = new Timer(100);
timer.addEventListener(TimerEvent.TIMER, handleTimer)
timer.start();
function handleTimer(event:TimerEvent):void {
//cast the loader.content into MovieClip to access
currentFrame.
myclip = loader.content as MovieClip;
if (myclip.currentFrame == 2)
however, i need to access properties of IS.mxml..
any data member would work..
or if i could dispatch an event in IS.mxml and catch it in
flash through IS.swf, it would work.
Pls somebody suggest. -
Swf movie starts before preloader is finished
Hi,
I tried to implement a simple preloader for an existing swf movie. I've created a new flash document and added the Loader as well as a ProgressBar component. In the action script of the key frame 1, I implemented the following:
import mx.controls.ProgressBar;
loader.contentPath = "myMovie.swf";
pBar.setStyle("themeColor", "0xF49417");
pBar.setStyle("color","0x3D566F");
pBar.labelPlacement = "bottom";
pBar.label = "LOADING %3%%"
pBar.scaleY = 150;
pBar.conversion = 1024;
pBar.source = loader;
pBar.mode = "polled";
loader.load();
The problem is now that the movie starts playing (i.e. its sound) before the progress bar is completely finished. This usually happens around 80%. How can I avoid that the movie starts before the progress bar reaches 100%?
Thanks,
PatrikThanks for your replay! I added an empty keyframe to the first scene of the existing flash movie with a stop() action in it. Additionally, I modified the preloader with an action listener that is called in case the movie is loaded completely. The action script of the preloader does now look like follows (without sytle settings):
import mx.controls.ProgressBar;
loader.contentPath = "myMovie.swf";
var pbListener:Object = new Object();
pbListener.complete = function(evt_obj:Object) {
trace("movie loaded");
play();
pBar.addEventListener("complete", pbListener);
pBar.source = loader;
pBar.mode = "polled";
loader.load();
It seems now that this play() does not reference to the swf movie (myMovie.swf) with the stop in the first frame since the movie does not start playing after its loaded. How do I reference the play action to the loaded movie?
Thanks,
Patrik -
Eltima SWF Movie Player for Mac 2.0
Hope this is the correct area for this - I'm trying to locate an older version of the above flash player - every site I try that has the version 2.0 always downloads the version 3.0 - which does not play on OS 10.2.8 but only OS 10.3
The older version - Eltima SWF Movie Player for Mac 2.0 - will play on 10.2.8 - so Iam trying to source this copy of SWF/FLV
can anybody help???
GreggHi Roam - thanks for replying.
I did find a substitute FLV player, for 10.2, at the URl below, but I was hoping the Eltima v2 might work even better than the J-VHS.
I'm sure someone will have a copy somewhere - there used to be mirror sites carrying all the old mac software that had lost popularity - but I can't locate it yet either.
ciao
Gregg
- http://streampower.free.fr/ -
Description:
J-VHS FLV Player : A FLV PLAYER FOR MAC & PC
Royalty free flv player for mac & pc. FLV Player allows users to playback .flv files. Standard playback controls included. The program can be optionally ...
streampower.free.fr/ - 4k - Cached - Similar pages -
Control a swf via RF remote control, ala Powerpoint?
Hi
I am in the middle of a Flash project creating a powerpoint
like
presentation to be shown on a projector screen. Flash 9 or a
projector.exe
I wonder have you ever had to ask Flash/Flex to control the
remote clicker(pointer) buttons using a Front Projection screen ???
I looked on Adobe, Forums and found only this entry,
Topic Title::: How can I control a swf file via RF remote
control, ala Powerpoint?
- but don't seem to be able to get to work.
Is there a new method used in AS3? I really need to get my
hands on a very simple .flv example.
I need to click to the nest stop(); and click back if needed.
onKeypress pagedown
onKeypress pageup
ThankyouI figured it out. Just make a full-screen invisible button
and place it on a layer on each frame.
For insatnce, Actions - Button for frame 2:
on (keyPress "<PageDown>") {
gotoAndStop (3);
on (keyPress "<PageUp>") {
gotoAndStop (2);
sends the show forward to frame (slide) 3 with a press of the
remote's "Next" button and sends it back to frame (slide) 1 with a
press of the "Back" button.
I have a Stop action on each frame.
This allows me to control a Flash show just like a Powerpoint
show. Cool. -
Play Pause as2 swf Movie from As3swf Movie
Ihave create one as3 flash file.That file loads as2 swf movies. Ineed Control like (play,pause,gotoAndstop)from as3 flashMovie. Is it posssible?
Virtual Machines (VM)s run SWFs files. AS3 and AS2 have completely separate VMs. Thus they cannot directly talk to each other because they're running as if they're 2 completely separate applications.
As mentioned you can use the localconnection class to communicate to any process listening. You'll need to have your AS2 documents listening for commands from your AS3 document to do what you want to do. -
Stop another SWF movie (+ sounds) from another SWF
Hiya there
Thank you in advance for skim reading this and thinking if
you can help!
I've search and seen similar problems, but not the same.
THE PROBLEM / CHALLENGE!
I need a selection of simple SWF movie files with audio
attached. They're basically audio buttons, scattered through a HTML
page. At the moment they're set up with sound to 'stream' attached
to a specific frame - then enough frames to cover the duration of
the sound.
- on press of button it skips to Frame2 where the button
status changes and the sound plays
- if during that playing process, the button is clicked
again, then it jumps back to Frame1 and rests
I've played with the StopAllSounds command, but that just
stops the sounds on the other SWFs and doesn't stop (and revert)
the other SWFs back to their Frame1's.
Is this something i can solve with simple Action Script /
Behaviours... or do i need to fiddle with the Javascript in the web
page?
Thank you in advance for any help
cheers
James"MrIzzard" <[email protected]> wrote in
message news:e3l5nr$bdo$[email protected]..
> But surely if the way i'm currently playing audio is
from being attached into
> the frames in the timeline (at the moment if i press a
button to switch the
> movie back to Frame 1, where there's no audio attached,
the sound stops) - then
> this would work for other frames too.
> Does that make sense?
If your swfs are on separate places on an html page (not one
swf loaded by another swf) then you can use localConnection to
communicate between swfs.
There are some MX version 6 examples on my website where one
swf controls one or more others..
http://members.cox.net/4my2dogs/flash/
You can have the receiving end stop sounds or move to a
different frame etc.
tralfaz -
RH 7 - How can I get .swf movies to work inside CHM output on Windows 7
Hi RHelpers,
I'm using RoboHelp Html (RH 7, latest patch) on my Win 7 64-bit machine to provide a HtmlHelp (CHM) output.
Now that we're close to releasing, I've been doing some testing, and I've noticed that my SWF movie files do not play inside of Windows 7 when viewing them inside of the CHM file. It keeps asking to install the Adobe Flash Player. But I've already clicked Yes several times to that message, and it still doesn't play the file. I've even manually downloaded and installed it as an administrator, restarted my system and still no go. It just shows a red X in the container where the movie should be playing.
However, viewing the same topic inside of RH's preview window (or inside a browser) seems to work fine. Also, I've copied and pasted the problem CHM onto a virtual machine running 32-bit Vista, and the movies display fine there. This tells me it's something to do with how how compiled files are handled in 64-bit environments.
Has anyone else experienced this? Any solutions out there?I see the answer here:
http://forums.adobe.com/thread/781427?tstart=2
Also I verified that our software does use the 32-bit hh.exe so I'm only seeing this when running the help by itself, outside of our software. That's good news.
Maybe you are looking for
-
System crashes when trying to access movies and tv shows on iTunes store
I've just re-installed iTunes on a Gateway 500SE PC running on Windows XP SP 2 (recently had a new hard drive put in after original crashed). Whenever I try to open up any sections in the iTunes store (movies, TV shows, etc.) other than music section
-
Rip out, Turn Off, Disable, Terminate ALL PDF IN SAFARI BROWSER please!
Once again (third time) I am trying to disable the display of PDFs inside the Safari browser window. Every time I do this, they update the system and come up with a new way to Turn it back on, grrrr. I ONLY want PDFs to be downloaded and displayed in
-
UnknownHost exception in the server console
hi, thanks in advance. am in working with wls6.1 when am trying to execute HelloWorldServlet with examples server am getting exception on the console it's displaying java.net.UnknownHostException www.
-
Hi All, Is there any way to output P.O as a mail to different vendor mail IDs?
-
AirTunes Speaker Names Not Updating
Recently I moved each of my two Airport Express units to different rooms in my house. As a result, I decided to rename each unit to match the room it is now located in. When I open Airport Utility each unit is listed with its new name. However, when