Using addEventListener for Enter and Exit frame

hi , sometimes i want to set some function in specific frame in start and exit this frame
for example i have Flv player in frame 20 , i have background sound ( mp3 player ) so i want when swf goes to this frame my sound goes Off and when Exit from it and go to another frames the sound played again ...
i put these script in frame 20 :
addEventListener(Event.ENTER_FRAME,enterfunc);
function enterfunc(e:Event):void {
    trace("I started");
addEventListener(Event.EXIT_FRAME,exitfunc);
function exitfunc(e:Event):void {
    trace("will Exit");
but after test movie i see I started and will Exit runs Repeatly without stoping !!
Notice : first i put my sndChannel = soundClip.play; and sndChannel = soundClip.stop;  but my music runs over and over and finally my system Hanged and need to Restart so i use trace to see
so whats a problem ?  thanks for spending time and help me

kglad wrote:
// in frame 1:
function f():void{
trace("function f is executing when the playhead is in frame:", this.currentFrame);
// in frame 2:
f();
This works well For Excute Function on entering Frame Once !! thanks ...
but Only 1 More Question :
as You told me in your No.2 Replay :
I try to add some movieclip with instance name Or FLv playback with instance name and then Try to use this codes :
mymc.addEventListener(Event.ADDED_TO_STAGE, addedF);
function addedF(e:Event):void{
trace("I Start");
mymc.addEventListener(Event.REMOVED_FROM_STAGE, removedF);
function removedF(e:Event):void{
trace("I exit");
why The removedF function Works well and the addedF function not work ?!?   in fact nothing Happend on Enter This Frame but on exit i see my I exit Trace !!

Similar Messages

  • Profiler API - Locks, Threading.Monitor.Enter and Exit

    I'm using the Profiler API in a project in order to track the locks made using Monitor.Enter, Monitor.Exit, and the lock keyword. I planned to do this by outputting using a pipe, the events from the FunctionEnter3WithInfo and FunctionLeave3WithInfo callbacks.
    These callbacks are called when methods are entered and exited, and appear to be functioning fine regarding their implementation - they generate a large output of methods that had been entered and left, but I'm not receiving callbacks for the following:
    ENTER: Monitor.Exit
    LEAVE: Monitor.Enter and Monitor.Exit
    Oddly enough, I do get receive a callback for entering Monitor.Enter. Other than these problematic methods, I appear to be getting calls from the Profiler API for everything else. 
    Is there a known issue regarding these methods not being reported by the API? 
    Alternatively, if there's a better way of achieving my goal than the way I'm doing it, feel free to point me in the right direction :)
    Thanks,
    Olu

    Thanks for the reply Brian,
    I don't get a JITInlining callback for Monitor.Exit (however I do for some Monitor.Enter calls). For FunctionTailcall3WithInfo, I also don't get a callback for Monitor.Exit (but I do for some Monitor.Enter calls).
    I'm not getting anything from ExceptionUnwindFunctionEnter, though when manually tested by throwing an exception within a try-catch, I get a callback.
    If it helps, I have the following flags set for events:
    COR_PRF_MONITOR_ALL
    COR_PRF_ENABLE_FUNCTION_ARGS
    COR_PRF_ENABLE_FUNCTION_RETVAL
    COR_PRF_ENABLE_FRAME_INFO
    Additionally, I've tried the following flags to see if it resolves the issue:
    COR_PRF_DISABLE_INLINING
    COR_PRF_DISABLE_OPTIMIZATIONS
    Edit 1: Using COR_PRF_DISABLE_OPTIMIZATIONS now means I get a callback to FunctionLeave3WithInfo when Monitor.Enter leaves, however there is still no sign of Monitor.Exit
    Edit 2: As a test, in the small application that I'm profiling, I've wrapped the Monitor.Exit and Monitor.Enter method calls in another class, so I can call them as so:
    CCMonitor.Enter(obj) and CCMonitor.Exit(obj).
    The profiler reports both the enter and leave of these functions correctly.
    Thanks,
    Olu

  • I just installed the latest version of iTunes, but when I went to open iTunes I got a message saying registry settings used to for importing and burning CDs and DVDs are missing and I should reinstall iTunes.  Really?

    I just installed the latest version of iTunes, but when I went to open iTunes I got a message saying registry settings used to for importing and burning CDs and DVDs are missing and I should reinstall iTunes.  Really?

    I'd start with the following document, with one modification. At step 12 after typing GEARAspiWDM press the Enter/Return key once prior to clicking OK. (Pressing Return adds a carriage return in the field and is important.)
    iTunes for Windows: "Registry settings" warning when opening iTunes

  • Using ps2 for years and today it tells me my 30 day trial has ended? I can't seem to find support or the re activation on line site. What's going on?

    Does Adobe have a phone support option? I have been using ps2 for years and today the program tells me that my 30 day trial has ended . . .can any one help with this issue?

    The activation servers have been shut down.  Go here for a version which does not require activation, just enter the serial number that you will be given:
    Download Acrobat 7 and CS2 products

  • I have been using Safari for years and have always kept it on "private." Starting two days ago, I suddenly found myself unable to log onto my blog and many other sites that I normally log onto when private is set. Why?

    I have been using Safari for years and have always kept it on "private." Starting two days ago, I suddenly found myself unable to log onto my blog and many other sites that I normally log onto when private is set. This so annoying, I just switched to Firefox. I don't like Firefox nearly as much as I like Safari. What is happening? How do I fix the problem?
    Thank you.

    Might be a corrupted database ...
    Open a Finder window. From the Finder menu bar click Go > Go to Folder
    Type or copy paste the following:
    ~/Library/Caches/com.apple.Safari/Cache.db
    Click Go then move the Cache.db file to the Trash.
    Quit and relaunch Safari to test.

  • I've been using Mozilla for months and now when I click on icon nothing happens. How do I correct this?

    I can't get Mozilla to open in order to connect to the internet. I've been using it for months and just yesterday it wouldn't open. I tried to uninstall it to reinstall it but that didn't work. First it kept telling me that Moozilla was still open so I shutdown the computer. I was able to download the latest version, however, it still will not open a web page once clicked upon.

    Hi dmra1964,
    You might want to take a look at [[Firefox is already running but is not responding]] and [https://support.mozilla.org/en-US/kb/Firefox-not-start Firefox won't start]. Both of those articles provide a lot of good troubleshooting information.
    Hopefully this helps!

  • I have 2 auxillary disk drives for my MacBokk Pro. Time Machine uses one for backup and I use the other for storage, but I am unable to create a new folder or drag and drop files or folders to the aux drive.

    I am unable to create a new folder on either of my auxillary disk drives.  I can access the files and folders that were there when I transferred one of the drives from a PC.  Time machine uses one for backup and I want to use the other to store photos which are large files.  An help would be appreciated.

    Thanks for the reply.  If I reformat the drive will I be able to access the files on it from the MAC.  I do not share the drive with a PC.  The files were originally created on a PC which I no longer use.  I do want to continue to access the files put there by the PC.  I would like to not have to copy them over to the MAC hard drive just to use them.  The second aux drive is new and works fine because it was formatted by the MAC.  I can drag and drop files there and work with just as if they were on the internal drive.

  • Use airport for internet and ethernet for local?

    Hi. Ive searched around and cant find an answer for this.
    I have a 27" imac connected to my router and all works fine for accessing the internet.
    I have several other devices close by that I want to connect via ethernet. If i connect the imac to another router via ethernet I can browse my local devices but loose internet connectivity. It is as if the imac will suspend the airport connection while the ethernet cable is connected. I don't want my second router to act as a bridge as it doesn't support N speeds.
    Essentially, I want the imac to use airport for internet and the ethernet port for local files.... The only workaround I have is to unplug the ethernet cable from the back of the imac when i want to use the internet. I'm hoping it's just a DNS issue, but cant seem to resolve it.
    I do not need internet connectivity for the other devices and don't see how i can do that without enabling the wireless side of my second router and then creating a bridge...
    Any suggestions?

    It is as if the imac will suspend the airport connection while the ethernet cable is connected.
    The Connection Order on your iMac is set so that if both AirPort and Ethernet are "on", the iMac will give priority to the Ethernet connection.
    If you want to configure your iMac so that it gives priority to an AirPort connection if both AirPort and Ethernet are "on", give this a try:
    Open System Preferences (gear icon on the dock) and open Network
    Click on the small gear icon at the bottom of the connection list on the left
    Click on Set Service Order and drag AirPort to the top of the connection order list
    Click OK, then click Apply
    Now, if both AirPort and Ethernet are active, your iMac will give priority to the AirPort connection. If you want to connect using Ethernet, you will have to turn AirPort off by clicking the fan shaped AirPort icon at the top of your computer screen.

  • HT5824 I've been using numbers for iPad and I accidentally deleted a column. And the auto-save feature saved that and now I can't undo it. Does iCloud storage have backups of saved files from like 10 minutes ago? I have number

    I've been using numbers for iPad and I accidentally deleted a column. And the auto-save feature saved that and now I can't undo it. Does iCloud storage have backups of saved files from like 10 minutes ago? I have numbers synced to iCloud.
    I tried to undo it but the app crashed.
    I am hoping there's like a previously saved version of my file in iCloud somewhere. 

    No, iOS does not do short term incremental back ups to iCloud such as you get with Time Capsule.It backs up when you do soo manually, or if set properly, when the device is plugged in and connected to WiFi. It will not have saved your changes as of 10 minutes prior.

  • Why doesn't SAP use SAPUI5 for this and that

    This is my personal opinion about this topic! Again and again I stumble about this and now I want to share some of my thoughts about this topic. I want to share this from a point of view, when I was not a SAP Employee - I worked at a SAP Partner company - because this best reflects the view from the outside.
    1. SAP "wants" us to use SAPUI5
    I don't think that "wants" is the right word - the right word is offers! In terms of: hey now even included in your license and open sourced (because you wanted it so). Look - we build sooo many Fiori apps with it - and put in some great enterprise features (right to left, accessibility, translation, ...) and it is responsive. So if you want to build Fiori-like "apps" - there you go - this is your technology to go! This is what I understood.
    I was very very very happy that it was build with open standards. But the main point for me another thing - (because I worked with Sybase Unwired Platform and SAP Mobile Platform) OMG an open data protocol!!! OData FTW! I could use ANY front-end technology and consume SAP data - the protocol is REST based - a dream came true. And so I did - yes I played around with Sencha Touch and OData, I used data.js and used it in a standard HTML5 application. We played around with an iOS application we already had and consumed the data. I feed the data into d3.js. I prototyped around with SAPUI5 and I have build apps with it. Brilliant, so I could choose whatever UI technology I wanted.
    I always had the feeling, that SAPUI5 was meant for B2E applications - and building many of that - and they should look and feel the same and I can theme the apps. I can use it when I want to make my applications SAP like - so that the user thinks the apps are all the same and everything fits nicely into the Fiori launchpad - great if you want to build partner apps. In my ex company we won a SAP Pinnacle Award - for a native iOS app, no SAPUI5 in sight - but we have received an award, so SAP did not "want us" to use SAPUI5 ;-)
    2. Is it the right UI technology for everything?
    At my ex-company I was dealing with mobile applications and web apps. I always knew that I get the best user experience when I write a real native application and if you want it to look like in a very specific way with awesome UI --> you would not do it with a write-once-run-everywhere HTML5 super-styled wrapped (phone gap/cordova) app - you would write the apps for the specific platform and it should feel like it was written for the platform. SAP offered us the SAP Fiori Client that I could enhance the user experience for the Fiori apps, but I was never told to use SAPUI5 it for everything.
    The same discussion goes on with: why was the new SAP website not build with SAPUI5, or the UX Explorer (eat your own dog food), or a useful internal app - why Angular, or the other way around why do we even use SAPUI5 and not Angular JS itself. Back to the past - SAP did never tell me to build a website with it, or to build something tiny and small with it (a widget) - or to enhance parts of a website with it - or to build something super-specific with it.
    And yes maybe the UI in a mobile app was not SAPUI5 but do you know if it uses Gateway with OData or the SAP Mobile Platform, was the API managed with Apigee, was HCI involved in getting the data from different sources, was it maybe wrapped with SAP Mobile Secure, did it maybe use a HANA backend or some of its features (predictions, text analytics, ...) - are some backend parts maybe hosted on HCP - who knows? So yeah, maybe other SAP technology was involved which you don't see, but in the end it made your life simpler.
    Instead of arguing around why this and that was used for this and that - can we save our energy and instead look at the result - which is all what counts - that it was the right UI technology with the right user interface which makes the user happy? I stated something like - does Google use AngularJS for everything? Nope. They offer us something great we can use. Right, maybe AngularJS is not as important for Google like SAPUI5 is for us. But we have something with which we can build our day-to-day business apps with and we do so.
    3. We missed great opportunity in not using SAPUI5 for this and that
    Let's think about how projects are going: you want something, you look at the costs, you choose most efficient option. Yes this could mean reusing an existing native application which was written long ago and you pimped it up. Or you had outsourced it to a company which wrote a similar app. Or you bought the source code. Or you have some cheap internal staff which could do it (students, trainee), or you could outsource it cheaply. Or all you have is people with experience in this and that technology. Or it must look in a very very specific way (because marketing says so) and you go native. Or it maybe should even differentiate itself and should look NOT like a Fiori app. And no - I don't think - this is my employees view - we are not for example an event app producer. We normally build business applications. And I don't think that we can write an app from scratch "just" for an event in a certain technology. Yes it would be nice if this and that would use SAPUI5, I think if it would be possible in terms of time and costs and UI wishes and hundreds of other factors we would do it with SAPUI5.
    Working at the partner SAP showed me over 50 Fiori apps, now hundreds of Fiori apps are released. SAP now showed that SAPUI5 is going big with S/4HANA. We have seen the Simple Finance solution. I was walking around at the CeBIT this year and I was impressed myself which cool apps and screens have been shown with SAPUI5. I used the SAPUI5 app on a Samsung Smart Watch myself. The SAP Web IDE itself is built with SAPUI5 in its heart. I don't need any other "proves" that SAPUI5 is great. I have seen great use cases for it, but I also know myself when I would use other stuff.
    4. My conclusion
    There is never every anything which can cover all different use cases. One-size-fits-all clothes also does not fit for everyone even if it says so. If someone creates something great don't judge it by the UI technology. Judge it by the experience and the value it creates. There are reasons why this and that was chosen. Use what fits your needs best with your requirements. Make the end user happy!

    Hey Denise,
    Thanks for pulling this discussion into SCN. Makes it much easier to discuss compared to Twitter. But I also have to apologize in the beginning that my answer now exceeds 140 characters by 50 times.
    Let me share my thoughts and personal opinion as well. I will try to look at it from a strategic point of view, as you – as the technical UI5 expert - have already covered the technical perspective.
    SAP recommends using SAPUI5 where it fits to customers’ requirements
    Let me begin with a clear statement from my perspective: It makes no sense that SAP takes customer decisions.
    Of course, customers expect SAP to help them with their strategies and decisions and of course we are helping. But at the end, the decisions have to be taken by the customer who needs to take the specific conditions of the company into account. The most important condition in the context of UX is the end user. But we shouldn't forget the business strategy as the most important influence factor. I’m not saying that technical decisions are completely unimportant, but I would like to point out that other things are more important for a company.
    As a result, it wouldn't make a lot of sense if SAP would just want every customer to use SAPUI5. To me, customers need recommendations leading to solutions that satisfy their needs and requirements.
    There is not that one UI technology that serves all needs
    This headline might be a challenging statement and I can already imagine reactions to it. But in fact I can confirm this sentence easily. You always have to combine different technologies. Some of them are from SAP others not. The selection and combination of these technologies is different from customer to customer because the requirements are different. There are still reasons to use Web Dynpro ABAP and I’m still recommending SAP NetWeaver Business Client, POWL (Power Lists), WDA Chips, FPM based on the given environment of the customer. And obviously there are also reasons for UI5.
    SAP already proves the usage of SAPUI5
    In general, I see two different use cases here: Developing custom applications vs. adopting applications from SAP.
    In the one case, customers want recommendations on development environments and UI technologies that consider their development requirements and existing conditions (e.g. existing skills, given implementations). SAPUI5 is a great UI technology and there are some special aspects that make the decision obviously easy. If I want to create simple business applications that can be connected with my SAP system easily, especially in combination under responsive conditions on multiple devices and targeted for casual and/or occasional users UI5 might be the right choice for many.  Exactly this pattern is what many customers are searching for these days. So, the recommendation for UI5 comes quite often.
    Whether or not SAP proves the usage of SAPUI5 in their own world is to me more connected to the use case where customers want to adopt SAP applications. And in deed, SAP is using SAPUI5. There are hundreds of SAP Fiori applications that have been built with SAPUI5 and there have been a lot of other applications developed using SAPUI5, too. And again, there is a huge need for applications for casual and/or occasional users, so that’s a big reason for SAP to create such applications.
    Websites vs. Business Applications
    This discussion was triggered by some statements in twitter, that SAP sites such as sap.com, SAP UX Explorer or the latest mobile conference app are not developed using UI5. Actually I see these to be websites but not business applications. I have never told a customer to build a website in UI5 and I would continue to do so.
    Maybe we need to discuss the difference between a website and a business application. I guess it is not easy to find a common understanding here, as the borderlines between several worlds have disappeared in the last years.
    Some years ago it was more or less easy to differ between:
    Native desktop applications running on a specific desktop OS
    Native mobile applications running on a specific mobile OS
    Browser-based applications running in specific browsers
    Websites, basically running on many browsers
    In the first three categories we saw business applications. 1 and 2 were selected especially when specific functions of the device and OS where needed to be accessed (for example the camera of the mobile device, the fast rendering capability of the desktop). 3 was also used for business applications but in most cases on desktop browsers.
    Today, one can develop browser-based applications that look like native applications and even can access the devices like native applications. Responsive design breaks the borderlines even more. Now, browser-based content can be rendered perfectly on a desktop browser as well as on a mobile phone and a user might even not be able to judge whether it was originally intended to be developed for the one or the other.
    So maybe there is no big difference anymore between websites and browser-based applications. But there is still a difference between browser-based applications and browser-based business applications, where additional requirements such as integration into business systems are drivers. Here I see SAPUI5 as a very cool UI technology.
    That’s just my 2 (personal) cents,
    JJ

  • Can i use cdma for internet and gsm for phone at a time in Iphone4s?

    Can i use cdma for internet and gsm for phone at a time in Iphone4s?

    No. Phones sold by GSM carriers can't access CDMA at all and phones sold by CDMA carriers can only access GSM if they are a) unlocked and b) in an area where there is not CDMA.
    Best of luck.

  • Hello hi, i just won't to ask, if there has been any changes on how to find a stolen phone, did some one come up with a fare and good solution. as it is not fare at all when some one could use it for free and there is a lot of things could be done to this

    hello hi, i just won't to ask, if there has been any changes on how to find a stolen phone, did some one come up with a fare and good solution, new Apps. as it is not fare at all when some one could use it for free and there is a lot of things could be done to this condition, no one seem to care,
    i have a story about my sister, am talking on her behalf, she got stolen her phone at a caffee when she just come from a horeble exam, she was very mad and having haedace for not doing well at the exam, i ask her if we could have coffee before we go home, once she sate; while i was getting the coffee for her, some one snicked to her pocket and took the phone, immidatly she feelt it and went on to searching, but nathing was hopefull. what makes it more heart braking is that she worked day and night just to buy the phone and pay for her books and so on as a student. she use to work 16 houres a day before she had to start school. 8 houres in one place and then to the other place. and she was always demanding for more houres to work; one day her boss saw her on her other job and she was serprised to see her and saied OHhh my God Milly if you work like this, i wonder if you servive, how could you also ask for more houres, My sis had to do it she has no parents or any thing, well the phone was taken after only two months of having it. the sad thing is she stile dream having it even though she can't think of buying againe. well me i have tryed a lot of things but i know some were out there there is a solution for people like this, it is not always fare for some one who has payed up to 800 to just loose his ......  
    Thnks

    I'm sorry, but your sister, unless she had already turned on the "Find my iPhone" feature and the person who took the phone has not disabled it, is out of luck. She should report the theft to local police authorities, including the serial number of her iPhone. While her experience is unfortunate, there are good reasons why Apple cannot do anything else about it.
    I hope she gets her phone back.
    Best of luck.

  • Firefox will not access the internet. I have used Firefox for years and the past week I have not been able to get on the internet??? What is the problem. My interent works as I get email and can iuse Internet Explorer to access.

    Firefox will not access the internet. I have used Firefox for years and the past week I have not been able to get on the internet??? What is the problem. My interent works as I get email and can iuse Internet Explorer to access

    Which version of Firefox are you using?
    See
    * https://support.mozilla.com/en-US/kb/Firefox%20cannot%20load%20websites%20but%20other%20programs%20can

  • I cannot afford an iMac, can anyone recommend a widescreen Monitor for my 15" MacBook Pro.  It would be used mainly for iPhoto and Aperture.

    I cannot afford an iMac, can anyone recommend a widescreen Monitor for my 15" MacBook Pro.  It will be used mainly for iPhoto and Aperture.  TF

    Pair a wireless KB with the laptop and all should be well when you attach the laptop to the iMac and invoke TDM. But as Denny mentions, it does seem like the waste of a good iMac to use it in just this configuration. Why is the laptop primary?

  • I went on iTUnes after not using it for awhile and all my playlists are gone. How can I find them?

    Hi Apple community ---
    I went on iTunes after not using it for awhile and my old playlists are all gone.  My library seems intact, but I don't have a record of  my playlists, except for what's in my iPod.  I'm afraid to sync them to get the playlists back into my computer, becuase the last time I synced my iphone it erased all my contacts from both my iphone and my computer, and I don't want the sync operation to remove the playlists from the iPod as well. 
    I don't have any music on my iPhone, so the two devices in question are just the iTunes program on the computer (it's a Dell with Windows Vista) and my 160 GB iPod classic. 
    Thanks for your help!!!
    Doc E

    This post may be a clearer place to start...
    tt2

Maybe you are looking for

  • Ipad 7.0 Music Playback-No Fullscreeen Art in Landscape?

    I use my Ipad 2 in the car..dashboard mount. Docked to radio. Due to size I can't portrait this. In IOS6 and earlier, I had no problems playing my music/playlists. Due to the way it ran, I'd have it playing and it'd be doing the full-screen artwork.

  • 0IC_C03 - some key figures have unassigned Store location

    Hi, I try to implement Inventory managment scenario in BW.I follow the How to document How to handle inventory management scenarios in Bw. Now I uploaded data to BW, the sume of key figures as general look good but I have problem with key figures,whi

  • Videos missing cover art iOS 8

    Ever since upgrading to iOS 8 my videos have lost their cover art. They show up in iTunes and I have re-added them a few times, but no videos ever have cover art on my iPhone 6 Plus or iPad Mini with Retina. Both are running iOS 8.0.2. Anyone figure

  • Retina MacBook Pro Wifi Issues

    Hey guys, I just got my rMBP today and the wifi is terrible on it. I have the 2.6, 16gb, 256gb ssd model with mountain lion. For some odd reason, when I'm at home my wifi connection constantly drops. I'm using a cisco WAP4410N AP, if that helps at al

  • Why did I have to enable Windows File Sharing to share files between two Mavericks iMacs?

    File Sharing failed between my Mavericks iMacs.  The console logs showed that the target iMac saw the ntlmv2 protocol as unknown to the kdc.  I fixed it by enabling Windows File Sharing on the target Mavericks iMac.  I had tried disabling SMB on both