You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by agm65 <ag...@gmx.de> on 2016/02/17 11:16:51 UTC

swfobject call flash function

Hi all,

i have problens calling a function in my flash:

   var flashvars = {
            };
            
            var params = {
                allowScriptAccess: "always", 
                wmode: "transparent",
                quality: "high",
                menu: "false"
            };
            
            var attributes = {
              id:"flash_movie",
              name: "flash_movie"
            };

swfobject.embedSWF("section_02.swf", "section_02", "100%", "100%", "9.0.0",
"expressinstall.swf",flashvars,params,attributes);


call:

document.getElementById("section_02").startAllAni();

or

document.getElementById("flash_movie").startAllAni();


always function undefined?






--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/swfobject-call-flash-function-tp11991.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: http failed

Posted by Frank Dahmen <fr...@dahmenia.de>.
thanks,
yes i read this post already, but than I read somewhere thar AIR has a 
default of 30sec timeout
and got away from this solution...also because waiting > 30sec for a 
DB-query to return (not millions of rows)
would not be a real solution
but I will keep this in mind

but, the provider told me to give him some time figures when the error 
occurred so he could look at logs etc.
I told the customer to write down the time when error occurs
so we had 10:31, 10:35 10:40, 10:42  yesterday  (hh:mm)
shouldn't the provider be able to see heavy load on the server at these 
times if that was the case? (if he is willing to;))
(I'm not really in the server-admin-stuff)

maybe i should try, if the error occurs, immediately try to "ping" the 
server and also another server like google
if only the second ping is succesfull, then it is the server not AIR or else

very intersting, as I said we will first finish the new version and then 
maybe investigate further







Am 18.02.2016 um 16:55 schrieb Clint M:
> You might get this error if the remote object is timing out... possibly
> because the server is under too much load.
> It seems like someone is having a similar issue with a workaround by
> setting the connectTimeout and requestTimeout properties on the amf channel.
> Check the last post on this thread: https://forums.adobe.com/thread/100543
>
> Here's a full example of how to setup an amf channel at runtime:
> https://gertonscorner.wordpress.com/2008/09/06/remoteobject-using-amfphp-and-actionscript-3/
>
> This will also override anything you have setup using services-config.xml
> which generates code at compile time so you could do away with compiling
> those in if you're actually using a services-config.xml in the first place.
>
> On Thu, Feb 18, 2016 at 7:48 AM, Frank Dahmen <fr...@dahmenia.de> wrote:
>
>> thanks,
>>
>> - no this version uses 2 or 3 year old sdk and AIR
>>
>> - it's the message of the FaultEvent in the eventlistener of the
>> RemoteObject, can't say the whole text now (error not reproducable)
>> "........http failed"
>>
>> - yes, it worked, the app is in production phase for 2 years
>>
>> we will see with the new version, if the error also occurs, we will have
>> to investigate more
>>
>>
>>


Re: http failed

Posted by Clint M <cm...@gmail.com>.
You might get this error if the remote object is timing out... possibly
because the server is under too much load.
It seems like someone is having a similar issue with a workaround by
setting the connectTimeout and requestTimeout properties on the amf channel.
Check the last post on this thread: https://forums.adobe.com/thread/100543

Here's a full example of how to setup an amf channel at runtime:
https://gertonscorner.wordpress.com/2008/09/06/remoteobject-using-amfphp-and-actionscript-3/

This will also override anything you have setup using services-config.xml
which generates code at compile time so you could do away with compiling
those in if you're actually using a services-config.xml in the first place.

On Thu, Feb 18, 2016 at 7:48 AM, Frank Dahmen <fr...@dahmenia.de> wrote:

> thanks,
>
> - no this version uses 2 or 3 year old sdk and AIR
>
> - it's the message of the FaultEvent in the eventlistener of the
> RemoteObject, can't say the whole text now (error not reproducable)
> "........http failed"
>
> - yes, it worked, the app is in production phase for 2 years
>
> we will see with the new version, if the error also occurs, we will have
> to investigate more
>
>
>

Re: http failed

Posted by Frank Dahmen <fr...@dahmenia.de>.
thanks,

- no this version uses 2 or 3 year old sdk and AIR

- it's the message of the FaultEvent in the eventlistener of the 
RemoteObject, can't say the whole text now (error not reproducable)
"........http failed"

- yes, it worked, the app is in production phase for 2 years

we will see with the new version, if the error also occurs, we will have 
to investigate more




Am 18.02.2016 um 16:25 schrieb Alex Harui:
> Well, what changed?  Did you change the version of AIR?  Or Flex SDK
> version?
>
> Is there an error code, or more text reported than just "http failed"?
>
> What is reporting the error?  ActionScript code, the browser, something
> else?
>
> Should your remoteobject be using HTTP?
>
> -Alex
>
> On 2/18/16, 6:19 AM, "Frank Dahmen" <fr...@dahmenia.de> wrote:
>
>> thanks,
>> but the app already worked over a year, the problems start occuring a
>> few weeks ago??
>> not only here locally, mainly on the customers device (wlan and mobile
>> network)
>>
>> could it be the AIR captive runtime?...but again it worked.....
>>
>>
>> Am 18.02.2016 um 15:14 schrieb Clint M:
>>> Could be quite a number of things... for example(s)
>>> 1. bad routing
>>> 2. bad wifi router
>>> 3. lost the connection for a few seconds because someone turns on a
>>> microwave that interferes with the wifi signal <-- this is a real thing
>>> (
>>> https://support.apple.com/en-us/HT201542)
>>>
>>>
>>> On Thu, Feb 18, 2016 at 5:40 AM, Frank Dahmen <fr...@dahmenia.de> wrote:
>>>
>>>> Hi,
>>>> not really a flex question but anyway,
>>>> in an air mobile app with zend-amf backend i randomly get not
>>>> reproducible
>>>> "http failed" errors on remoteobjects,
>>>> what could this cause this?
>>>> I think it has to be the webserver or mysql server?
>>>> (not internet connection, the error occurs also on wlan)
>>>> The provider says he couldn't see something in the logs.......?
>>>> i can't see the mysql logs, the webserver logs really look ok, all
>>>> requests status:200
>>>>
>>>> what else could cause a http failed error?
>>>>
>>>> any help?
>>>> thanks
>>>>
>>>>
>>>>
>>>>
>>>>


Re: http failed

Posted by Alex Harui <ah...@adobe.com>.
Well, what changed?  Did you change the version of AIR?  Or Flex SDK
version?

Is there an error code, or more text reported than just "http failed"?

What is reporting the error?  ActionScript code, the browser, something
else?

Should your remoteobject be using HTTP?

-Alex

On 2/18/16, 6:19 AM, "Frank Dahmen" <fr...@dahmenia.de> wrote:

>thanks,
>but the app already worked over a year, the problems start occuring a
>few weeks ago??
>not only here locally, mainly on the customers device (wlan and mobile
>network)
>
>could it be the AIR captive runtime?...but again it worked.....
>
>
>Am 18.02.2016 um 15:14 schrieb Clint M:
>> Could be quite a number of things... for example(s)
>> 1. bad routing
>> 2. bad wifi router
>> 3. lost the connection for a few seconds because someone turns on a
>> microwave that interferes with the wifi signal <-- this is a real thing
>>(
>> https://support.apple.com/en-us/HT201542)
>>
>>
>> On Thu, Feb 18, 2016 at 5:40 AM, Frank Dahmen <fr...@dahmenia.de> wrote:
>>
>>> Hi,
>>> not really a flex question but anyway,
>>> in an air mobile app with zend-amf backend i randomly get not
>>>reproducible
>>> "http failed" errors on remoteobjects,
>>> what could this cause this?
>>> I think it has to be the webserver or mysql server?
>>> (not internet connection, the error occurs also on wlan)
>>> The provider says he couldn't see something in the logs.......?
>>> i can't see the mysql logs, the webserver logs really look ok, all
>>> requests status:200
>>>
>>> what else could cause a http failed error?
>>>
>>> any help?
>>> thanks
>>>
>>>
>>>
>>>
>>>
>


Re: http failed

Posted by Frank Dahmen <fr...@dahmenia.de>.
thanks,
but the app already worked over a year, the problems start occuring a 
few weeks ago??
not only here locally, mainly on the customers device (wlan and mobile 
network)

could it be the AIR captive runtime?...but again it worked.....


Am 18.02.2016 um 15:14 schrieb Clint M:
> Could be quite a number of things... for example(s)
> 1. bad routing
> 2. bad wifi router
> 3. lost the connection for a few seconds because someone turns on a
> microwave that interferes with the wifi signal <-- this is a real thing (
> https://support.apple.com/en-us/HT201542)
>
>
> On Thu, Feb 18, 2016 at 5:40 AM, Frank Dahmen <fr...@dahmenia.de> wrote:
>
>> Hi,
>> not really a flex question but anyway,
>> in an air mobile app with zend-amf backend i randomly get not reproducible
>> "http failed" errors on remoteobjects,
>> what could this cause this?
>> I think it has to be the webserver or mysql server?
>> (not internet connection, the error occurs also on wlan)
>> The provider says he couldn't see something in the logs.......?
>> i can't see the mysql logs, the webserver logs really look ok, all
>> requests status:200
>>
>> what else could cause a http failed error?
>>
>> any help?
>> thanks
>>
>>
>>
>>
>>


Re: http failed

Posted by Clint M <cm...@gmail.com>.
Could be quite a number of things... for example(s)
1. bad routing
2. bad wifi router
3. lost the connection for a few seconds because someone turns on a
microwave that interferes with the wifi signal <-- this is a real thing (
https://support.apple.com/en-us/HT201542)


On Thu, Feb 18, 2016 at 5:40 AM, Frank Dahmen <fr...@dahmenia.de> wrote:

> Hi,
> not really a flex question but anyway,
> in an air mobile app with zend-amf backend i randomly get not reproducible
> "http failed" errors on remoteobjects,
> what could this cause this?
> I think it has to be the webserver or mysql server?
> (not internet connection, the error occurs also on wlan)
> The provider says he couldn't see something in the logs.......?
> i can't see the mysql logs, the webserver logs really look ok, all
> requests status:200
>
> what else could cause a http failed error?
>
> any help?
> thanks
>
>
>
>
>

http failed

Posted by Frank Dahmen <fr...@dahmenia.de>.
Hi,
not really a flex question but anyway,
in an air mobile app with zend-amf backend i randomly get not 
reproducible "http failed" errors on remoteobjects,
what could this cause this?
I think it has to be the webserver or mysql server?
(not internet connection, the error occurs also on wlan)
The provider says he couldn't see something in the logs.......?
i can't see the mysql logs, the webserver logs really look ok, all 
requests status:200

what else could cause a http failed error?

any help?
thanks





Re: swfobject call flash function

Posted by agm65 <ag...@gmx.de>.
Hi,

on button click. I tested several seconds after flash is shown.
I am running out of ideas. Wait, it seems to work on a local server. But not
locally eithout server, is that true?






--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/swfobject-call-flash-function-tp11991p12012.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: swfobject call flash function

Posted by Alex Harui <ah...@adobe.com>.
You are correct that the flash object and any callback may not be
registered in time to be called from the JS.  When is your
document.getElementById getting called?

-Alex


On 2/17/16, 11:25 PM, "agm65" <ag...@gmx.de> wrote:

>Hi,
>
>thx for the answer. This is the as3 part of my app.
>
>Security.allowDomain("*");
>ExternalInterface.addCallback("startAllAni",startAllAni);
>
>function startAllAni(){
>	main.hand.gotoAndPlay(2);
>}
>
>It looks like that document.getElementById does not get the flashobject as
>object cause of the error message. Function startAllAni is undefined.
>Calls
>from flash to js works like always so externalinterface works.
>
>Any ideas?
>
>
>
>
>
>--
>View this message in context:
>http://apache-flex-users.2333346.n4.nabble.com/swfobject-call-flash-functi
>on-tp11991p12009.html
>Sent from the Apache Flex Users mailing list archive at Nabble.com.


Re: swfobject call flash function

Posted by agm65 <ag...@gmx.de>.
Hi,

thx for the answer. This is the as3 part of my app.

Security.allowDomain("*");
ExternalInterface.addCallback("startAllAni",startAllAni);

function startAllAni(){
	main.hand.gotoAndPlay(2);
}

It looks like that document.getElementById does not get the flashobject as
object cause of the error message. Function startAllAni is undefined. Calls
from flash to js works like always so externalinterface works.

Any ideas?





--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/swfobject-call-flash-function-tp11991p12009.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: swfobject call flash function

Posted by OmPrakash Muppirala <bi...@gmail.com>.
In your AS3 code, have you added a callback using ExternalInterface like
this:

ExternalInterface.addCallback("startAllAni", startAllAni);

More details here:
http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118a9b90204-7cb2.html#WS5b3ccc516d4fbf351e63e3d118a9b90204-7ca7

Thanks,
Om

On Wed, Feb 17, 2016 at 2:16 AM, agm65 <ag...@gmx.de> wrote:

> Hi all,
>
> i have problens calling a function in my flash:
>
>    var flashvars = {
>             };
>
>             var params = {
>                 allowScriptAccess: "always",
>                 wmode: "transparent",
>                 quality: "high",
>                 menu: "false"
>             };
>
>             var attributes = {
>               id:"flash_movie",
>               name: "flash_movie"
>             };
>
> swfobject.embedSWF("section_02.swf", "section_02", "100%", "100%", "9.0.0",
> "expressinstall.swf",flashvars,params,attributes);
>
>
> call:
>
> document.getElementById("section_02").startAllAni();
>
> or
>
> document.getElementById("flash_movie").startAllAni();
>
>
> always function undefined?
>
>
>
>
>
>
> --
> View this message in context:
> http://apache-flex-users.2333346.n4.nabble.com/swfobject-call-flash-function-tp11991.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>

Re: Issue with Spark DropDownList in 15.0

Posted by Alex Harui <ah...@adobe.com>.

On 2/17/16, 10:48 PM, "omuppi1@gmail.com on behalf of OmPrakash Muppirala"
<omuppi1@gmail.com on behalf of bigosmallm@gmail.com> wrote:

>It might be a bug.   But I always thought this is the kind of scenario for
>which the the callLater method was created for.

Without having debugged into it, I'd say it is a bug.  The drop down
should go away for any number of scenarios where it loses focus.

-Alex


RE: Issue with Spark DropDownList in 15.0

Posted by OmPrakash Muppirala <bi...@gmail.com>.
It might be a bug.   But I always thought this is the kind of scenario for
which the the callLater method was created for.

Thanks,
Om
On Feb 17, 2016 4:29 PM, "Jason Taylor" <ja...@dedoose.com> wrote:

> that was the fix :-P, works fine with callLater, but still seems to be a
> bug
>
> -----Original Message-----
> From: omuppi1@gmail.com [mailto:omuppi1@gmail.com] On Behalf Of OmPrakash
> Muppirala
> Sent: Wednesday, February 17, 2016 3:50 PM
> To: users@flex.apache.org
> Subject: Re: Issue with Spark DropDownList in 15.0
>
> What happens when you set textArea.setFocus() in a callLater function?
>
> Thanks,
> Om
>
> On Wed, Feb 17, 2016 at 3:18 PM, Jason Taylor <ja...@dedoose.com> wrote:
>
> > noticing the following issue:
> >
> > - spark drop down list has a event handler for change
> > - on change event handler calls spark TextArea.setfocus (guessing any
> > setfocus should trigger issue)
> > - dropdownlist does not close
> >
> >
> > Sample Application:
> > <?xml version="1.0"?>
> > <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
> > xmlns:s="library://ns.adobe.com/flex/spark">
> >     <s:DropDownList id="fontDDL" width="150"
> change="OnFontChange(event)">
> >         <s:dataProvider>
> >             <s:ArrayList id="fontList" source="[Arial,Times New
> > Roman,Verdana,Trebuchet MS]" />
> >         </s:dataProvider>
> >     </s:DropDownList>
> >
> >     <s:TextArea id="textArea" width="100%" top="20" bottom="10"/>
> >     <fx:Script><![CDATA[
> >         import spark.events.IndexChangeEvent;
> >
> >         protected function OnFontChange(evt:IndexChangeEvent):void
> >         {
> >             textArea.setFocus();
> >         }
> >         ]]></fx:Script>
> > </s:Application>
> >
> >
>

RE: Issue with Spark DropDownList in 15.0

Posted by Jason Taylor <ja...@dedoose.com>.
that was the fix :-P, works fine with callLater, but still seems to be a bug

-----Original Message-----
From: omuppi1@gmail.com [mailto:omuppi1@gmail.com] On Behalf Of OmPrakash Muppirala
Sent: Wednesday, February 17, 2016 3:50 PM
To: users@flex.apache.org
Subject: Re: Issue with Spark DropDownList in 15.0

What happens when you set textArea.setFocus() in a callLater function?

Thanks,
Om

On Wed, Feb 17, 2016 at 3:18 PM, Jason Taylor <ja...@dedoose.com> wrote:

> noticing the following issue:
>
> - spark drop down list has a event handler for change
> - on change event handler calls spark TextArea.setfocus (guessing any 
> setfocus should trigger issue)
> - dropdownlist does not close
>
>
> Sample Application:
> <?xml version="1.0"?>
> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
> xmlns:s="library://ns.adobe.com/flex/spark">
>     <s:DropDownList id="fontDDL" width="150" change="OnFontChange(event)">
>         <s:dataProvider>
>             <s:ArrayList id="fontList" source="[Arial,Times New 
> Roman,Verdana,Trebuchet MS]" />
>         </s:dataProvider>
>     </s:DropDownList>
>
>     <s:TextArea id="textArea" width="100%" top="20" bottom="10"/>
>     <fx:Script><![CDATA[
>         import spark.events.IndexChangeEvent;
>
>         protected function OnFontChange(evt:IndexChangeEvent):void
>         {
>             textArea.setFocus();
>         }
>         ]]></fx:Script>
> </s:Application>
>
>

Re: Issue with Spark DropDownList in 15.0

Posted by OmPrakash Muppirala <bi...@gmail.com>.
What happens when you set textArea.setFocus() in a callLater function?

Thanks,
Om

On Wed, Feb 17, 2016 at 3:18 PM, Jason Taylor <ja...@dedoose.com> wrote:

> noticing the following issue:
>
> - spark drop down list has a event handler for change
> - on change event handler calls spark TextArea.setfocus (guessing any
> setfocus should trigger issue)
> - dropdownlist does not close
>
>
> Sample Application:
> <?xml version="1.0"?>
> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
> xmlns:s="library://ns.adobe.com/flex/spark">
>     <s:DropDownList id="fontDDL" width="150" change="OnFontChange(event)">
>         <s:dataProvider>
>             <s:ArrayList id="fontList" source="[Arial,Times New
> Roman,Verdana,Trebuchet MS]" />
>         </s:dataProvider>
>     </s:DropDownList>
>
>     <s:TextArea id="textArea" width="100%" top="20" bottom="10"/>
>     <fx:Script><![CDATA[
>         import spark.events.IndexChangeEvent;
>
>         protected function OnFontChange(evt:IndexChangeEvent):void
>         {
>             textArea.setFocus();
>         }
>         ]]></fx:Script>
> </s:Application>
>
>

Issue with Spark DropDownList in 15.0

Posted by Jason Taylor <ja...@dedoose.com>.
noticing the following issue:

- spark drop down list has a event handler for change
- on change event handler calls spark TextArea.setfocus (guessing any setfocus should trigger issue)
- dropdownlist does not close


Sample Application:
<?xml version="1.0"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark">
    <s:DropDownList id="fontDDL" width="150" change="OnFontChange(event)">
        <s:dataProvider>
            <s:ArrayList id="fontList" source="[Arial,Times New Roman,Verdana,Trebuchet MS]" />
        </s:dataProvider>
    </s:DropDownList>

    <s:TextArea id="textArea" width="100%" top="20" bottom="10"/>
    <fx:Script><![CDATA[
        import spark.events.IndexChangeEvent;

        protected function OnFontChange(evt:IndexChangeEvent):void
        {
            textArea.setFocus();
        }
        ]]></fx:Script>
</s:Application>


Re: swfobject call flash function

Posted by Alex Harui <ah...@adobe.com>.
Which browser are you using?  There are more and more browsers that refuse
to run scripts for local (file:///) content.

-Alex

On 2/18/16, 4:00 AM, "agm65" <ag...@gmx.de> wrote:

>Hi,
>
>thx for the answer. With this call i am getting the same error ->
>undefined.
>It works now but only on a server.
>
>thx
>
>
>
>--
>View this message in context:
>http://apache-flex-users.2333346.n4.nabble.com/swfobject-call-flash-functi
>on-tp11991p12015.html
>Sent from the Apache Flex Users mailing list archive at Nabble.com.


Re: swfobject call flash function

Posted by agm65 <ag...@gmx.de>.
Hi,

thx for the answer. With this call i am getting the same error -> undefined.
It works now but only on a server.

thx



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/swfobject-call-flash-function-tp11991p12015.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: swfobject call flash function

Posted by Andy Dufilie <an...@gmail.com>.
swfobject.embedSWF() has another parameter for a callback function to be
called when the swf is ready:

https://github.com/swfobject/swfobject/blob/2.2/swfobject/src/swfobject.js#L647

Sent from my Android
On Feb 17, 2016 15:17, "agm65" <ag...@gmx.de> wrote:

Hi all,

i have problens calling a function in my flash:

   var flashvars = {
            };

            var params = {
                allowScriptAccess: "always",
                wmode: "transparent",
                quality: "high",
                menu: "false"
            };

            var attributes = {
              id:"flash_movie",
              name: "flash_movie"
            };

swfobject.embedSWF("section_02.swf", "section_02", "100%", "100%", "9.0.0",
"expressinstall.swf",flashvars,params,attributes);


call:

document.getElementById("section_02").startAllAni();

or

document.getElementById("flash_movie").startAllAni();


always function undefined?






--
View this message in context:
http://apache-flex-users.2333346.n4.nabble.com/swfobject-call-flash-function-tp11991.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.