Search Results

Search found 6730 results on 270 pages for 'loaded'.

Page 39/270 | < Previous Page | 35 36 37 38 39 40 41 42 43 44 45 46  | Next Page >

  • Why would I use Assembly.LoadFile in lieu of Assembly.LoadFrom?

    - by Cheeso
    It's my impression that Assembly.LoadFrom uses the ApplicationBase and PrivateBinPath. It also my impression that Assembly.LoadFile does not. Why would anyone want to use LoadFile? In other words, if my understanding is correct, why would anyone want to NOT use the ApplicationBase and PrivateBinPath? I'm working with some existing code, which uses LoadFile, and I don't understand why it would do so. LoadFile apparently does not load dependencies from the same directory. The LoadFrom method does load dependencies (From the doc: The load-from context...allows dependencies on that path to be found and loaded because the path information is maintained by the context.) I'd like to convert it from using LoadFile, to use LoadFrom. What is likely to break, if anything, if I replace LoadFile with LoadFrom? Even if it iss benign, it may be that I cannot do the replacement, just based on project schedules. If I cannot replace LoadFile with LoadFrom, is there a way to convince assemblies loaded with LoadFile to load dependencies? Is there a packaging trick I can use (embedded assembly, ILMerge, an AssemblyResolve event, something like that) that can allow an assembly loaded with LoadFile to also load its dependencies?

    Read the article

  • How can I load combo box's data when it has been defined in DataTemplate codebehind ?

    - by Naseem
    Hi, In my silverlight application,I need to have dynamic columns in my DataGrid . So I had to create all the columns and their DataTemplate dynamically .When user wants to edit the column , a combo box will be displayed which has different values based on selected column. For creating each column I have wrote : foreach (var itemFilter in ProductFilterCollection) { DataGridTemplateColumn templateColumn = new DataGridTemplateColumn(); templateColumn.Header = itemFilter.Description.ToString(); templateColumn.CellTemplate = CreateCellTemplate(typeof(TextBlock), itemFilter.Description.ToString()); templateColumn.CellEditingTemplate = CreateEditingTemplate(typeof(ComboBox), itemFilter.Description.ToString()); grdTest.Columns.Add(templateColumn); } Here is the code for creating DataTemplate dynamically. public DataTemplate CreateCellTemplate(Type type, string strBinding) { return (DataTemplate)XamlReader.Load(@"<DataTemplate xmlns=""http://schemas.microsoft.com/client/2007""> <" + type.Name + @" Text=""{Binding " + strBinding + @"}""/> </DataTemplate>"); } public DataTemplate CreateEditingTemplate(Type type, string strBinding) { return (DataTemplate)XamlReader.Load(@"<DataTemplate xmlns=""http://schemas.microsoft.com/client/2007""> <" + type.Name + @" Loaded=""ddlTest_Loaded"" Tag=""{Binding " + strBinding + @"}""/> </DataTemplate>"); } I need to use Loaded="ddlTest_Loaded" in CreateEditingTemplate() ,in order to load the combo box . However it causes exception . When I remove Loaded event it's fine however the combo box is empty. How can I load the combo box when I define it in DataTemplate codebehind.

    Read the article

  • Is the Java classpath final after JVM startup?

    - by Jens
    Hi, I have read a lot about the Java class loading process lately. Often I came across texts that claimed that it is not possible to add classes to the classpath during runtime and load them without class loader hackery (URLClassLoaders etc.) As far as I know classes are loaded dynamically. That means their bytecode representation is only loaded and transformed to a java.lang.Class object when needed. So shouldn't it be possible to add a JAR or *.class file to the classpath after the JVM started and load those classes, provided they haven't been loaded yet? (To be clear: In this case the classpath is simple folder on the filesystem. "Adding a JAR or *.class file" simply means dropping them in this folder.) And if not, does that mean that the classpath is searched on JVM startup and all fully qualified names of the found classes are cached in an internal "list"? It would be nice of you if you could point me to some sources in your answers. Preferably the offical SUN documentation: Sun JVM Spec. I have read the spec but could not find anything about the classpath and if it's finalized on JVM startup. P.s. This is a theoretical question. I just want to know if it is possible. There is nothing practical I want to achieve. There is just my thirst for knowledge :)

    Read the article

  • GWT: Populating a page from datastore using RPC is too slow

    - by Ilya Boyandin
    Is there a way to speed up the population of a page with GWT's UI elements which are generated from data loaded from the datastore? Can I avoid making the unnecessary RPC call when the page is loaded? More details about the problem I am experiencing: There is a page on which I generate a table with names and buttons for a list of entities loaded from the datastore. There is an EntryPoint for the page and in its onModuleLoad() I do something like this: final FlexTable table = new FlexTable(); rpcAsyncService.getAllCandidates(new AsyncCallback<List<Candidate>>() { public void onSuccess(List<Candidate> candidates) { int row = 0; for (Candidate person : candidates) { table.setText(row, 0, person.getName()); table.setWidget(row, 1, new ToggleButton("Yes")); table.setWidget(row, 2, new ToggleButton("No")); row++; } } ... }); This works, but takes more than 30 seconds to load the page with buttons for 300 candidates. This is unacceptable. The app is running on Google App Engine and using the app engine's datastore.

    Read the article

  • loading a href's content into a shadowbox using .load() HELP!!!

    - by kielie
    <script type="text/javascript"> $(function() { $('#wp-calendar a').click(function(event) { event.preventDefault(); var url = $(this).attr('href') + ' #content'; var loaded = Shadowbox.load(url); Shadowbox.open({ content: loaded, player: "html", title: "<?php the_title(); ?>", height: 300, width: 470, }); }); }); </script> That is the code I am using to try and display content in a shadowbox, I am using the default wordpress calendar and with jQuery/AJAX (if I am not mistaken) adding this click event to every link in the calendar, so that when a link is clicked, the content is loaded and displayed in a shadowbox instead of opening on a new page. When I click on one of the links all I get inside of the shadowbox is "undefined". As I am sure you can see in my code, I am still very new to this, so any help or pointers would be appreciated. Thanx in advance!

    Read the article

  • Flex 3 - Image cache

    - by BS_C3
    Hello Community. I'm doing an Image Cache following this method: http://www.brandondement.com/blog/2009/08/18/creating-an-image-cache-with-actionscript-3/ I copied the two as classes, renaming them CachedImage and CachedImageMap. The thing is that I don't want to store the image after being loaded a first time, but while the application is being loaded. For that, I've created a function that is called by the application pre-initialize event. This is how it looks: private function loadImages():void { var im:CachedImage = new CachedImage; var sources:ArrayCollection = new ArrayCollection; for each(var cs in divisionData.division.collections.collection.collectionSelection) { sources.addItem(cs.toString()); } for each(var se in divisionData.division.collections.collection.searchEngine) { sources.addItem(se.toString()); } for each( var source:String in sources) { im.source = source; im.load(source); } } The sources are properly retrieved. However, even if I use the load method, I do not get the "complete" event... As if the image is not being loaded... How is that? Any help would be appreciated. Thanks in advance. Regards, BS_C3

    Read the article

  • deep linking in Excel sheets exported to html

    - by pomarc
    hello everybody, I am working on a project where I must export to html a lot of Excel files. This is pretty straightforward using automation and saving as html. The problem is that many of these sheets have links to worksheets of some other files. I must find a way to write a link to a single inner worksheet. When you export a multisheet excel file to html, excel creates a main htm file, a folder named filename_file, and inside this folder it writes down several files: a css, an xml list of files, a file that creates the tab bar and several html files named sheetxxx.htm, each one representing a worksheet. When you open the main file, you can click the menu bar at the bottom which lets you select the appropriate sheet. This is in fact a link, which replaces a frame content with the sheetxxx.htm file. When this file is loaded a javascript function that selects the right tab gets called. The exported files will be published on a web site. I will have to post process each file and replace every link to the other xls files to the matching htm file, finding a way to open the right worksheet. I think that I could add a parameter to the processed htm file link url, such as myfile.htm?sh=sheet002.htm if I want to link to the second worksheet of myfile.htm (ex myfile.xls). After I've exported them, I could inject a simple javascript into each of the main files which, when they are loaded, could retrieve the sh parameter with jQuery (this is easy) and use this to somehow replace the frSheet frame contents (where the sheets get loaded), opening the right inner sheet and not the default sheet (this is what I call deep linking) mimicking what happens when a user clicks on a tab. This last step is missing... :) I am considering different options, such as replacing the source of the $("frSheet") frame after document.ready. I'd like to hear from you any advice on what could be the best way to realize that in your opinion. any help is greately appreciated, many thanks.

    Read the article

  • non-cached RSLs in Flex?

    - by SteMa
    I have a project that is for several customers, the only difference is in the DB, everything else looks the same, except for the main page's text. That is loaded from an external swf file. I created a library, compiled it as an swc, imported it and using it as an RSL. The problem is that if once I've opened the page, and afterwards update the rsl (because changes in the text are needed), than it's already cached by the browser (not the flashplayer's cache but we shouldn't discuss this please!) and the updated swf won't be loaded. If I use it as an external, the page won't even start up (the browser says it's loaded, but it's blank, not even the loading progess bar of flex appear) <local:MainPage includeIn="default" currentState="{MainPageState}" id="Page" width="100%" height="100%" /> this is the code on the main page, if I comment this out, than the whole thing loads, even with the use of the "external" link-type. If it helps, in the design view, I see the component, but I get a warning for the library: Design mode could not load MainPage.swc. It may be incompatible with this SDK, or invalid. (DesignAssetLoader.CompleteTimeout)

    Read the article

  • How to determine loading status of images not attached to the DOM

    - by Rookwood
    I am working on a bit of javascript to plot data on a <canvas. The data points are marked by one of several different (small) image files. I am attempting to have the plot method wait until all the images are loaded. My best attempt thus far is such: var icon = { left : { air : new Image(), bone : new Image(), }, right : { air: new Image(), bone : new Image(), }, }; icon.left.air.src = option.imgPath + 'left.air.png'; icon.right.air.src = option.imgPath + 'right.air.png'; icon.left.bone.src = option.imgPath + 'left.bone.png'; icon.right.bone.src = option.imgPath + 'right.bone.png'; function main() { Canvas.draw(); // Make sure our image icons are loaded before we try to plot $(icon.left.air).load(function() { $(icon.right.air).load(function() { $(icon.left.bone).load(function() { $(icon.right.bone).load(function() { Data.plot(); }); }); }); }); } This works as expected most of the time. On occasion, it will fail and no data will be plotted. Inserting several console.log() statements shows that the script will silently stop working through the series of .load() statements, though code that comes after will be executed. My questions are as follows: Am I approaching this the right way? Is there a way to attach an event to my icon object that will fire once all of the images inside are loaded? This is a jquery plugin, so obviously jquery-based solutions are just as acceptable as vanilla javascript.

    Read the article

  • How to make a self contained jQuery plugin that finds the tallest image height?

    - by Jannis
    I have been trying to make this to be a little jQuery plugin that I can reuse in the future without having to write the following into my actions.js file in full. This works when loaded in the same file where I set the height using my variable tallest. var tallest = null; $('.slideshow img').each(function(index) { if ($(this).height() >= tallest ) { tallest = $(this).height(); } }); $('.slideshow').height(tallest); This works and will cycle through all the items, then set the value of tallest to the greatest height found. The following however does not work: This would be the plugin, loaded from its own file (before the actions.js file that contains the parts using this): (function($){ $.fn.extend({ tallest: function() { var tallest = null; return this.each(function() { if ($(this).height() >= tallest ) { tallest = $(this).height(); } }); } }); })(jQuery); Once loaded I am trying to use it as follows: $('.slideshow img').tallest(); $('.slideshow').height(tallest); However the above two lines return an error of 'tallest is undefined'. How can I make this work? Any ideas would be appreciated. Thinking about this even more the perfect usage of this would be as follows: $('.container').height(tallest('.container item')); But I wouldn't even know where to begin to get this to work in the manner that you pass the object to be measured into the function by adding it into the brackets of the function name. Thanks for reading, Jannis

    Read the article

  • Is there a way to automatically load navigational property using the .NET Entity Framework?

    - by René Wolferink
    Stepping away more and more from writing SQL for my applications, I decided to give the Entity Framework a try. However, I've run into something I believe is causing me to write more code than I think is strictly necessary. When I accessed some navigational properties, I discovered that all many-to-one relations (simple references) were null and all one-to-many and many-to-many relations (EntityCollections) were empty. For example: I have a User with a reference to a Group. When I have retieved a User, by using a simple select-by-id, the Group property is null. If I want to access the Group I have to manually load it (using User.GroupReference.Load()). So I added a GetGroup() method in User which checks whether the Group is loaded already and, if not, does so and then returns the Group. Now this will result in a lot of highly similar methods for all navigational properties. And it all results in the navigational properties not being used, only my custom-made Get"PropertyName"() method's are now being used. I don't want to expand my queries (linq to entities) to immediately load all these properties, because it's not always known at first what is needed. And besides, it would cause a lot of queries to have to be made. Is there a way to configure the Entity Framework to load these objects when they happen to not be present? So when I access User.Group and the group is not loaded yet, it is loaded automatically? Or am I stuck using my own Get"PropertyName"() method's as long as I'm trying to load objects only on demand (or "just-in-time")? Some extra info: I'm using VS2008 SP1 with .NET 3.5 SP1. The Entity Framework I'm using is the one that got shipped with it.

    Read the article

  • [ASP.NET MVC] Run ajax scripts on page with navigating with ajax?

    - by Oskar Kjellin
    I got a bit of an issue in my ASP.NET MVC project. I have a chat div in the bottom right corner (like facebook), and of course I do not want this to reload when navigating to all my navigation is ajax. The problem I am facing is that I use the following code on the top of the view page: <script type="text/javascript"> $(document).ready(function() { $('#divTS').hide(); $('a#showTS').click(function() { $('#divTS').slideToggle(400); return false; }); }); </script> The problem is that this code is only loaded with ajax and does not seem to fire? I would like to run all scripts in the newly loaded view, just as if I hadn't navigated with ajax. I cannot put this in the site.master as it only loads once and then probably the divs I am trying to hide doesn't exist. Is there a good way to run scripts in the ajax-loaded div?

    Read the article

  • Android opengl releasing textures

    - by user1642418
    I have a bit of a problem. I am developing a game for android + engine and I got stuck. I am getting OpenGL out of memory error and either app crashes or phone hangs after loading a scene multiple times. For example: app launches, shows main menu, 1st level/scene is loaded. Then I go back to main menu, and repeat. It doesnt matter which scene I load, after 4-6 times the error occurs. Some background: Each time when scene is loaded all the resources are released and upon first frame render - needed stuff gets loaded. The performance is more or less ok. Note that I am calling glDeleteTexture method, but I think its not doing its job and releasing memory. Thing is that -when I minimize and open it again - problem doesn't occur, but almost the same things are executed. Problem doesn't occur. This way android releases memory. How do I release/get rid of unused textures properly? This happens on HTC Desire HD ( ice cream sandwich 4.0.4) . Other games works fine, so I bet this is not the problem in ROM.

    Read the article

  • Slideshow in Javascript without framework, animation?

    - by aaron
    The issue I am having is fairly complicated to explain. I have written up a javascript that displays an image slideshow, and it works fairly well, despite using up more resources than I would like // imgArr[] is populated before var i = 0; var pageLoaded = 0; window.onload = function() {pageLoaded = 1;} function loaded(i,f) { if (document.getElementById(i) != null) f(); else if (!pageLoaded) setTimeout('loaded(\''+i+'\','+f+')',100); } } function displaySlideshow() { document.getElementById(destinationId).innerHTML = '<div id="slideWindow"><img src="'+imgArr[i]+'" />' + '<img src="'+imgArr[i + 1]+'" /></div>'; setTimeout('displaySlideshow()',1000*3); i++; if (i >= imgArr.length - 1) i = 0; } loaded(destinationId,displaySlideshow); So, this script dynamically adds two images to a HTML element, and it is wrapped in a div. The div is styled with the height and width of the image, with the overflow (the second image) hidden. The second image is below the first, and the slideshow is meant to go from RIGHT to LEFT. My inquiry is twofold: 1) Is there a more efficient way of doing this? 2) How would I animate the images? Would I need to put the second image on the right of the first with CSS somehow, and then set a timer to pull the images (via a style) leftward?

    Read the article

  • Getting setting cookies on different domains, with javascript or other

    - by Luca Matteis
    Haven't been able to find anything particular to this situation online so here i go... I need to set/get the cookies stored at "first.com" while browsing "second.com", I have full access of "first.com" but i only have javascript access (can manipulate the DOM as i want) on "second.com". My first approach was to create an iframe on second.com (with js) that loaded a page like "first.com/doAjax?setCookie=xxx" and that did an ajax call to say "first.com/setCookie?cookieData=xxx" which would set the cookie on "first.com" with the data we passed around. That pretty much worked fine for setting the cookie on first.com from second.com - for getting a cookie I basically followed the same procedure, created the iframe that loaded "first.com/doAjax?getCookie" and that would do an ajax call to say "first.com/getCookie" which would read the cookie info on first.com and return it as a JSON object. The problem is that I'm unable to bring that JSON cookie object back to "second.com" so I can read it, well maybe i could just bring it when the Ajax call is complete using "window.top" but there's timing issues because its not relative to when the iframe has been loaded. I hope i am clear and was wondering if there's an easier solution rather than this crazy iframe-ajax crap, also seems like this wont even work for getting cookies in SAFARI.

    Read the article

  • Visual Studio 2010 is not allowing me to debug my code

    - by Tejs
    So, this interesting issue has been plaguing me for the past couple of hours. Visual Studio 2010 Ultimate no longer attaches the debugger and lets me debug my code. If I use the built in development server, then everything works fine. If I switch to Use Local IIS Web Server (http://localhost/), then all it does it attach to w3wp.exe, but no DLLs or PDBs are loaded for anything. I can go to Debug Windows Modules, and literally nothing is loaded in this window. Conversely, when using the built in development server, the Modules window displays all the DLLs and shows that the symbols for my DLLs have been loaded. Something is obviously amiss. The VS installation is completely bone stock. In IIS, my website is configured with ASP.NET 2.0 (because no 3.5 exists to select from the drop down), along with read / log visits / index this resource options checked on the "Home Directory" tab. Some of my failed ideas: 1) If I attach to process on the iexplore.exe instance where the website is displayed, it loads Internet Explorer's DLLs, but not mine. 2) I've restarted the computer multiple times 3) I've invoked devenv.exe /resetuserdata once 4) I've confirmed that every project is indeed set to debug and not release. 5) Deleted all \bin contents and rebuilt the solution. 6) Deleted entire solution and repulled from Source Control. Can someone tell me what is wrong with this thing? I'm going to have an aneurism from the headache this is causing me.

    Read the article

  • Initializing own plugins

    - by jgauffin
    I've written a few jquery plugins for my client. I want to write a function which would initialize each plugin which have been loaded. Example: <script src="/Scripts/jquery.plugin1.min.js")" type="text/javascript"></script> <script src="/Scripts/jquery.plugin2.min.js")" type="text/javascript"></script> <script src="/Scripts/jquery.initializer.min.js")" type="text/javascript"></script> Here I've loaded plugin1 and plugin2. Plugin1 should be attached to all links with class name 'ajax' and plugin2 to all divs with class name 'test2': $('document').ready(function(){ $('a.ajax').plugin1(); $('div.test2').plugin2(); } I know that I can use jQuery().pluginName to check if a plugin exists. But I want to have a leaner way. Can all loaded plugins register a initialize function in an array or something like that which I in document.ready can iterate through and invoke? like: //in plugin1.js myCustomPlugins['plugin1'] = function() { $('a.ajax').plugin1(); }; // and in the initializer script: myCustomPlugins.each(function() { this(); }; Guess it all boiled down to three questions: How do I use a jquery "global" array? How do I iterate through that array to invoke registered methods Are there a better approach?

    Read the article

  • Lazy load images in UITableViewCell

    - by lostInTransit
    Hi I have some 50 custom cells in my UITableView. I want to display an image and a label in the cells where I get the images from URLs. I want to do a lazy load of images so the UI does not freeze up while the images are being loaded. I tried getting the images in separate threads but I have to load each image every time a cell becomes visible again (Otherwise reuse of cells shows old images) Apps like Facebook load images only for cells currently visible and once the images are loaded, they are not loaded again. Can someone please tell me how to duplicate this behavior. Thanks. Edit Trying to cache images in an NSMutableDictionary object creates problems when the user scrolls fast. I am getting images only when scrolling completely stops and clearing out the cache on memory warning. But the app invariably gets a memory warning (due to size of images being cached) and clears the cache before reloading. If scrolling is very fast, it crashes. Any other suggestions are welcome

    Read the article

  • IE7 & IE8 error executing function with ajax

    - by Yahreen
    I am loading an ajax page which executes an HTML5 video player script. The function for the Flash fallback is html5media(); : //Load 1st Case Study $("#splash").live('click', function (e) { $(this).fadeOut('slow', function () { $('#case-studies').load('case-study-1.html', function() { html5media(); //initiate Flash fallback }).fadeIn(); }); e.preventDefault(); }); This initial page load works fine in IE7 & IE8. The problem is once this page is loaded, there are links to 4 more videos which are loaded in again using ajax. I use this function: //Switcher function csClients(url, client) { $("#case-studies").fadeOut('slow', function() { $('#case-studies').load(url, function () { html5media(); //initiate Flash fallback }).fadeIn(); }); } //Page Loader $("#cs-client-list li.client1 a").live('click', function(e) { csClients('case-study-1.html', 'client1'); e.preventDefault(); }); Originally I was using return false; but none of the sub-page Flash videos would load in IE7. When I switched to preventDefault, the videos loaded in IE7 but still not in IE8. I also get a weird error in both IE7 & IE8 with no helpful feedback: Error on Page: Unspecified error. / (Line 49) Code: 0 (Char 5) URI: http://www.mysite.com This is line 49 in my index page: <section id="case-studies" class="main-section"> I have a feeling it has to do with calling html5media(); too many times? At a loss...

    Read the article

  • Best practice when removing entity regarding mappedBy collections?

    - by Daniel Bleisteiner
    I'm still kind of undecided which is the best practice to handle em.remove(entity) with this entity being in several collections mapped using mappedBy in JPA. Consider an entity like a Property that references three other entities: a Descriptor, a BusinessObject and a Level entity. The mapping is defined using @ManyToOne in the Property entity and using @OneToMany(mappedBy...) in the other three objects. That inverse mapping is defined because there are some situations where I need to access those collections. Whenever I remove a Property using em.remove(prop) this element is not automatically removed from managed entities of the other three types. If I don't care about that and the following page load (webapp) doesn't reload those entities the Property is still found and some decisions might be taken that are no longer true. The inverse mappings may become quite large and though I don't want to use something like descriptor.getProperties().remove(prop) because it will load all those properties that might have been lazy loaded until then. So my currently preferred way is to refresh the entity if it is managed: if (em.contains(descriptor)) em.refresh(descriptor) - which unloads a possibly loaded collection and triggers a reload upon the next access. Is there another feasible way to handle all those mappedBy collections of already loaded entites?

    Read the article

  • Background loading javascript into iframe with using jQuery/Ajax?

    - by user210099
    I'm working on an offline only help system which requires loading a large amount of search-related data into an iframe before the search functionality can be used. Due to the folder structure of the project, I am unable to use Ajax-related background load methods, since the files I need are loaded a few directories "up and over." I have written some code which delays the loading of the help data until the rest of the webpage is loaded. The help data consists of a bunch of javascript files which have information about the terms, ect that exist in the help books which are installed on the system. The webpage works fine, until I start to load this help data into a hidden iframe. While the javascript files are loading, I can not use any of the webpage. Links that require a small files be downloaded for hover over effects don't show up, javascript (switching tabs on the page) has no effect. I'm wondering if this is just a limitation of the way javascript works, or if there's something else going on here. Once all the files are loaded for the help system, the webpage works as expected. function test(){ var MGCFrame = eval("parent.parent"); if((ALLFRAMESLOADED == true)){ t2 = MGCFrame.setTimeout("this.IHHeader.frames[0].loadData()",1); } else{ t1 = MGCFrame.setTimeout("this.IHHeader.frames[0].test()",1000); } } Load data simply starts the data loading process. Thanks for any help you can provide.

    Read the article

  • Should I re-use UI elements across view controllers?

    - by Endemic
    In the iPhone app I'm currently working on, I'd like two navigation controllers (I'll call them A and B) to have toolbars that are identical in appearance and function. The toolbar in question will look like this: [(button) (flexible-space) (label)] For posterity's sake, the label is actually a UIBarButtonItem with a custom view. My design requires that A always appear directly before B on the navigation stack, so B will never be loaded without A having been loaded. Given this layout, I started wondering, "Is it worth it to re-use A's toolbar items in B's toolbar?" As I see it, my options are: 1. Don't worry about re-use, create the toolbar items twice 2. Create the toolbar items in A and pass them to B in a custom initializer 3. Use some more obscure method that I haven't thought of to hold the toolbar constant when pushing a view controller As far as I can see, option 1 may violate DRY, but guarantees that there won't be any confusion on the off chance that (for example) the button may be required to perform two different (no matter how similar) functions for either view controller in future versions of the app. Were that to happen, options 2 or 3 would require the target-action of the button to change when B is loaded and unloaded. Even if the button were never required to perform different functions, I'm not sure what its proper target would be under option 2. All in all, it's not a huge problem, even if I have to go with option 1. I'm probably overthinking this anyway, trying to apply the dependency injection pattern where it's not appropriate. I just want to know the best practice should this situation arise in a more extreme form, like if a long chain of view controllers need to use identical (in appearance and function) UI elements.

    Read the article

  • Maintaining Mouse Control in Embedded swfs (i.e. parent / child ) Flash cs4 AS3

    - by garydev
    Hello to all, I have an issue that is driving me nuts. I have an AS3 application that performs a calculation based upon user's input to determine a result. The purpose is to predict the results of a horse's coat color based on the genetics. The results are given in a 3d model swfs that are loaded into the "shell's" UILoader Component and they rotate. I have an example of this here: http://www.provideoshow.com/coatcalculator/coat_calculator.html As you can see this works fine with an "auto-rotate" feature. The problem is that my client wants the 3d models to be rotated by the user's mouse. I have the 3d models rotating with the mouse but they only work when they are stand alone swfs. They break when they are loaded into the shell. Some research informs me that the issue is in the stage properties and the parent not receiving them from the child. I've gotten some advice that I need to pass a reference to the shell's stage and preferably in the init function. This is the code I have in the child which is loaded as a class public function Main_master_withmouse() { if(stage) { _stage = stage; init(stage); } } protected function init(rootStage:Stage):void { if(rootStage) { _stage = rootStage; } else { _stage = this.stage; } sceneWidth = _stage.stageWidth createChildren(); startRendering(); } I can't figure out what to put in the parent to pass the reference to its stage. Any help is greatly appreciated. Thank you in advance

    Read the article

  • Background loading javascript into iframe without using jQuery/Ajax?

    - by user210099
    I'm working on an offline only help system which requires loading a large amount of search-related data into an iframe before the search functionality can be used. Due to the folder structure of the project, I am unable to use Ajax-related background load methods, since the files I need are loaded a few directories "up and over." I have written some code which delays the loading of the help data until the rest of the webpage is loaded. The help data consists of a bunch of javascript files which have information about the terms, ect that exist in the help books which are installed on the system. The webpage works fine, until I start to load this help data into a hidden iframe. While the javascript files are loading, I can not use any of the webpage. Links that require a small files be downloaded for hover over effects don't show up, javascript (switching tabs on the page) has no effect. I'm wondering if this is just a limitation of the way javascript works, or if there's something else going on here. Once all the files are loaded for the help system, the webpage works as expected. function test(){ var MGCFrame = eval("parent.parent"); if((ALLFRAMESLOADED == true)){ t2 = MGCFrame.setTimeout("this.IHHeader.frames[0].loadData()",1); } else{ t1 = MGCFrame.setTimeout("this.IHHeader.frames[0].test()",1000); } } Load data simply starts the data loading process. Thanks for any help you can provide.

    Read the article

  • JavaScript Fails to load content correctly on start

    - by Gaz_Edge
    I have inherited an image gallery constructed using javascript. I believe it uses a variation of JQuery, but it seems to have been heavily edited. The gallery loads the first image on page load. Each image has comments below them. There are forward and backward arrows that move between images. The problem I seem to have is that if there is a comment on image one, it is not loaded on page start, the only way to get it to display is to click forward to the next image, then click back to image one. The comment is then shown. All the comments are loaded into a script in the header under var sent_comments = [{COMMENTS}] The comment HTML code on loading is as follows; <div id="comments_container"> <div id="comments"> </div> </div> Once I have clicked to image two and then back to image one, the code is; <div id="comments_container"> <div id="comments"> SOME COMMENT </div> </div> Previous image button is: <a class="prev save_state" href="#"> <img src="/next.png?" alt="Next"> </a> Im new to javascript so not really sure what I will need to do to ensure the comment is loaded for the first image when the page loads. Code here: http://static.albumexposure.net/assets/presentation-9f47b054d96f9ec2459e89619a5fe9b4.js http://static.albumexposure.net/assets/presentations/book-699d82a2beb39df264e54c5d2578e0e4.js

    Read the article

< Previous Page | 35 36 37 38 39 40 41 42 43 44 45 46  | Next Page >