Local files for ads using html

Hello I am having a problem showing my ad on an andorid device using adobe flash cs5.5.  I have my app saved just in a folder on my desktop and it contains all the fla, swf, html, apk etc. I want to tryout ads so I signed up with admob and this reuqires the stageview class and html. So this is my code so far which doesnt work, simply all that happens is nothing shows up.
// imports
import flash.events.Event;
import flash.events.LocationChangeEvent;
import flash.geom.Rectangle;
import flash.media.StageWebView;
import flash.net.navigateToURL;
import flash.net.URLRequest;
import flash.events.MouseEvent;
import flash.filesystem.File;
// setup variables
var _stageWebView:StageWebView;
var templateFile:File = File.applicationDirectory.resolvePath( "ads.html" );
var workingFile:File = File.createTempFile();
templateFile.copyTo( workingFile, true );
var myAdvertURL:String = workingFile.url;
createAd(null);
function createAd(event:MouseEvent):void {
    // check that _stageWebView doersn't exist
    if (! _stageWebView) {
        _stageWebView = new StageWebView () ;
        // set the size of the html 'window'
        _stageWebView.viewPort = new Rectangle(0,0,480,80);
        // add a listener for when the content of the StageWebView changes
        _stageWebView.addEventListener(LocationChangeEvent.LOCATION_CHANGE,onLocationChange);
        // start loading the URL
        _stageWebView.loadURL(myAdvertURL);
    // show the ad by setting it's stage property;
    _stageWebView.stage = stage;
function toggleAd(event:MouseEvent):void {
    trace("toggling advert",_stageWebView);
    // check that StageWebView instance exists
    if (_stageWebView) {
        trace("_stageWebView.stage:"+_stageWebView.stage);
        if (_stageWebView.stage == null) {
            //show the ad by setting the stage parameter
            _stageWebView.stage = stage;
        } else {
            // hide the ad by nulling the stage parameter
            _stageWebView.stage = null;
    } else {
        // ad StageWebView doesn't exist - show create it
        createAd(null);
function destroyAd(event:MouseEvent):void {
    // check that the instace of StageWebView exists
    if (_stageWebView) {
        trace("removing advert");
        // destroys the ad
        _stageWebView.stage = null;
        _stageWebView = null;
function onLocationChange(event:LocationChangeEvent):void {
    // check that it's not our ad URL loading
    if (_stageWebView.location != myAdvertURL) {
        // destroy the ad as the user has kindly clicked on my ad
        destroyAd(null);
        // Launch a normal browser window with the captured  URL;
        navigateToURL( new URLRequest( event.location ) );
// setup button listeners
//createAdBtn.addEventListener(MouseEvent.CLICK,createAd);
//toggleAdBtn.addEventListener(MouseEvent.CLICK,toggleAd);
//destroyAdBtn.addEventListener(MouseEvent.CLICK,destroyAd);
the ads.html contains my admob stuff which is 100% correct. I know this because if I take out this piece of code:
var templateFile:File = File.applicationDirectory.resolvePath( "ads.html" );
var workingFile:File = File.createTempFile();
templateFile.copyTo( workingFile, true );
var myAdvertURL:String = workingFile.url;
and change it to just
var myAdvertURL:String = "mydomain.com/ads.html";
it works then and the ads show up, but when the html file is local and in the foldrer when I publish it nothing happens. I tried doing this technique which is all over google by copying it over to a temporary location, but no luck. Please if someone can help me that would be awesome!
Cheers

Anyone? Please help

Similar Messages

  • How can i make hyperlink to local file for dowloading

    How can I make hyperlink to a local file for downloading it, it seams that only www links work in web Ui.
    Thanks

    If we assume that you have a LabVIEW application running on your cRIO that is exposing some data through web services, there are a couple of possibilities.
    You can create a web service call that returns the log data. In order for the browser to treat this as a file, you must set the correct content type in the http header. To do this you can't use the default form of data output. Instead you must create an "httpRequestID" input to your web service VI. With this you can call "Write Response.vi" to give the log data and "Set HTTP Header.vi" to specify the type (text/text probably works for a log). You can look at "examples\comm\webservices\address book\FindContacts.vi" to see an example of calling these 2 VIs. Once you create that web service entry point, you can set that as the URL of the hyperlink control and it should work.
    Another option is to have the cRIO application write to a log file that is under the root of the web server running on the machine. (This is the same place the xap for your Web UI Builder application is put.) This file could then be served up through the web server just like any other file.
    With either of these solutions there may be concerns about the browser caching results rather than requesting new content each time. There are additional values that can be set in the http headers with the first solution that can help with this, but I think there is still some variation between browsers.

  • Where to apply credential file for ADS Licens in VA?

    Hi,
       I got a credential file for ADS License to use it in EP.Can any body guide me where to apply this file in Visual Administration and go further in ADS Configuration.
    with regards
    Pradeep.B

    Its not correct producure but u can try these
    Extract the zip file
    Goto -- tools -- internet options -- content -- Certificates -- import -- next --browse ur file -- give password -- now u can see expiry date here
    delete file after checking
    regards
    Krishna.

  • Help me out to get the jar files for FileUpload using MyFaces.

    hi,
    Can anyone help to get the jar files for FileUpload using MyFaces.
    I want myfaces-extensions.jar and commons-fileupload-1.0.jar.
    Thank you.

    you can't control the speed of a for-loop.
    you can remove your code from a for-loop and use a function to execute the code in your for-loop and you control how frequently you call the function.

  • I got a new computer, and now i cannot access the local files for my website (Dreamweaver)...help?

    I got a new computer, and now i cannot access the local files for my website (Dreamweaver)...
    the new computer is a Mac.
    I see the site on my computer files, but it will not connect with Dreamweaver on this new computer.
    can anyone help with this?
    thanks,
    Margaret

    no special characters...
    see if this gives you any info...

  • Cannot override codebase to use local files for first time installation.

    I have an application that is installed via a JNLP link. The application is about 200MB and we use a web start so that each time the application starts it checks for updates in the configuration and downloads them if necessary.
    I have a requirement to provide an offline installation on CD as some of our users have very slow connection speeds and it's taking over an hour to download the binaries.
    I am trying to do the install using the command line javaws -import -codebase <linktolocaldir> <linktojnlp>
    I need to use the jnlp on the sever so that the configuration files are checked and downloaded each time it starts.
    However the local codebase is never used - the dialog always says that it is downloading from the server, I can only get it to install from the local drive if I change the path directly in the JNLP (which is no good as I need to keep this path pointing to the server)
    Is there any other way to override the codebase for the initial installation?
    Any help much appreciated.

    Here are the guides I've used to do mine:
    How to use the Java Web Start CD-Install feature ? http://download.oracle.com/javase/1.5.0/docs/guide/javaws/developersguide/cdinstall.03.06.html
    Distributing a Java Web Start Application via CD-ROM http://blogs.oracle.com/CoreJavaTechTips/entry/distributing_a_java_web_start
    Distributing a Java Web Start Application via CD-ROM (same as above) http://www.java.net/pub/a/today/2008/07/10/distributing-web-start-via-cd-rom.html

  • Logo Kit help- how to prepare logo files for office use?

    Hi, I need assistance preparing ready-made logo files for our office owners to use. So far, I have the following that I've created in Illustrator:
    1. EPS files with Pantone colors for professional printing (publications, ads, brochures, business cards, etc)
    2. I converted the EPS files into RGB 72 dpi JPEG and GIF files (small, medium, and large sizes) for various online and digital uses (PowerPoint presentations, e-mails, online forms, social media pages, etc.)
    3. I also converted the EPS files into CMYK 300 dpi TIF files for in-house printing (in small, medium, and large sizes)
    #3 is where I need the most assistance. These files are for the office owners to import and arrange into their own publications that will be printed inside their own office. During the test run, I was notified of color variances that were happening- the logo files were being inserted into Word documents that were then converted into PDFs. In a few cases (when the document was saved as PDF, or exported as a PDF in the print preview), the colors appeared pretty accurate (at least on screen, they were not printed) but in a case when the document was being exported as a PDF in the Adobe Standard Add-on, the colors were very off (appeared much more vibrant). During researching the issue, I am starting to lean on provided these types of files with RGB colors (especially if they will be using them in Microsoft Office). Let me know if this is correct - I am still a bit confused though, since I've always thought that files that are to be printed must be in CMYK, not RGB.
    How should I be preparing these types of files?
    Thanks!
    Also, any quick tips for the EPS or online RGB file preparation when saving? I made sure to embed colors in the RGB files for color consistency within browsers. For the EPS, I made sure to embed fonts. Anything else I should be keeping my eye out for?

    if the color conversion would be accurate to the original that way.
    If you worry about that in the context of using Office apps, you might as well shoot yourself or jump out of the next window. You simply won't know and unless they work on calibrated monitors and printers (which is extremely unlikely) your precautions with embedding color profiles and all that mean pretty much nothing. The same for your web stuff - unless there is an active monitor color profile on the system, browsers won't do any color management. That's even more the case for mobile devices. So in summary, you can really only output it based on your calibration and hope it matches their systems and a standard sRGB profile reasonably well.
    Mylenium

  • How to copy a page webpage into a local file (for eg C:\\file.doc)

    Hello all,
    i wrote a programm code which can get my system information (date,tomcatversion,jdk version, server name and version and ...)
    if navigate to the url (on my localserver) htt://localhost/pp/version.jsp i would see all this in formation but how can i copy them into to a local file?
    i can create the file with: FileWriter fw = new FileWriter("C:\\file.doc");
    and copy this information line by line with:
    fw.write("Application server name and version:");
    fw.write(application.getServerInfo());
    fw.write("\n");
    But if i write fw.write(new java.util.Date()) // for the system date/time it doesn't work also fw.write(java.util.Date()) ) or fw.write(Date())
    or Date da = Date() and fw.write(da) no result...
    import are:
    <%@page import="java.io.*" %>
    <%@page import="java.util.*" %>
    please help....

    thanks !! what does this means ? It is possible or no yes yes i need i syntax or an example ... i'm new in java :)

  • How can I export songs with full info (INCLUDING LYRICS) to file for future use? [x]

    Hi everyone,
    I got my new iPod touch 4th gen, and I spend literally all day to edit songs' info like Artist, Lyrics, Album... with like thousand songs.. Then I've tried to export them fully for future use as back up, but I could not find any option to do so. Exporting library and playlist only saves info for basic tags but no lyrics in it. So what should I do? I've tried iTunes Export and mp3Tag but I still could not do it.
    I would appreciate much any help for me to back up full information of songs for future use.
    Regards,
    [x]

    Thanks for the responses.
    I forgot to mention the dimensions I need the file to be at, sorry. Overnight Prints requires that the uploaded file be at 2.13 inches wide by 6.13 inches high (or 638 by 1838 pixels) at 300 dpi. I think I understand what Scott Falkner means by pixels are not a unit of measure. However, I have been using inches in Illustrator, with the file being set to the height and width (in inches) required by Overnight Prints.
    Here is what I have uploaded to Overnight Prints so far:
    - Illustrator file set to 2.13 inches wide by 6.13 inches high – Upload preview on Overnight Prints is correct size, but shows the bookmark as pixelated/blurry.
    - Saved above Illustrator file as copy: “Press Quality Preset” PDF – Upload preview on Overnight Prints is correct size, but the bookmark is still pixelated/blurry.
    - Exported same Illustrator file as a PNG (638 pixels wide by 1838 pixels high - 300dpi) – Upload preview on Overnight Prints is correct size, but shows the bookmark as pixelated/blurry.
    - Creating an Illustrator file at 638 by 1838 pixels makes any file that is uploaded preview on Overnight Prints as too large, but not pixelated/blurry (I think I now understand why, just covering all my bases).
    So, I guess my more specific question would be:
    How can I create a file that I can upload to Overnight Prints (TIF, PDF, JPG, EPS, PNG, or AI) that ends up at the dimensions (in inches) required, while not appearing (at least in the upload preview) as low resolution (pixelated/blurry)?
    Thanks in advance for any responses (especially to such a novice question).

  • How to search a .csv file for data using its timestamp, then import to labview

    Hi, I'm currently obtaining density, viscosity and temperature data from an instrument, adding a timestamp and writing it to a .csv file which I can view in Excel. This works fine (see attached code) but what I need to do now is to search that csv file for data which was obtained at a certain time, import the temperature, density & viscosity values at this time back into Labview to do some calculations with them, while the data acquisition process is still ongoing.
    I've found various examples on how to import an entire csv file into labview, but none on how to extract data at a specific time. Also, whenever I try to do anything with the .csv file while my data acquistion VI is running, I receive error messages (presumably because I'm trying to write to and import data from the .csv file simultaneously). Is there some way around this, maybe using case structures?
    If you need to know my skill level, I've been using Labview for a few weeks and prior to that have basically no experience of writing code, so any help would be great. Thanks!
    Solved!
    Go to Solution.
    Attachments:
    Lemis VDC-30 read registers MODBUS v5.vi ‏56 KB

    It sounds as if you are going about this a little backwards writing to a data file and then extracting from the file but its the weekend so I can't think of an improved way to do it at the moment. 
    Searching for a specific time with those specific values is quite easy, or if you wanted to select any time then you could interpolate the values to find any value that you want (This is where the contiguous measurement comes in, as you have readings at discrete times you will have to interpolate the values if you want to get the 'measured value' at a time point that is not exactly one of your measured points).
    If you can extract the TDMS time column and the T, D & V then simply thresholding and interpolating each of your array/data sets should allow readings at your desired times.
    Attachments:
    Interpolate.png ‏301 KB

  • GetAppletContext().showDocument() won't show local files for some people

    Hi,
    I have a reporting function that creates a pdf and stores on the users computer in the local temp drive and then displays the created pdf in a new browser window. Everything works fine except for some users it won't show local files. This is a signed applet and everyone has the same policy file. I can't work out why it works for some users and not for others, there doesn't seem to be a pattern in o/s, configurations etc. When i run the code locally on tomcat it works for me but when i upload to server it doesn't. There is no error message either. The pdf is definitely being created as well as you can check it in the temp directory. Code is below:
    void btnReport_actionPerformed(ActionEvent e) {
    try {
    String args[] = {"-pdf"};
    File f = File.createTempFile("SCReport", ".pdf");
    FileOutputStream fos = new FileOutputStream(f);
    JCPrinter printer = SCPrintManager.getPrinter(args, fos);
    if (printer == null) {
    System.out.println("Printer is equal to null");
    // What has been selected?
    SCReport report = new SCReport(printer);
    Vector vectSubConsultant = createVectorFromScreenInfo();
    if (vectSubConsultant == null)
    return;
    report.addSectionForSC(vectSubConsultant, true);
    SCPrintManager.printDocument(report.getDocument(), printer);
    printer.getOutputStream().close();
    URL reportURL = f.toURL();
    URLConnection con = reportURL.openConnection();
    ReDirector().getAppletContext().showDocument(reportURL,"report");
    catch (Exception ex) {
    System.out.println("Error producing report");
    ex.printStackTrace();
    }

    Did you have any luck? As I am trying to do the same thing...

  • "dtutil", how to tell which configuration file for packages using after deployment?

    Hello All, 
    Trying to achieve this feature, 
    Using DOS command to automatic my deployment process--glad I found dtutil. However, it doesnt give you any chance to identify which configuration file to be used by SSIS packages after deployment.
    Deployment Method: file deployment
    Configuration sued: XML file and SQL Table. IN XML file, it tells which DB connection for packages to look up the configuration table.
    Who can share some thoughts on this?
    Derek

    It is NOT about sequence.
    It is about how to point which configuration file to be used by deployed packages as during the "dtutil.exe"
    deployment, you dont have chance to identify which physical location confg files to be used.
    Derek
    That you do only at the time of execution of packages. By default it uses configuration settings created at design time within the package. If you want to override it, you can use \Configfile switch of dtexec for that. You can also set explicit values for
    properties using /SET switch
    http://technet.microsoft.com/en-us/library/ms162810(v=sql.105).aspx
    See this to understand how configs are applied in runtime
    http://technet.microsoft.com/en-us/library/ms141682(v=sql.105).aspx
    and this to understand behaviour difference in ssis 2008 
    http://technet.microsoft.com/en-us/library/bb500430(v=sql.105).aspx
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Converting sequence or QT file for Web use

    I have a short 13-minute sequence that I need to convert to a QT file in order to then convert to flash for posting to our Web site. I've done this multiple times today with no luck in reducing the file size. By exporting using Quick Time Conversion, using my default settings for compression (H.264) type, the file size of the final .mov file was 200-some MB. After changing my settings to a lower quality final product, I now have a file .mov that is 2GB!?
    I have several files that I'll need to convert QT files for posting to the Web. The lengths range from 5 minutes to an hour.
    Can anyone give me any kind of advice on the best way to convert to a QT file resulting in a smaller file size? If I am making something very simple, very difficult, please lend your thoughts!

    Hi there,
    FCP may estimate unusual time remaining but usually that estimate is not accurate. When I export to H.264 very often it appears that FCP hangs on 7% but thing is it eventually will encode within 15 minutes. Circumstances change from case to case (machine specs, length of movie, export settings).
    Set an IN and OUT on a portion of your timeline and export again to test quality and the time your machine require to encode.
    G.

  • Where can I find locale file for hu_Hu?

    Hi,
    I have to develop some page in Hungarian but my original flex 4.5 doesn't have the necessary files.
    Here the error when i set "-locale hu_HU" in in flex compiler page :
    Description
    Resource
    Path
    Location
    Type
    unable to open 'C:\Program Files\Adobe\Adobe Flash Builder 4.5\sdks\4.5.1\frameworks\locale\hu_HU'
    MyProject
    Unknown
    Flex Problem
    Could someone tell me where I can find the missing files for the Hungarian language?
    Is my approach correct or I need to do something else?
    Thanks
    Andrea

    dial the customer-service number~

  • Import/export of files for Quickoffice using an USB cable

    Installed Quickoffice App, but cannot import/export files. Windows Explorer recognizes only photos and iTunes does not show office files on iPod and does not tolerate pdf, doc or ppt files from PC.

    Thank you, lllaass,
    this is the way to upload/download files from iPod using USB cable, but it does not work in my case. Following advices of the Apple customer service I have reinstalled iTunes, updated the iPod software and even deleted/reinstalled the Quickoffice app again, but it did not help. In the iPod/Apps menu I see the app thumbnail, but no File Sharing section appears, so I am unable to copy/extract files through the cable. I can do it via WLan, but it is completely impractical, as I do not have any wireless connection at work. It is amazing how poorly compatioble can be non-Apple apps.

Maybe you are looking for

  • Photoshop CS3 crashes when I try to deactivate it

    I will deactivate and delete Photoshop CS3 (10.0.1 German) and then install Photoshop CS5. I use Mac Pro Early 2009 and Mac OS 10.6.3 (German). When I start the deactivation (menu help) Photoshop crashes directly. I have start the Mac with Shift-Key;

  • Erratic behaviour of Manual Lens Correction in Develop Module

    64 bit Windows 7 Sometimes - not always - using the manual lens correction, with Constrain Crop activated, leads to the image jumping around very quickly and erractically and it being impossible to achieve fine control using the mouse: tiny movements

  • V2 Flash components unsupported in Director?

    Page 11 of http://www.adobe.com/support/director/flash_8_asset_xtra.pdf states that v2 Flash components are unsupported by the Flash Asset Xtra. What exactly does this mean, particularly when all the built-in Flash components are v2 components, aren'

  • TWO computer sync on Creative Zen

    !I just got a replacement Zen from Crtv. I have a work computer, and a laptop for home/travel use. ) I only want to sync what I direct manually onto the zen, that said, CAN I use both computers to add/delete music depending on where I am, or does it

  • How to recreate the portal inbuilt preferences

    Hi All, I have a problem when i want to edit the group. I m getting following error.... Not Foun Path : 'oracle.portal.style' Name:Default(51002) whether the preference path has been deleted from the portal???? if yes then how to recreate the prefere