Window component / external swf - plz help :( !!
Hi,
any clues here would be appreciated, its kept me up lately.
My flash app consists of a main swf, a button on the stage
which when clicked creates a Popup and loads an external swf like
so
myWindow = mx.managers.PopUpManager.createPopup(_root,
mx.containers.Window, true, (title:"My Title",
contentPath:"Status.swf"});
so far so good...
After I create the window and load the external swf I use
LocalConnection to pass values between the swfs eg.
sendingLC = new LocalConnection();
sendingLC.send("lc_name", "myMethod", txtUniqueID);
now i can pass values between swfs fine if I run the swfs in
separate players (or debugging both swfs in flash mx), but I cannot
pass in a value to a swf that is loaded in a window component into
the main swf
Would be really grateful if someone could post a sample fla
of the Window component loading external swfs and passing values
between the swfs or some ideas about how to achieve the same thing.
Thanks
Mike
Skip the hub and use one of the rear ports on the computer.
Similar Messages
-
I am using this thumbnail gallery attached but instead of loading images through the xml I want to load external SWF'S. I also want to be able to control each SWF loaded in individually apparently in order to do that I need to give the container different instance names..however I don't know how to extend the code inorder to achieve this..can anyone help?
Hello Kglad,
Thank you for the swift reply, I don't know how to apply this to my code. At the moment it loads in images but it will load in external SWF's I pressume this is the section of code relevant;
function thumbnailer(k){
total_thumbs = _global.total;
var container = thumbnail_mc.createEmptyMovieClip("th"+k,thumbnail_mc.getNextHighestDepth());
container._visible=false;
container._alpha=0;
var image = container.createEmptyMovieClip("img", container.getNextHighestDepth());
tlistener = new Object();
tlistener.onLoadInit = function(target_mc) {
target_mc.pictureValue = k;
target_mc.onRollOver = function() {
this._alpha = 50;
target_mc.onRollOut = function() {
this._alpha = 100;
image_mcl = new MovieClipLoader();
image_mcl.addListener(tlistener);
image_mcl.loadClip(thumbnails[k], "thumbnail_mc.th"+k+".img"); -
Got Noise in the Speaker after plugging external display. plz help.
Hi guys, i just bought the apple Mini DisplayPort to VGA Adapter, but as soon as i plug it in, i got annoying noise comes out from my speaker.
im using M box Mini as my audio interface.
at first i thought it might be the wiring noise, so i moved the M box away from the external display, and moved the usb cable to varies position, but didnt work..
guys plz help. the noise is just there constantly never give me a break!! really driving me crazy!! cant work with that noise,. plz help guyssorry
i was getting confused with this rig i got here fsb should have been 166 for athlon 2600. as for the not display no boot i just had to wait a little longer as the capitors kept on for ages eventually reseting the bios settings allowing boot.
just tested the radeon seems to be running ok now - no crashes so far maybe 1.9 fixed it
cheers -
Problem with external .swf, please help
Hello.
I'm new here so cheers to all. Sorry if I chose wrong forum for posting this question.
I'm newbie in Flash and started building flash website with some tutorial. Now, I built navigation and content with this lines of code:
var myMenyArray = [najave, onama, asesoar, kontakt, ponuda, klub, arhiva];
for each (var btn in myMenyArray){
btn.addEventListener(MouseEvent.CLICK, onBtnClick);
function onBtnClick(event:MouseEvent):void{
pages.gotoAndStop(event.target.name);
and then added this one for loading .swf
var Xpos:Number = 150;
var Ypos:Number = 180;
var swf:MovieClip;
var loader:Loader = new Loader();
addChild(loader);
function btnClick(event:MouseEvent):void {
removeChild(loader);
var newSWFRequest:URLRequest = new URLRequest("swfs/" + event.target.name + ".swf");
loader.load(newSWFRequest);
loader.x = Xpos;
loader.y = Ypos;
addChild(loader);
galerija.addEventListener(MouseEvent.CLICK, btnClick);
Now, my gallery loads when I press "Galerija" in navigation like I wanted, but when I want to show Home or some other content from the nav bar, gallery.swf still appears in front of content.
Can anyone help me with this? It's probably eas, I don't know, but I spent a whole night trying to fix that and I'm here now like last chance.
Hope that I've explained right my problem.
Thanks anyone who can answer me.
Cheersuse:
var myMenyArray = [najave, onama, asesoar, kontakt, ponuda, klub, arhiva];
var loader:Loader;
for each (var btn in myMenyArray){
btn.addEventListener(MouseEvent.CLICK, onBtnClick);
function onBtnClick(event:MouseEvent):void{
if(loader){
removeChild(loader);
loader=null;
pages.gotoAndStop(event.target.name);
var Xpos:Number = 150;
var Ypos:Number = 180;
var swf:MovieClip;
function btnClick(event:MouseEvent):void {
if(loader){
removeChild(loader);
loader=null;
loader = new Loader();
addChild(loader);
var newSWFRequest:URLRequest = new URLRequest(event.target.name + ".swf");
loader.load(newSWFRequest);
loader.x = Xpos;
loader.y = Ypos;
galerija.addEventListener(MouseEvent.CLICK, btnClick);
And for every frame stop(); where content should load.
My gallery .swf is in the same folder with this .swf. -
No sound in windows 7... plz help
I'm looking for 15 days and did not find the solution
i am installed windows 7 in boot camp 4 on a macbook air (2011) os 10.7.4 . Anyway everything works fine with me, except the sound, I have reinstalled the Realtek several times and no success. I would like to know an way to solve this problem, thanks!IDoes not work - does not compute - does not suggest why.
What happens?
R2.68 is current for Windows 7 64-bit
Realtek High Definition Audio Driver R2.68-Win 7/Vista 32/64
http://www.download3k.com/files/WDM_A406.exe
tehre are zip and there are .exe
just go to Realtek.com
Notebooks like the Air may be different.
Audio in Device Manager shows "realtek" I assume.
http://www.realtek.com.tw/Downloads/downloadsView.aspx?Langid=1&PNid=14&PFid=24& Level=4&Conn=3&DownTypeID=3&GetDown=false
You can find most things needed on this page:
http://forums.tweaktown.com/gigabyte/30530-latest-overclocking-programs-system-i nfo-benchmarking-stability-tools.html
http://www.bing.com/search?q=Windows+audio+realtek+MacBook+Air -
Username And External Files plz help!
Hey there,
Hope someone can help me out with this even pointing into the right direction will be very helpful.
I kind of understand how to create a basic username and password 'menu' in flash.
password = inputName
if (password == "kirupa") {
answer = "Access granted!" ;
} else {
answer = "Access denied!" ;
But I would like to create a menu where a user can create a new username with then will be added to an exteral file ( data base I guess).
From there on anything the user does is remembered on that name. And if that user exits the program and loads it again the user's stats are loaded.
If you have any info on this please let me know, where lost here.
thx
pavelu can not write anything from flash in text file . What u can write through flash is shared object. u can store ur user name and password in shared oject and then get and set those value same u can achive through javascirpt cookies also
But both option would be system specific
otherwise
database is the option as suggested before -
FAQ: How do I load an external SWF file into a parent SWF file?
A ton of Flash users visit Adobe’s we site every month wondering about how to load an external SWF file from within another SWF.
Adobe's own TechNote on the subject attempts to answer the basic question, along with some common follow-up questions, including:
How do I load more than one SWF?
How do I load a SWF into a specific location in the display list?
How do I resize the loaded SWF?
How do I set its X and Y location?
Here are some additional resources that elaborate on loading content and on working with the display list:
Sample files for the above TechNote. A set of 3 FLA and 3 corresponding SWF files, including a parent SWF and 2 SWFs that the parent loads.
Help > AS3 Developer’s Guide > Loading an external SWF file
Help > AS3 Developer’s Guide > Loading display content dynamically
Loading multiple external SWFs within a main SWF – CreativeCow.net forums
Video tutorial: ActionScript 101 – Episode 6: Adding named objects to the Stage. By Doug Winnie. An example of how to add the loaded external asset to the Stage and modify its location or other properties.
Video tutorial: Preloading in ActionScript 3.0. By Lee Brimelow. A slightly more complicated example, showing how to make the parent SWF display information about the progress of loading the external SWF.
Tutorial: Loading and unloading SWFs - FlashAndMath.com
This article provides several examples of how to communicate between a parent SWF file and the loaded SWF:
SWF to SWF Communcation via ActionScript 3.0 (by kglad)quote:
Originally posted by:
NedWebs
You now seem to want to get rid of the swf once it has loaded
and played itself thru. To do that you would need to have something
in the swf itself that triggers its removal in its last frame. The
following might work...
MovieClip(this.parent).removeChild(this);
Unfortunately I couldn't get this to work. I placed it on the
last frame of the SWF to be called - is that right?
I am not sure I am doing it correctly... -
Hi all,
I am currently working on a FAQ application, the app is
working better than I expected and I have learnt a hell of a lot
just with this simple project. To make my application look more
pleasing I used the window component, which I need to keep as the
tile of the window is taken from a global variable depending on
what the user selects from two diferent combo boxes.
I have just found out that the window component can be moved
by the user which is not what I wanted to use it for, it was purely
for the design and layout. Is there any way to stop the windows
component dragable? Your help with this would be
appreciated.I need to use the window component in flash...
"Nickels55" <[email protected]> ha scritto
nel messaggio
news:eh3do3$9o9$[email protected]..
>
http://www.flash-db.com/PopUp/
>
> You need to add windowname.focus(); to your pop-up code -
Loading external swf help plz!
hi, Im trying to load an external swf even a object is clicked in the main swf, im using this code but i get an error, plz help if u can:
bg.farm.addEventListener(MouseEvent.MOUSE_DOWN, farm_Press);
var fl_Loader:Loader;
function farm_Press(evt:MouseEvent):void
bg.farm.removeEventListener(MouseEvent.MOUSE_OVER, farm_Over);
bg.farm.removeEventListener(MouseEvent.MOUSE_OUT, farm_OUT);
bg.farm.removeEventListener(MouseEvent.MOUSE_DOWN, farm_Press);
removeChild(bg);
fl_Loader = new Loader();
fl_Loader.load(new URLRequest("farmSWF.swf"));
bg.addChild(fl_Loader);
fl_Loader.width = Capabilities.screenResolutionX;
fl_Loader.height = Capabilities.screenResolutionY;
error---
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Project2_fla::MainTimeline/frame1()
thx pavelhey guys, thx for the replies both helped a lot!
I found this way and it seems like its working but now i dont get how to get the external to close and main to kick in afte external is finished...the problem is that the external file is kinda a game so there is no clear cut ending you no? is there any way that i can get the main file to listen for a currentLabel and then if thats hit exit the external?
code used to load:
---First key frame has ---
var ferrisID:Loader = new Loader()
bg.ferris.addEventListener(MouseEvent.MOUSE_DOWN, ferris_Press);
function ferris_Press(event:MouseEvent):void
gotoAndStop("ferris_Load")
---ferris_Load---
ferrisID.load(new URLRequest("Project 3.swf"));
addChild(ferrisID);
thx pavel -
Adding "window to a container:illegal argument exception".error plz help
Thanks to Mr.Andrew and sun for developing the following code for a
mediaplayer which is implemented in jmf.This is working in core java. But
when i have converted it to Applet it compiles but an error adding "window
to a container:illegal argument exception".code is given below plz point
me where is the error;
import javax.media.*;
import java.text.DecimalFormat;
import java.awt.*;
import java.awt.FileDialog;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.*;
import java.io.*;
import java.net.*;
import java.util.*;
class nwa extends WindowAdapter{
frameclass frame;
public nwa(frameclass frame){
this.frame=frame;
public void windowClosing (WindowEvent e)
//User selected close from System menu.
//Call dispose to invoke windowClosed.
frame.dispose ();
public void windowClosed (WindowEvent e)
//if (player != null)
//player.close ();
System.exit (0);
class frameclass extends JFrame
frameclass(){
nwa n=new nwa(this);
this.addWindowListener(n);
public class PlayerApplet extends JApplet
implements
ActionListener,ControllerListener,ItemListener, KeyListener
frameclass frame=new frameclass();
Player player;
Component vc, cc;
JProgressBar volumeBar;
JButton fastRewind;
JButton fastForward;
JButton play;
int sizeIncrease = 2;
boolean invokedStop = false;
/** Big */
int progressFontSize=30;
boolean first = true, loop = false;
String currentDirectory;
public void init(){
JMenu m = new JMenu ("File");
JMenuItem mi = new JMenuItem ("Open...");
mi.addActionListener (this);
m.add (mi);
m.addSeparator ();
JCheckBoxMenuItem cbmi = new JCheckBoxMenuItem ("Loop", false);
cbmi.addItemListener (this);
m.add (cbmi);
m.addSeparator ();
mi = new JMenuItem ("Exit");
mi.addActionListener (this);
m.add (mi);
JMenuBar mb = new JMenuBar ();
mb.add (m);
frame.setJMenuBar (mb);
setSize (200, 200);
final JPanel p = new JPanel(new GridLayout(1,0,5,5));
p.setBorder(new EmptyBorder(3,5,5,5) );
fastRewind = new JButton("<html><body><font size=+"+
sizeIncrease+ "><<");
fastRewind.setToolTipText("Fast Rewind");
fastRewind.addActionListener( new ActionListener(){
public void actionPerformed(ActionEvent ae) {
if (player!=null) {
invokedStop = false;
skipBack();
} else {
JOptionPane.showMessageDialog(play,
new JLabel("Open a sound file
first!"));
fastRewind.addKeyListener(this);
p.add(fastRewind);
JButton stop = new JButton("<html><body><font size=+"+
sizeIncrease+ ">■");
stop.setToolTipText("Stop");
stop.addActionListener( new ActionListener(){
public void actionPerformed(ActionEvent ae) {
invokedStop = true;
//player.stop();
sp();
stop.addKeyListener(this);
p.add(stop);
play = new JButton("<html><body><font size=+"+
sizeIncrease+ ">>");
play.setToolTipText("Play");
play.addActionListener( new ActionListener(){
public void actionPerformed(ActionEvent ae) {
if (player!=null) {
invokedStop = false;
player.setRate(1);
st();
} else {
JOptionPane.showMessageDialog(play,
new JLabel("Open a sound file
first!"));
play.addKeyListener(this);
p.add(play);
fastForward = new JButton("<html><body><font size=+"+
sizeIncrease+ ">>>");
fastForward.setToolTipText("Fast Forward");
fastForward.addActionListener( new ActionListener(){
public void actionPerformed(ActionEvent ae) {
if (player!=null) {
invokedStop = false;
skipForward();
} else {
JOptionPane.showMessageDialog(play,
new JLabel("Open a sound file
first!"));
fastForward.addKeyListener(this);
p.add(fastForward);
p.addKeyListener(this);
frame.add(p,BorderLayout.CENTER);
add(frame);
// pack ();
setVisible (true);
public void start(){
st();
public void stop(){
sp();
public void destroy(){
player.stop();
player.deallocate();
public void actionPerformed (ActionEvent e)
if (e.getActionCommand().equals("Exit"))
// Call dispose to invoke windowClosed.
frame.dispose ();
return;
FileDialog fd = new FileDialog (frame, "Open File",
FileDialog.LOAD);
fd.setDirectory (currentDirectory);
fd.show ();
// If user cancelled, exit.
if (fd.getFile() == null)
return;
currentDirectory = fd.getDirectory ();
if (player != null)
player.close ();
try
player = Manager.createPlayer (new MediaLocator
("file:" +
fd.getDirectory() +
fd.getFile()));
catch (java.io.IOException e2)
System.out.println (e2);
return;
catch (NoPlayerException e2)
System.out.println ("Could not find a player.");
return;
if (player == null)
System.out.println ("Trouble creating a player.");
return;
first = false;
frame.setTitle (fd.getFile ().toString());
player.addControllerListener (this);
player.prefetch ();
public void controllerUpdate (ControllerEvent e)
if (e instanceof ControllerClosedEvent)
if (vc != null)
remove (vc);
vc = null;
if (cc != null)
remove (cc);
cc = null;
return;
if (e instanceof EndOfMediaEvent)
if (loop)
player.setMediaTime (new Time (0));
player.start ();
return;
if (e instanceof PrefetchCompleteEvent)
player.start ();
return;
if (e instanceof RealizeCompleteEvent)
vc = player.getVisualComponent ();
if (vc != null)
add (vc);
cc = player.getControlPanelComponent ();
if (cc != null){
this.add (cc, BorderLayout.SOUTH);
this.show();
public void keyReleased(KeyEvent ke) {
int keycode = ke.getKeyCode();
if (keycode==KeyEvent.VK_LEFT) {
skipBack();
} else if (keycode==KeyEvent.VK_RIGHT) {
skipForward();
public void keyTyped(KeyEvent ke) {
int keycode = ke.getKeyCode();
if (keycode==KeyEvent.VK_LEFT) {
skipBack();
} else if (keycode==KeyEvent.VK_RIGHT) {
skipForward();
public void keyPressed(KeyEvent ke) {
int keycode = ke.getKeyCode();
if (keycode==KeyEvent.VK_LEFT) {
skipBack();
} else if (keycode==KeyEvent.VK_RIGHT) {
skipForward();
}else if (keycode==KeyEvent.VK_UP) {
st();
}else if (keycode==KeyEvent.VK_DOWN) {
sp();
public void skipForward() {
double secs=5;
double playersecs = player.getMediaTime().getSeconds();
Time settime = new javax.media.Time(playersecs + secs);
player.setMediaTime(settime);
public void skipBack() {
double secs1=5;
double playersecs1 = player.getMediaTime().getSeconds();
Time settime1 = new javax.media.Time(playersecs1 - secs1);
player.setMediaTime(settime1);
public void st() {
player.start();
public void sp() {
player.stop();
public void itemStateChanged (ItemEvent e)
loop = !loop;
When i comment add(frame) this error goes but i got a null poiter
exception
Plz help
manuHi Andrew,
Thanks for ur reply.Sorrry that my code not included in the code block.
My problem have been solved partly.Now playerapplet is working properly.It can play files from local machine(through open menuitem from file menu) as well as local network (through url menuitem from file menu).
There is no requirement to play file from internet at present.
I have given arrow keys to forward/backward/open/close.
I have now completed my first part of project.Now i have to start the second part ie Controlling arrow keys using a joystick like instrument.The instrument and driver will be provided by my co. and the user is using only this device.Plz help me how to do that.
The code is given below
import javax.media.*;
import java.text.DecimalFormat;
import java.awt.*;
import java.awt.FileDialog;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.*;
import java.io.*;
import java.net.*;
import java.util.*;
<APPLET CODE=PlayerApplet.class
WIDTH=320 HEIGHT=300>
</APPLET>
class nwa extends WindowAdapter
frameclass frame;
Player player;
public nwa(frameclass frame,Player player)
this.player=player;
this.frame=frame;
public void windowClosing (WindowEvent e)
//User selected close from System menu.
//Call dispose to invoke windowClosed.
frame.dispose ();
public void windowClosed (WindowEvent e)
if (player != null)
player.stop();
player.close ();
player.deallocate();
System.exit (0);
class frameclass extends JFrame
Player player;
frameclass(Player player)
nwa n=new nwa(this,player);
this.addWindowListener(n);
public class PlayerApplet extends JApplet
implements ActionListener,ControllerListener,ItemListener, KeyListener
Player player=null;
frameclass frame=new frameclass(player);
Component vc, cc;
Container f;
JProgressBar volumeBar;
JButton fastRewind;
JButton fastForward;
JButton play;
int sizeIncrease = 2;
boolean invokedStop = false;
/** Big */
int progressFontSize=30;
boolean first = true, loop = false;
String currentDirectory;
public void init()
f=frame.getContentPane();
JMenu m = new JMenu ("File");
JMenuItem mi = new JMenuItem ("Open...");
mi.addActionListener (this);
m.add (mi);
m.addSeparator ();
mi = new JMenuItem ("URL");
mi.addActionListener (this);
m.add (mi);
m.addSeparator ();
JCheckBoxMenuItem cbmi = new JCheckBoxMenuItem ("Loop", false);
cbmi.addItemListener (this);
m.add (cbmi);
m.addSeparator ();
mi = new JMenuItem ("Exit");
mi.addActionListener (this);
m.add (mi);
JMenuBar mb = new JMenuBar ();
mb.add (m);
frame.setJMenuBar (mb);
setSize (500, 500);
JPanel p = new JPanel(new GridLayout(1,0,5,5));
p.setBorder(new EmptyBorder(3,5,5,5) );
fastRewind = new JButton("<html><body><font size=+"+ sizeIncrease+ "><<");
fastRewind.setToolTipText("Fast Rewind");
fastRewind.addActionListener( new ActionListener(){
public void actionPerformed(ActionEvent ae) {
if (player!=null) {
invokedStop = false;
skipBack();
} else {
JOptionPane.showMessageDialog(play,
new JLabel("Open a sound file first!"));
fastRewind.addKeyListener(this);
p.add(fastRewind);
JButton stop = new JButton("<html><body><font size=+"+ sizeIncrease+ ">■");
stop.setToolTipText("Stop");
stop.addActionListener( new ActionListener(){
public void actionPerformed(ActionEvent ae) {
invokedStop = true;
sp();
stop.addKeyListener(this);
p.add(stop);
play = new JButton("<html><body><font size=+"+ sizeIncrease+ ">>");
play.setToolTipText("Play");
play.addActionListener( new ActionListener()
public void actionPerformed(ActionEvent ae) {
if (player!=null) {
invokedStop = false;
player.setRate(1);
st();
} else {
JOptionPane.showMessageDialog(play,
new JLabel("Open a sound file first!"));
play.addKeyListener(this);
p.add(play);
fastForward = new JButton("<html><body><font size=+"+ sizeIncrease+ ">>>");
fastForward.setToolTipText("Fast Forward");
fastForward.addActionListener( new ActionListener(){
public void actionPerformed(ActionEvent ae) {
if (player!=null) {
invokedStop = false;
skipForward();
} else {
JOptionPane.showMessageDialog(play,
new JLabel("Open a sound file first!"));
fastForward.addKeyListener(this);
p.add(fastForward);
frame.getContentPane().add(p,BorderLayout.CENTER);
frame.setVisible (true);
frame.pack();
frame.setResizable(false);
public void stop(){
sp();
public void destroy(){
player.stop();
player.deallocate();
public void actionPerformed (ActionEvent e)
if (e.getActionCommand().equals("Exit"))
// Call dispose to invoke windowClosed.
player.stop();
player.close();
player.deallocate();
frame.dispose ();
return;
if (e.getActionCommand().equals("Open..."))
FileDialog fd = new FileDialog (frame, "Open File",
FileDialog.LOAD);
fd.setDirectory (currentDirectory);
fd.show ();
// If user cancelled, exit.
if (fd.getFile() == null)
return;
currentDirectory = fd.getDirectory ();
if (player != null){
player.close ();
player.deallocate();
try
player = Manager.createPlayer (new MediaLocator
("file:" +
fd.getDirectory() +
fd.getFile()));
catch (java.io.IOException e2)
System.out.println ("file not found :"+e2);
return;
catch (NoPlayerException e2)
System.out.println ("Could not find a player.");
return;
if (player == null)
System.out.println ("Trouble creating a player.");
return;
first = false;
frame.setTitle (fd.getFile ().toString());
player.addControllerListener (this);
player.prefetch ();
return;
if (e.getActionCommand().equals("URL"))
FileDialog fd = new FileDialog (frame, "Open File",
FileDialog.LOAD);
fd.setDirectory (currentDirectory);
fd.show ();
// If user cancelled, exit.
if (fd.getFile() == null)
return;
currentDirectory = fd.getDirectory ();
if (player != null){
player.close ();
player.deallocate();
try
URL url = new URL ("file://"+fd.getDirectory()+fd.getFile());
MediaLocator mediaLocator = new MediaLocator (url);
player = Manager.createPlayer (mediaLocator);
catch (java.io.IOException e2)
System.out.println ("file not found :"+e2);
return;
catch (NoPlayerException e2)
System.out.println ("Could not find a player.");
return;
if (player == null)
System.out.println ("Trouble creating a player.");
return;
first = false;
frame.setTitle (fd.getFile ().toString());
player.addControllerListener (this);
player.prefetch ();
return;
public void controllerUpdate (ControllerEvent e)
if (e instanceof ControllerClosedEvent)
if (vc != null)
frame.getContentPane().remove (vc);
vc = null;
if (cc != null)
frame.getContentPane().remove (cc);
cc = null;
return;
if (e instanceof EndOfMediaEvent)
if (loop)
player.setMediaTime (new Time (0));
player.start ();
return;
if (e instanceof PrefetchCompleteEvent)
player.start();
return;
if (e instanceof RealizeCompleteEvent)
if (vc != null)
remove (vc);
vc = null;
if (cc != null)
remove (cc);
cc = null;
vc = player.getVisualComponent ();
if (vc != null)
frame.getContentPane().add(vc,BorderLayout.NORTH);
cc = player.getControlPanelComponent ();
if (cc != null){
frame.getContentPane().add (cc, BorderLayout.SOUTH);
frame.setVisible(true);
frame.pack();
public void keyReleased(KeyEvent ke) {
int keycode = ke.getKeyCode();
if (keycode==KeyEvent.VK_LEFT) {
skipBack();
} else if (keycode==KeyEvent.VK_RIGHT) {
skipForward();
public void keyTyped(KeyEvent ke) {
int keycode = ke.getKeyCode();
if (keycode==KeyEvent.VK_LEFT) {
skipBack();
} else if (keycode==KeyEvent.VK_RIGHT) {
skipForward();
public void keyPressed(KeyEvent ke) {
int keycode = ke.getKeyCode();
if (keycode==KeyEvent.VK_LEFT) {
skipBack();
} else if (keycode==KeyEvent.VK_RIGHT) {
skipForward();
}else if (keycode==KeyEvent.VK_UP) {
st();
}else if (keycode==KeyEvent.VK_DOWN) {
sp();
public void skipForward() {
Time settime;
double secs=5;
double playersecs = player.getMediaTime().getSeconds();
double duration = player.getDuration().getSeconds();
if((playersecs+secs) < duration){
settime = new javax.media.Time(playersecs + secs);
player.setMediaTime(settime);
}else {
player.setMediaTime(new Time(duration));
public void skipBack() {
double secs1=5;
double secs2=0;
double playersecs1 = player.getMediaTime().getSeconds();
Time settime1;
if((playersecs1 - secs1) > secs2){
settime1 = new javax.media.Time(playersecs1 - secs1);
player.setMediaTime(settime1);
}else {
player.setMediaTime(new Time(0));
public void st() {
player.start();
public void sp() {
player.stop();
public void itemStateChanged (ItemEvent e)
loop = !loop;
With Thanks
manuEdited by: mm_mm on Nov 27, 2007 11:09 PM -
Component Loader resizing external swfs
Hi. Fairly new to Flash. I'm putting together my first full
Flash site. The tutorial I'm following along with for some
assistance is written for Flash8, but I'm using CS3. To try to
minimize differences, I'm doing my files in Actionscript 2.
I've used an instance of the component Loader to load
external swfs (my pages) into the content portion of my main swf.
The problem I've run into is the loaded swfs are showing up at
different sizes. For ease of layout, the document sizes of the
external swfs are exactly the same as the mx.controls.Loader
instance on my main swf. But when they load, one is coming in
slightly larger than the original size, one nearly a quarter of the
size it should be. Everything else works.
In playing around to try to troubleshoot, I made one change
to my home swf (the external that loads immediately with a
Loader.contentPath command. This one had been loading slightly
enlarged), I changed a guide layer so it was a regular layer, no
longer a guide, then it loaded at the right size. When I changed
the layer back to a guide, it loaded somewhat enlarged again. I
tried turning off the guide layer on the other swf that was loading
small, it didn't help. I'm going nuts trying to figure it out.
I thought maybe it might have to do with the fact that some
elements start outside the document frame of the external swfs and
slide in, so I masked all layers to the size of the document. That
didn't help. Is there some scale setting for the Loader component
that I'm not aware of? That would cause the external swf to scale
up or down to fit the size of the Loader instance?
Any help would be appreciated. ThanksThanks. I tried a few more searches in Flash's Help for
Loader scaling and resize and found the scaleContent property, was
just coming back here to say nevermind and saw your response.
Sometimes it takes writing out the problem to spark more
troubleshooting inspiration.
BTW, changing Loader.scaleContent to false did solve my
problem. :) -
Window Component, swf, and PHP
Hi everyone,
I have a simple mail form, which communicates with a PHP
script on the server. When I go to the swf directly it works just
fine. When I put it inside the window component it stops working. I
think it has something to do with how the data gets sent from the
window component.
Anybody have a suggestion what to do?
Thanks,
- JanThis is the AS that is used in the form. When I navigate to
the swf directly, it works like a charm. When I load the the swif
with the form into my popup window it stops working. It seems that
the actionscript goes through the motions but doesn't receive a
response from the server.
The setup is as follows: On the main timeline I have a
button, which opens the popup window, in which the
"contactform.swf" loads. The attached ActionScript is in the 1st
frame of the actions layer in contactfrom.swf
Any help is greatly appreciated.
- Jan
The swf can be viewed at
SWF
and to view the swf in the popup window goto
Click Button
at Top -
I just boot camp my macbook white unibody to windows 7 but I can't setup my wifi plz help!
I just boot camp my macbook white to windows 7 home premium.
Used to run on windows XP(no problem with the wifi)
Plz help~~Howdy demccll,
If your Windows side is not seeing your Airport Extreme, I'm wondering if the Boot Camp drivers (Windows support software) was installed correctly. That is what installs the Airport drivers among other things.
Boot Camp: Install Windows on your Mac
Install Windows support software
After installing Windows, the support software installs Boot Camp drivers to support your Mac hardware, including AirPort devices, the built-in camera, the Apple Remote, the trackpad on a portable Mac, and the function keys on an Apple keyboard. The software also installs the Boot Camp control panel for Windows and the Apple Boot Camp system tray item.
You can download the support software by selecting the “Download the latest Windows support software from Apple” option in Boot Camp Assistant. The support software must be copied to an external USB drive formatted as MS-DOS (FAT).
After you configure Windows, if you kept the external USB drive that has the Windows support software inserted, an installer starts automatically. Otherwise, insert the external USB drive, then double-click the setup.exe file located in the BootCamp folder.
Follow the onscreen instructions. Important: Do not click the Cancel button in any of the installer dialogs.
If a message appears that says the software you’re installing has not passed Windows Logo testing, click Continue Anyway.
You don’t need to respond to installer dialogs that appear only briefly during the installation.
If nothing appears to be happening, there may be a hidden window that you must respond to. Look behind open windows.
When the support software finishes installing, click Restart, then click Yes.
After your Mac restarts, follow the instructions for any other installers that appear.
Check for updated Windows support software by using Software Update or going to the Boot Camp Support site.
Best regards,
Nubz -
Component loader & external swf : how send parameter ?
hello all,
I have a simple problem I have not been able to solve.
I use a compnent loader to load an external swf.
I need to pass a parameter to the swf to make it run
properly, which I named 'url_xml' and in which I provide the name
of an XML file.
the component loader is named 'diaporama'.
the following code works :
_root.diaporama.contentPath = "my_swfplayer.swf";
BUT I need to send a parameter, so I tried :
_root.diaporama.contentPath =
"my_swfplayer.swf?url_xml=filexml.xml";
It does not work. It tries to load a file named
my_swfplayer.swf?url_xml=filexml.xml
instead of loading my_swfplayer.swf with the param url_xml
whose value is filexml.xml.
Can somebody help ?
Many thanks.I would place some code in the loaded movie to look for the
variable and then start.
Cheers,
Gorka
www.AquiGorka.com -
Unload external swf from flv component
Please help.
Is it possible to add action script to the flv player
componet buttons?
I am trying to unload an external swf file (voice over) if
the viewer chooses to play one of the many videos in the
presentation. Currently I am using an invisible button over the flv
component play button which unloads the swf. This works but would
rather assign the action directly to the flv play button on press.
Any suggestions? Thank youI've created a empty movieclip at x : 0, y : 0 instanced as "container"
i've got working like this,
but now i 'm trying to call a function in root, directly from child.
luca.swf (back button_
box.bt_voltar.addEventListener(MouseEvent.CLICK,onClosed);
function onClosed(e:MouseEvent):void {
if(this.parent) {
if(this.parent is Loader && this.parent.parent)
this.parent.parent.removeChild(this.parent);
else
this.parent.removeChild(this);
var p:MovieClip = this.parent.parent as MovieClip;
p.traceEntrada();
and main.swf
function lucaHandler(e:MouseEvent):void
limpaHome();
bt_luca.visible = false;
bt_conheca.visible = false;
bt_jogo.visible = false;
var ldrLuca:Loader=new Loader();
ldrLuca.load(new URLRequest("luca.swf"));
ldrLuca.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);
addChild(ldrLuca);
function onCompleteHandler(loadEvent:Event):void{
container.addChild(loadEvent.currentTarget.content);
function traceEntrada():void{
trace("called from B.swf");
Now, as you can see, how can i call a function in parent from the loaded swf.
how can i call this trace function from the external loaded swf?
var p:MovieClip = this.parent.parent as MovieClip;
p.traceEntrada();
ps, im not using classes
Maybe you are looking for
-
BAPI for process order header delivered quantity
Hi, current requirement is to get the process order quantity with drawn and delivered quantity , when we try using the BAPI BAPI_PROCORD_GET_DETAIL , it does not have the process order delivered quantity - it has only total quantity for which proces
-
Heading style customizations not reflected in HTML Help file
I wanted to share a solution I found for a problem with heading styles. I am using RoboHelp 9 for Word with Office 2010 and generating an HTMLHelp .chm file. When I migrated from Office 2003 to 2010 and RoboHelp 8 to 9, I customized the RoboHelp.docm
-
How do I fully embed a font with Illustrator 5 to PDF?
No matter what setting I use in "subset if below" the font is still subset - I am creating a variable text mark for Prinergy and the font must be fully embedded so the variable text can update
-
Problem with tx2510us 12.1" laptop. Screen is rotating 180 degrees
Hi, I got a laptop tx2510us 8 months back. Whenever I try to use the keypad the screen is rotating to 180 degrees and keyboard stops working. I'm rotating the screen switching into notebook mode and using the pen to do the activities. please help!!
-
PO Output for Communication landscape PDF printing sideways issue
Hi, I created a custom pdf template which uses the Standard Purchase Order Data Source (PO_STANDARD_PO) data definition. The requirement was to change the look of the standard po report and also to make it landscape. I was able to successfully create