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,
- Jan
This 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
Similar Messages
-
Local SWF vs Server Side SWF and PHP
I am having the strangest problem... I have a form in Flash
where I use the sendAndLoad () function to communicate with a PHP
file, that then sends an email with the loaded data. The action
works fine when I run the SWF from my Mac to the server side PHP
file using an absolute address. But it doesn't work when the SWF is
on the server, again running an absolute path to the PHP file.
Has anyone experienced this issue before? Is it a problem
with security?
Thanks,
gHi David
If an online converter suits you, try Flabaco - www.flash-banner-converter.com
It converts SWF to Video, generating three formats - MP4, OGG and WebM.
Kayo -
Crystal 8 Web Component Server ond Windows Server 2003 and IIS 6
I am trying to get Crystal 8 Web Component and Page Server to run on Windows 2003 Server with IIS 6. I have done the following:
Added the .cri and .rpt ISAPI extension mappings
Have Cache ISAPI extentions selected
Deselected "verify that file exists"
Aded the .cri and .rpt MIME types
Added wcsinsapi.dll as a IIS 6.0 extension
The above resolved all HTTP 40x.x errors but when trying to access a report from IE I receive the following error:
Error: Could not connect to the Web Component Server.
The page server and web component server services are running and I do see the listen ports (6401, 6403) active.
I know this is old software but it works quite well under a Windows 2000 Server and other web postings indicate that it is possible to run Crystal 8 under WS2003 and IIS 6.
Does any one know of a white paper/support document that details how to run Crystal 8 under Windows Server 2003 and IIS 6?
Has any one done this successfully?
Any tips as to cause of the "Could Not Connect" problem would be greatly appreciated.Well as it turns out it looks like it was just this server.
We tried everything, and I added those user accounts to full
permission for the Coldfusion folders and we just could not get it
to work. We tried it on another couple servers running 2003, and it
installed perfectly right out of the box with no other permissions
needed. And those servers were all running default configs with no
other permissions done.
We still have no idea what was the problem, but at least for
now it seems to be this server. But I will tell you what, that II6
stuff seems to be a bit of a pain, we had major problems installing
new version of PHP with it too. Oh well, good luck to you
too! -
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
MikeSkip the hub and use one of the rear ports on the computer.
-
My objective:
1) load a blankMC from the library in to a custom component.
The custom component is made up of a window component.
2) from the blankMC, create a maskMC and a containerMC
3) load an external swf in to the containerMC
4) use maskMC as containerMC's mask
I have completed all of this inside Flash authoring
environment
If i run my swf as a stand alone, the masking no longer works
for certain swfs.This 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 tried to install iTunes 10.6.1 for Windows (64 bit) and it says "A required iTunes component is not installed. Please repair or reinstall iTunes. (-42404). I have tried uninstalling everything and reinstalling and it still does not work. I then restored my computer to a week ago and tried to download and install the update and this came up again.
Check out this thread:
https://discussions.apple.com/thread/3677426?start=0&tstart=0 -
My nodejs and php component is ready but how will we insert in eloqua for all users?
Hi there,
my nodejs and php component is ready but how will we insert in eloqua for all users?
ThanksHi there,
Please help me. -
FLVPlayback Component video and skin as one swf
Is it possible when publishing a Flash CS4 file to have the Video swf and the Skin swf be in one swf file?
I have a Flash CS4 (AS2) file that has a FLVPlayback Component. When I publish or test movie 2 swfs are output. I need only 1 swf as I am then going to insert this 1 swf into a Captivate 4 project.
When I insert the video swf by itself into Captivate 4, I do not have a play bar/skin.
If it is not possible to publish as one swf, can someone please tell me how I can insert the 2 swfs into a Captivate file and get them to work?
Thanks in advance.My project is called JumpVideo.
The only 2 items in my library are the FLVPlaybackComponent and a Combo box.
I have imported a video using the FLVPlaybackComponent and have selected the SteelExternalPlaySeekMute skin to go with the playback.
The video has defined cue points. The combo box has two values. When the first is selected it jumps to the start of the video. When the second is selected it jumps to the cue point.
When I publish there are two swfs that are produced; the project swf itself (JumpVideo.swf) and the skin (SteelExternalPlaySeekMute.swf).
I would like there to be only one swf published (i.e. the skin is within the JumpVideo.swf).
Is this possible?
The swfs will then need to be inserted into Captivate 4 as animation.
If 1 swf cannot be published, then can you perhaps help with how I can insert the JumpVideo.swf and the skin swf into Captivate and have it work as it does in Flash CS4? -
I just bought a 2013 late model Mac Book Pro Retina and am wondering if it is worth installing windows through boot camp.
If I install the windows component in order to run an exe file and its component "Declans Korean Flash Cards"... will it make my mac suseptible to viruses overall due to having a windows component? also will it make my mac slower as wellIf you are only going to use one or two window only programs then I wouldn't waste the space. Try WinonX it allows you to install exe. Files on Mac without installing windows.
-
Problem loading window component more than once
I have a swf with a button that opens a window component
(from my library). it loads fine and also closes fine when I click
the close button in the window. but when I try to open the window
again, it actually loads again, but it stalls and locks up
immediatley. can anybody tell me what is wrong with my code? I also
was going to have different buttons to open different windows (each
swf playing a song and has written lyrics). it does the same thing
when i load the first window, close it, then try to open a second
window. it stalls and locks up.
please, I really need some help!Ok it sort of works... here is my code:
on (release) {
trace("button works");
win.title = "Yellow Birthday Package";
win.closeButton = true;
win.contentPath = "yellowPack";
win.setSize(550,500);
var listener:Object = new Object();
listener.click = function(){
win._visible = false;
win.addEventListener("click",listener);
It order to make it work, the window component has to be on the stage but i want it to popup only when the user clicks on the button. So the window should be hidden/invisible when the page first loads. I tried changing win._visible = true; but that did nothing.
The other problem is that the movie clip inside the window, isnt aligning center. i can only see a corner of the movie clip. in the top left. I havent tested the whole thing live though! -
Pausing swfs and audio in a browser when the tab is out of focus
I'm trying to code my flash file so that the html will pause all swfs AND audio when the tab is out of foucs. I found this code on http://frontenddeveloper.net/wiki/index.php?title=JavaScript_and_VBScript_Injection_in_Act ionScript_3 and it works,but not completely. It only pauses the movie clips that are in the Flash file and not any that are exteranlly loaded with audio included.
How can I adjust it to pause the externally loaded swfs that are loaded to a mc within my main movie clip and the audio OR what should I use in place of this code? Someone mentioned on a different post that I needed to use a window.onblur funcition, but they didn't give details.
import flash.display.MovieClip;
import flash.utils.setTimeout;
// This is a more "safe than sorry" setting, since multiple domains
// have entry into my site. Can be removed or hardcoded if you feel
// secure or insecure, as you see fit.
flash.system.Security.allowDomain("*");
// Throw any errors around to make sure somebody actually gets them.
ExternalInterface.marshallExceptions = true;
// This is not the most ideal way to toggle animations on and off, but
// it's thorough, generic, and simple. Iterate all movieclips within
// clip, shutting them down each in turn. A better, but much more tedious
// method would be to target specific clips using dotpath notation, telling
// each in turn to turn off or on depending on what we need.
// BUT this is just a demo, and what we're really interested in is the
// event-handling mechanism that actually calls this routine, and not the
// routine itself.
function toggleAllClips(doAnim, clip) {
if ( clip is MovieClip) {
if (doAnim) {
clip.play();
} else {
clip.stop();
for (var i = 0; i<clip.numChildren; i++) {
toggleAllClips(doAnim, clip.getChildAt(i));
function animOn(e:*=null) {
toggleAllClips(true, this.mainMC);
function animOff(e:*=null) {
toggleAllClips(false, this.mainMC);
function injectPrep(e:*=null) {
try {
ExternalInterface.addCallback("jsanimOn", animOn);
ExternalInterface.addCallback("jsanimOff", animOff);
} catch (e) {
trace(e);
function injectListeners(e:*=null) {
try {
// Object/Embed ID of this movie needs to be inserted into the
// JavaScript before we actually wrap and send it to the browser:
var jsfix=js.toString().replace(/xxx/g, ExternalInterface.objectID);
ExternalInterface.call(jsfix);
} catch (e) {
trace(e);
// Using timeouts ensures the movie is actually done loading before
// these fire, helping compatibility for a few browser versions.
setTimeout(injectPrep,0);
setTimeout(injectListeners,100);
JAVASCRIPTS
JavaScript needs to be wrapped in a tag, a cdata, and a closure
function in order to be wrapped up and sent to the browser.
Note that an ActionScript function will replace all instances
of "xxx" with the actual ID used for this SWF.
We're battling some major bugs and crossbrowser idiosyncrasies
here:
1) In Internet Explorer the 'onblur' event is implemented
incorrectly (as opposed to Firefox/Mozilla browsers). It is
wrongly fired when focus is switched between HTML elements
*inside* a window. As a result, we have to use onfocusout
instead of onblur, and keep track of which element is active.
If we focusout and the active element is not the previous
active element, then we haven't actually "blurred" and dont
want to trigger Flash.
2) Firefox has problems interpreting both getElementById and
document["swf"] when dealing with "twicebaked" object/embeds.
Adobe's method of finding the swf fails to address the fact
that document["swf"] sometimes returns an array in this
situation rather than an object ref, and getElementById
sometimes confuses name and id.
3) When a window is created in Firefox, it doesn't actually have
"focus" (event though it appears to) and therefore won't "blur"
unless you actually click in it first, i.e if you open up a
window, then immediately send it to the background, it never
gets the command to halt the flash. So we have to explicitly
focus the blasted thing to get it to work properly.
4) Because of irregularities caused by Ajax, the way browsers shut
down, and other factors, there's a good chance our swf won't
be there when a blur (or focusout) event occurs. Therefore we
need an explicit check within the event handler itself.
5) Finally, we want to wrap everything inside a wrapper-closure
function, to keep everything safe from being stepped on. Lucky
us, we have to do this anyways to get everything to fit inside
a single ExternalInterface.call event.
var js:XML = <script><![CDATA[
( function() {
var active_element; // tracker for ie fix;
var bIsMSIE = false;
// Modified version of Adobe's code resolves a bug in FF:
function getSWF(movieName) {
if (navigator.appName.indexOf("Microsoft") != -1) {
return window[movieName];
} else {
// Resolves a bug in FF where an array is sometimes returned instead of a
// single object when using a nested Object/Embed.
if(document[movieName].length != undefined){
return document[movieName][1];
return document[movieName];
// Need to check for swf each time we try this because the swf may actually be gone
// because of ajax or a window closure event. Prevents error dialog from popping up.
// Future release should check for this condition and then remove the calling event
// so it doesn't keep triggering.
function animOff(){
if (bIsMSIE && (active_element != document.activeElement)) {
active_element = document.activeElement;
} else {
var logoThang = getSWF("xxx");
if(logoThang){logoThang.jsanimOff();}
function animOn(){
if (bIsMSIE && (active_element != document.activeElement)) {
active_element = document.activeElement;
} else {
var logoThang = getSWF("xxx");
if(logoThang){logoThang.jsanimOn();}
// Add the listeners. Hear ye, here ye.
if (typeof window.addEventListener !== "undefined") {
// Firefox, Mozilla, et al.
window.addEventListener("blur", animOff, false);
window.addEventListener("focus", animOn, false);
} else if (typeof window.attachEvent !== "undefined") {
// Internet Explorer
bIsMSIE = true;
window.attachEvent("onfocus", animOn);
// Another bug: window.onblur ALWAYS fires in IE, so
// we have to keep track of what we're clicking using
// another method:
active_element = document.activeElement;
document.attachEvent("onfocusout", animOff);
// Necessary to trigger toggling in FF if the page hasn't actually been clicked in and the page
// is sent to the background. Can be commented out if necessary, e.g. if you don't want the page
// popping to the top or want focus to remain somewhere else like a form field.
window.focus();
]]></script>;I added this code and it removes the externally loaded swfs. I don't want that, I want them to pause and then resume when the tab is back in foucs. Also, the main code restarts the main movie clip upon refocusing too.
Added code:
function toggleAllLoaders(doAnim, loader) {
if ( loader is Loader) {
if (doAnim) {
loader.play();
} else {
loader.stop();
for (var i = 0; i<loader.numChildren; i++) {
toggleAllLoaders(doAnim, loader.getChildAt(i));
I added the new function to all of the places that had the "toggleAllClips" function. -
Window Component with Loader Component
I have the SWF loading into a shell using a Loader component.
Within one swf is a trigger for a window - which ,suprise suprise,
doesn't work. It works fine if I access the swf directly just not
when loaded through the shell. I have added the component to the
shell fla and then although a window component loads up, the
content (which is linked in the library) is not found. Anyone come
across this before?There is a discussion of modules and popups on my blog
Alex Harui
Flex SDK Team
Adobe System, Inc.
http://blogs.adobe.com/aharui -
Hi, I'v inserted a Window Component to my movie and got it
all to work perfectly. Now the problem I am having is that I want
to insert another windows component but it will not let me change
the Linkage Identifier...I can't even see the properties of the
component. Every time I dbl-click on it, it says; "Create an
instance of this SWF symbol and edit its properties using the
Parameters panel...".
Can anyne help me? What I want is to have different window
components in my movie that each get executed by the click of
corresponding button.
Thank youYou are seeing that alert when you double click on the
component in the Library. That is your "master" component. To set
or change the properties of a component instance by selecting the
instance on the stage and then opening the Parameters tab of the
Properties window.
If you want a second Window component in your movie, just
drag a new instance of the component from the Library window, give
it an instance name and set unique property values for that new
instance. -
Flash cs3 and php problem (system error)
Hi All,
Been checking out a free utility, called Tell A Friend - followed the instructions to a t but still getting system error.
Here is the php code:
<?php
$to = ($_POST['friend']);
$link = ($_POST['link']);
$subject = "Tell a friend";
$message = "Your friend ";
$message .= $_POST['name'] . " wants advice you the following link: ".$link;
$headers = "My WebSite Name";
if(@mail($to, $subject, $message, $headers))
echo "answer=ok";
else
echo "answer=error";
?>
The main swf has a main.as attached:
* Flash Tell A Friend
* http://www.FlepStudio.org
* Author: Filippo Lughi
* version 1.0
package
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.external.*;
import flash.net.*;
public class main extends MovieClip
private const PHP_URL:String="sendMail.php";
private var checker:CheckEmail;
private var timer:Timer;
public function main()
addEventListener(Event.ADDED_TO_STAGE,init);
private function init(evt:Event):void
removeEventListener(Event.ADDED_TO_STAGE,init);
stage.frameRate=31;
checker= new CheckEmail();
addInputListener();
addSendListener();
private function addInputListener():void
clip_mc.name_txt.background=true;
clip_mc.name_txt.backgroundColor=0x999999;
clip_mc.name_txt.addEventListener(FocusEvent.FOCUS_IN,onFocusIn);
clip_mc.name_txt.addEventListener(FocusEvent.FOCUS_OUT,onFocusOut);
clip_mc.email_txt.background=true;
clip_mc.email_txt.backgroundColor=0x999999;
clip_mc.email_txt.addEventListener(FocusEvent.FOCUS_IN,onFocusIn);
clip_mc.email_txt.addEventListener(FocusEvent.FOCUS_OUT,onFocusOut);
private function onFocusIn(evt:Event):void
evt.target.background=true;
evt.target.backgroundColor=0xFFFFFF;
private function onFocusOut(evt:Event):void
evt.target.backgroundColor=0x999999;
private function addSendListener():void
clip_mc.send_mc.mouseChildren=false;
clip_mc.send_mc.buttonMode=true;
clip_mc.send_mc.addEventListener(MouseEvent.MOUSE_DOWN,onSendDown);
private function onSendDown(evt:MouseEvent):void
if(clip_mc.name_txt.text!="")
if(checker.initCheck(clip_mc.email_txt.text))
sendEmail();
else
displayPhrase("Invalid Email");
else
displayPhrase("Invalid name");
private function sendEmail():void
clip_mc.send_mc.mouseEnabled=false;
var variables:URLVariables=new URLVariables();
variables.name=clip_mc.name_txt.text;
variables.friend=clip_mc.email_txt.text;
variables.link=ExternalInterface.call('window.location.href.toString');
var request:URLRequest=new URLRequest();
request.url=PHP_URL;
request.method=URLRequestMethod.POST;
request.data=variables;
var loader:URLLoader=new URLLoader();
loader.dataFormat=URLLoaderDataFormat.VARIABLES;
loader.addEventListener(Event.COMPLETE,onMessageSent);
try
loader.load(request);
catch (error:Error)
trace('Unable to load the document.');
private function onMessageSent(evt:Event):void
var vars:URLVariables=new URLVariables(evt.target.data);
if(vars.answer=='ok')
displayPhrase("Message Sent!");
else
displayPhrase("System Error!");
clip_mc.send_mc.mouseEnabled=true;
clip_mc.name_txt.text="";
clip_mc.email_txt.text="";
private function displayPhrase(s:String):void
clip_mc.display_txt.text=s;
resetPhrase();
private function resetPhrase():void
timer=new Timer(1500,1);
timer.addEventListener(TimerEvent.TIMER,hidePhrase);
timer.start();
private function hidePhrase(evt:TimerEvent):void
clip_mc.display_txt.text="";
Any help appreciated. This is a great viral marketing tool, when it ever works
Kind Regards,
Boxing BoomNever seen such an error, but if it's in the status bar of the browser then it shouldn't be Flash problem. You can check what's happening in your swf by creating a dynamic text field and setting it's text in every major action, that is: requesting PHP and getting back response, to what's just happened.
So, on the Flash side you can see whether the browser error stops the PHP script and immobilizes further actions.
What I'd do is create a new Flash file and PHP file and just send 1 variable to PHP, change it somehow and send it back to Flash and print it in a text field. That way you can check whether it's the method you're using to request PHP or just PHP or something else. Step by step adding complexity and checking on which of these steps the error occurs.
I wish you good luck.
Ps. It's probably a very rookie problem, we just don't know the source. -
Using databases with Flash and PHP
Hi, everyone!
I`m a PHP newbie. I just learned PHP so that I can use
databases with Flash.
I`ve got a .php script that contains html that loads up my
.swf file. The .swf file is the core of my site. What I want to
know is if I can call some PHP functions (that I have wrote in the
.php script) from within the .swf file... This functions would
perform the reading and updating of my database.
The only way I know of to modify a database from Flash is
using the POST and GET methods. But that opens up a new browser
window in which the PHP script is called. And that only handles
writing in the database. So, what if I just want to read from the
database some values and insert them into a TextField in Flash? How
do I do that?
Thanks! Ardy1. Goggle "Flash and mySQL" and you'll get a listing of alot
tutorials
2. I'm also just learning. Here's a great URL to start:
Building with Flash and MySQL
That's right, a Flash-based blog — it sounds a little
loony, but this blog pulls content from a MySQL database and feeds
it into the dynamic Flash frontend ...
www.webmonkey.com/programming/php/tutorials/tutorial2.html -
20k - Cached -
Maybe you are looking for
-
Help needed in understanding the code.
Hi All, I am just trying to understand the Java code in one Self Serice page. However, I am having tough in understanding the CO code. In the prosessRequest class, I have the below code. oapagecontext.putTransactionValue("AddAssignmentInsertRowFlag",
-
USB mouse not recognized in windows 8.1 - tried all no help
Hi, I am having this issue for 2 weeks now. Plugging the muse to USB port didn't make any difference to system, it hasn't been seen at all (noting in dev manager, no beep etc). I was connecting same mouse using PS/2 adapter and worked well. After doi
-
Need to write object to database but can't find useful examples
Hi, Within one servlet I need to write an Attributes object to a database to be retrieved sometime later by a second servlet. All the examples of serialization code that I can find are for writing to serial or file streams. What I need is to be able
-
How do I put this icon on my dock (on a mac).
-
First question: I wanted to know what happens if an ipod is registered to the legal owner, then the ipod is lost and the person who found the ipod tries to use itunes -- what happens? When I connect the ipod to itunes, itunes automatically recognize